uint8_t CAN_Transmit(CanTxMsg* TxMessage)
typedef struct { uint32_t StdId; uint32_t ExtId; uint8_t IDE; uint8_t RTR; uint8_t DLC; uint8_t 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);