Other Parts Discussed in Thread:C2000WARE

CAN通信中断使能只能提供 了一个函数

static void CAN_enableInterrupt ( uint32_t base, uint32_t intFlags )
CAN_INT_ERROR – a controller error condition has occurred
CAN_INT_STATUS – a message transfer has completed, or a bus error has been detected
CAN_INT_IE0 – allow CAN controller to generate interrupts on interrupt line 0
CAN_INT_IE1 – allow CAN controller to generate interrupts on interrupt line 1
Susan Yang:

user4675816 说:CAN通信中断使能


//! Setup a Message Object
//! \param base is the base address of the CAN controller.
//! \param objID is the message object number to configure (1-32).
//! \param msgID is the CAN message identifier used for the 11 or 29 bit
//! \param frame is the CAN ID frame type
//! \param msgType is the message object type
//! \param msgIDMask is the CAN message identifier mask used when identifier
//!filtering is enabled
//! \param flags is the various flags and settings to be set for the message
//! \param msgLen is the number of bytes of data in the message object (0-8)
//! This function sets the various values required for a message object.
//! The \e frame parameter can be one of the following values:
//! - \b CAN_MSG_FRAME_STD - Standard 11 bit identifier
//! - \b CAN_MSG_FRAME_EXT - Extended 29 bit identifier
//! The \e msgType parameter can be one of the following values:
//! - \b CAN_MSG_OBJ_TYPE_TX- Transmit Message
//! - \b CAN_MSG_OBJ_TYPE_TX_REMOTE- Transmit Remote Message
//! - \b CAN_MSG_OBJ_TYPE_RX- Receive Message
//! - \b CAN_MSG_OBJ_TYPE_RXTX_REMOTE - Receive Remote message with
//! The \e flags parameter can be set as \b CAN_MSG_OBJ_NO_FLAGS if no flags
//! are required or the parameter can be a logical OR of any of the following
//! values:
//! - \b CAN_MSG_OBJ_TX_INT_ENABLE- Enable Transmit Interrupts
//! - \b CAN_MSG_OBJ_RX_INT_ENABLE- Enable Receive Interrupts
//! - \b CAN_MSG_OBJ_USE_ID_FILTER- Use filtering based on the Message ID
//! - \b CAN_MSG_OBJ_USE_EXT_FILTER- Use filtering based on the Extended
//!Message ID
//! - \b CAN_MSG_OBJ_USE_DIR_FILTER- Use filtering based on the direction of
//!the transfer
//! - \b CAN_MSG_OBJ_FIFO- Message object is part of a FIFO
//!structure and isn't the final message
//!object in FIFO
//! If filtering is based on message identifier, the value
//! \b CAN_MSG_OBJ_USE_ID_FILTER has to be logically ORed with the \e flag
//! parameter and \b CAN_MSG_OBJ_USE_EXT_FILTER also has to be ORed for
//! message identifier filtering to be based on the extended identifier.
//! \note The \b msgLen Parameter for the Receive Message Object is a "don't
//!care" but its value should be between 0-8 due to the assert.
//! \return None.
extern void
CAN_setupMessageObject(uint32_t base, uint32_t objID, uint32_t msgID,CAN_MsgFrameType frame, CAN_MsgObjType msgType,uint32_t msgIDMask, uint32_t flags, uint16_t msgLen);
//! This indicates that transmit interrupts should be enabled, or are enabled.

user4675816 说:如果用寄存器编程,CAN的寄存器名称叫什么,就是CAN寄存器那个总的共用体名字。







Susan Yang:


未经允许不得转载:TI中文支持网 » F280049库函数编程CAN通信只想使能发送中断如何实现。
分享到: 更多 (0)