RT-Thread RTOS
An open source embedded real-time operating system
rt_can_msg Struct Reference

#include <dev_can.h>

Data Fields

rt_uint32_t id: 29
 
rt_uint32_t ide: 1
 
rt_uint32_t rtr: 1
 
rt_uint32_t rsv: 1
 
rt_uint32_t len: 8
 
rt_uint32_t priv: 8
 
rt_int32_t hdr_index: 8
 
rt_uint32_t rxfifo: 2
 
rt_uint32_t nonblocking: 1
 
rt_uint8_t data [8]
 

Detailed Description

The CAN message structure.

Field Documentation

◆ id

rt_uint32_t rt_can_msg::id

CAN ID (Standard or Extended).

◆ ide

rt_uint32_t rt_can_msg::ide

Identifier type: 0=Standard ID, 1=Extended ID.

◆ rtr

rt_uint32_t rt_can_msg::rtr

Frame type: 0=Data Frame, 1=Remote Frame.

◆ rsv

rt_uint32_t rt_can_msg::rsv

Reserved bit.

◆ len

rt_uint32_t rt_can_msg::len

Data Length Code (DLC) from 0 to 8.

◆ priv

rt_uint32_t rt_can_msg::priv

Private data, used to specify the hardware mailbox in private mode.

◆ hdr_index

rt_int32_t rt_can_msg::hdr_index

For received messages, the index of the hardware filter that matched the message.

◆ rxfifo

rt_uint32_t rt_can_msg::rxfifo

The RX FIFO where the message was received.

◆ nonblocking

rt_uint32_t rt_can_msg::nonblocking

Send mode: 0=Blocking (default), 1=Non-blocking.

◆ data

rt_uint8_t rt_can_msg::data[8]

CAN message payload (up to 8 bytes).