![]() |
![]() |
CAN frame structure. More...
#include <types.h>
Data Fields | |
| union { | |
| canid_t can_id | |
| struct { | |
| uint32_t id: 29 | |
| uint32_t err: 1 | |
| uint32_t rtr: 1 | |
| uint32_t eff: 1 | |
| } | |
| }; | |
| union { | |
| uint8_t can_dlc | |
| uint8_t dlc | |
| }; | |
| uint8_t | __pad |
| uint8_t | __res0 |
| uint8_t | __res1 |
| uint8_t | data [8] |
CAN frame structure.
The structure that makes up a CAN message. The unions are provided in order for there to be structural naming compatibility with SocketCAN while at the same time providing an alternative easier to use naming convention. We diverge a bit with TI structural naming convention of the struct in order to provide an option to be compatible with SocketCAN conventions.
| canid_t can_frame::can_id |
11/29-bit CAN ID + EFF/RTR/ERR flags, SocketCAN
| uint32_t can_frame::id |
11/29-bit CAN ID
| uint32_t can_frame::err |
error flag
| uint32_t can_frame::rtr |
remote frame flag
| uint32_t can_frame::eff |
extended frame format flag
| union { ... } |
| uint8_t can_frame::can_dlc |
data length code, SocketCAN compatible
| uint8_t can_frame::dlc |
data length code
| union { ... } |
| uint8_t can_frame::__pad |
alignment padding
| uint8_t can_frame::__res0 |
reserved
| uint8_t can_frame::__res1 |
reserved
| uint8_t can_frame::data[8] |
CAN frame payload data