数据帧中扩展标示符的帧如何配置的啊其中还有一位SRR,可是我在野火的例程程序没看见配置SRR位啊,而且CanTXMsg库函数只有44位这是为什么啊?3.5.0的库函数扩展标识符数据帧是得自己定义一个结构体吗?
void CAN_SetMsg(void){
//TxMessage.StdId=0x00;
TxMessage.ExtId=0x1314; //使用的扩展ID
TxMessage.IDE=CAN_ID_EXT; //扩展模式
TxMessage.RTR=CAN_RTR_DATA; //发送的是数据
TxMessage.DLC=2; //数据长度为2字节
TxMessage.Data[0]=0xDC;
TxMessage.Data[1]=0xBA;
}
typedef struct
{
uint32_t StdId; /*!< Specifies the standard identifier.
This parameter can be a value between 0 to 0x7FF. */
uint32_t ExtId; /*!< Specifies the extended identifier.
This parameter can be a value between 0 to 0x1FFFFFFF. */
uint8_t IDE; /*!< Specifies the type of identifier for the message that
will be transmitted. This parameter can be a value
of @ref CAN_identifier_type */
uint8_t RTR; /*!< Specifies the type of frame for the message that will
be transmitted. This parameter can be a value of
@ref CAN_remote_transmission_request */
uint8_t DLC; /*!< Specifies the length of the frame that will be
transmitted. This parameter can be a value between
0 to 8 */
uint8_t Data[8]; /*!< Contains the data to be transmitted. It ranges from 0
to 0xFF. */
} CanTxMsg;
|