uint_t8 CAN_Transmit(CanTxMsg* TxMessage)
typedef struct { uint_t32 StdId; uint_t32 ExtId; uint_t8 IDE; uint_t8 RTR; uint_t8 DLC; uint_t8 Data[8]; } CanTxMsg
IDE | 説明 |
CAN_ID_STD | 標準識別子を使用します |
CAN_ID_EXT拡張識別子を使用します |
RTR | 説明 |
CAN_RTR_DATA | Data frame |
CAN_RTR_REMOTE | Remote frame |
/* Send a message with the CAN */ CanTxMsg TxMessage; TxMessage.StdId = 0x1F; TxMessage.ExtId = 0x00; TxMessage.IDE = CAN_ID_STD; TxMessage.RTR = CAN_RTR_DATA; TxMessage.DLC = 2; TxMessage.Data[0] = 0xAA; TxMessage.Data[1] = 0x55; CAN_Transmit(&TxMessage);