This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
c2000的驱动库中
1.请问这个API函数在调用之前是不是还要对IPC_Instance进行地址映射,库函数中没有找到这个操作?2.为什么IPC_TOTAL_NUM的值是0?3.如何使用这个API,在使用这个API之前需要哪些步骤?
2.为什么IPC_TOTAL_NUM的值是0?
它的值是4,而不是0
1.请问这个API函数在调用之前是不是还要对IPC_Instance进行地址映射,库函数中没有找到这个操作?
//***************************************************************************** // //! Sends a command to the Remote core //! //! \param ipcType is the enum corresponding to the IPC instance used //! \param flags is the IPC flag mask for the flags to be set //! \param addrCorrEnable is the flag used to determine whether or not to //! convert the addr parameter to remote core's address space //! \param command is the 32-bit command value //! \param addr is the 32-bit address to be sent as part of command //! \param data is the 32-bit data to be sent as part of command //! //! Allows the caller to send a command to the remote core. A command consists //! of a unique command value, a 32-bit address and a 32-bit data. The function //! also sends the designated flags to the remote core. //! There may be differences in the address spaces of Local and Remote core. //! For example in case of F2838X device, the address spaces of C28x core and //! CM core are different. In case the \e addr refers to an address in the IPC //! MSG RAM, \e addrCorrEnable param may be used to correct the address mismatch //! //! The \e flags parameter can be any of the IPC flag values: \b IPC_FLAG0 - //! \b IPC_FLAG31. //! The \e addrCorrEnable parameter can take values IPC_ADDR_CORRECTION_ENABLE //! (converts the address to remote core's address space) or //! IPC_ADDR_CORRECTION_DISABLE(does not modify the addr parmeter) //! //! The application shall use the function IPC_getResponse to read the response //! sent by the remote core. //! //! \note The application is expected to wait until the the response is //! received before sending another command. //! //! \note \e addrCorrEnable parameter must be kept same on the sending and //! receiving cores //! //! \return Returns \b true if the command is sent properly and \b false if //! the designated flags were busy and hence command was not sent. // //***************************************************************************** extern bool IPC_sendCommand(IPC_Type_t ipcType, uint32_t flags, bool addrCorrEnable, uint32_t command, uint32_t addr, uint32_t data);
不需要的。您直接调用该API即可
具体使用,您可以看一下
里的参数
IPC_CPU1_L_CPU2_R是多少?
它的值是4,而不是0
枚举类型值默认是0的嘛,为什么是4?,如果是4的话,那么4代表的是有4个IPC实例吗?但是28379d不是只有一个IPC模块吗?
枚举类型值默认是0的嘛,为什么是4?
typedef enum { IPC_CPU1_L_CPU2_R, //!< CPU1 - Local core, CPU2 - Remote core IPC_CPU1_L_CM_R, //!< CPU1 - Local core, CM - Remote core IPC_CPU2_L_CPU1_R, //!< CPU2 - Local core, CPU1 - Remote core IPC_CPU2_L_CM_R, //!< CPU2 - Local core, CM - Remote core IPC_TOTAL_NUM }IPC_Type_t;
4代表上面的4个选项
抱歉,之前看了28388的驱动库。在2837xD下是只有
typedef enum
{
IPC_TOTAL_NUM
}IPC_Type_t;
确实是0,应该是库函数内没有写
IPC_CPU1_L_CPU2_R, //!< CPU1 - Local core, CPU2 - Remote core
IPC_CPU2_L_CPU1_R, //!< CPU2 - Local core, CPU1 - Remote core
您可以查看C2000ware
C2000Ware_3_04_00_00\driverlib\f2837xd\examples\dual\ipc
以及
C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x_dual\ipc
那您看一下28388的例程ipc_ex1_basic_c28x
C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x_dual\ipc