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

#include <dev_can.h>

Data Fields

struct rt_device parent
 
const struct rt_can_opsops
 
struct can_configure config
 
struct rt_can_status status
 
rt_uint32_t timerinitflag
 
struct rt_timer timer
 
struct rt_can_status_ind_type status_indicate
 
struct rt_mutex lock
 
void * can_rx
 
void * can_tx
 
struct rt_ringbuffer nb_tx_rb
 
rt_uint8_t nb_tx_rb_pool [RT_CAN_NB_TX_FIFO_SIZE]
 

Detailed Description

The core CAN device structure.

Field Documentation

◆ parent

struct rt_device rt_can_device::parent

Inherits from the base RT-Thread device structure.

◆ ops

const struct rt_can_ops* rt_can_device::ops

A pointer to the low-level driver operations.

◆ config

struct can_configure rt_can_device::config

The current configuration of the CAN device.

◆ status

struct rt_can_status rt_can_device::status

The current status and error statistics of the CAN device.

◆ timerinitflag

rt_uint32_t rt_can_device::timerinitflag

A flag to indicate if the status timer has been initialized.

◆ timer

struct rt_timer rt_can_device::timer

A timer for periodically checking the CAN bus status.

◆ status_indicate

struct rt_can_status_ind_type rt_can_device::status_indicate

The user-registered status indication callback.

◆ lock

struct rt_mutex rt_can_device::lock

A mutex for thread-safe access to the device.

◆ can_rx

void* rt_can_device::can_rx

A pointer to the software receive FIFO structure (rt_can_rx_fifo).

◆ can_tx

void* rt_can_device::can_tx

A pointer to the software transmit FIFO structure (rt_can_tx_fifo).

◆ nb_tx_rb

struct rt_ringbuffer rt_can_device::nb_tx_rb

The ring buffer for non-blocking transmissions.

◆ nb_tx_rb_pool

rt_uint8_t rt_can_device::nb_tx_rb_pool[RT_CAN_NB_TX_FIFO_SIZE]

The statically allocated pool for the non-blocking TX ring buffer.