ZHCAF60 February 2025 MSPM0G3507
表 3-3 中列出了各种可配置的参数。用户可以通过修改 user_define.h 中定义的所有参数来配置 CAN 或 SPI 数据包帧、FIFO 的大小或数据区域的最大规模。
用户还可以在 user_define.h 中修改 Custom_Element 的定义。可根据应用程序和存储要求,增加或减少条目。
/*user-defined information storage structure */
typedef struct {
/*! Origin Identifier, indicating the origin of the message */
uint32_t origin_id;
/*! Destination Identifier, indicating the destination of the message */
uint32_t destination_id;
/*! Data Length Code */
uint8_t dlc;
/*! Data bytes */
uint8_t data[TRANSMIT_DATA_LENGTH];
} Custom_Element;
两个通信接口的接收和发送是分开的。报文将通过 FIFO 传送。因此,用户可以对结构进行更改。例如,使消息遵循特定的格式,甚至遵循特定的通信协议。此外,可以根据 图 2-3,将结构拆分为单向传输。