| 123456789101112131415161718192021222324252627 |
- #ifndef _MAILBOX_MESSAGE_H_
- #define _MAILBOX_MESSAGE_H_
- #include "mailbox.h"
- #define MB_RX_QUEUE_LEN 8 // 每个消息类型的接收队列长度
- #define MB_FRAME_DSIZE (MAILBOX_DR_SUM*4 - 2) // 帧头占2字节
- typedef enum {
- MB_MSG_T_SYS_UPDATE = 0,
- MB_MSG_T_CAN_UPDATE,
- MB_MSG_T_MEDIA_UPDATE,
- MB_MSG_T_DCIC_DETECT,
- MB_MSG_T_MCU_MODULE_ACCESS,
- MB_MSG_T_CPU_MODULE_ACCESS,
- MB_MSG_T_MAX,
- }mb_msg_type_t;
- typedef struct {
- uint8_t data[MB_FRAME_DSIZE];
- uint32_t dl;
- }mb_rxmsg_t;
- int mailbox_msg_send(mb_msg_type_t type, const uint8_t *data, uint32_t dl, TickType_t xTicksToWait);
- BaseType_t mailbox_msg_receive(mb_msg_type_t type, mb_rxmsg_t *msg, TickType_t xTicksToWait);
- void mailbox_msg_init(void);
- #endif
|