48 enum class FilterMode : uint8_t
57 uint32_t start_id_mask;
58 uint32_t end_id_match;
73 uint32_t start_id_mask = 0, uint32_t end_id_match = UINT32_MAX);
80 virtual ErrorCode
AddMessage(
const ClassicPack &pack) = 0;
83 void OnMessage(
const ClassicPack &pack,
bool in_isr);
86 LockFreeList subscriber_list_[
static_cast<uint8_t
>(Type::TYPE_NUM)];
118 using CAN::FilterMode;
119 using CAN::OnMessage;
126 uint32_t start_id_mask;
127 uint32_t end_id_mask;
142 uint32_t start_id_mask = 0, uint32_t end_id_mask = UINT32_MAX);
152 void OnMessage(
const FDPack &pack,
bool in_isr);
155 LockFreeList subscriber_list_fd_[
static_cast<uint8_t
>(Type::TYPE_NUM)];
CAN通信接口,定义标准CAN通信结构,支持不同类型的消息 (CAN communication interface that defines a standard CAN structure supp...
void Register(Callback cb, Type type, FilterMode mode=FilterMode::ID_RANGE, uint32_t start_id_mask=0, uint32_t end_id_match=UINT32_MAX)
注册回调函数 Registers a callback function
Type
CAN 消息类型 (Enumeration of CAN message types).
@ EXTENDED
扩展 CAN 消息 (Extended CAN message).
@ REMOTE_EXTENDED
远程扩展 CAN 消息 (Remote extended CAN message).
@ STANDARD
标准 CAN 消息 (Standard CAN message).
@ REMOTE_STANDARD
远程标准 CAN 消息 (Remote standard CAN message).
virtual ErrorCode AddMessage(const ClassicPack &pack)=0
添加 CAN 消息到系统 (Adds a CAN message to the system).
struct __attribute__((packed))
经典 CAN 消息结构 (Structure representing a classic CAN message).
CAN()
构造 CAN 对象,可指定主题名称和通信域 (Constructs a CAN object with an optional topic name and domain).
提供一个通用的回调包装,支持动态参数传递。 Provides a generic callback wrapper, supporting dynamic argument passing.
FDCAN 通信接口,扩展 CAN 功能,支持灵活数据速率(FD)CAN 消息 (FDCAN communication interface that extends CAN functionality...
struct __attribute__((packed))
FD CAN 消息结构 (Structure representing an FD CAN message).
FDCAN()
构造 FDCAN 对象,可指定主题名称和通信域 (Constructs an FDCAN object with optional topic names and domain).
virtual ErrorCode AddMessage(const FDPack &pack)=0
添加 FD CAN 消息到系统 (Adds an FD CAN message to the system).
void Register(CallbackFD cb, Type type, FilterMode mode=FilterMode::ID_RANGE, uint32_t start_id_mask=0, uint32_t end_id_mask=UINT32_MAX)
注册回调函数 Registers a callback function
链表实现,用于存储和管理数据节点。 A linked list implementation for storing and managing data nodes.