Revision e7131d09 core/inc/aos_rtcan.h
core/inc/aos_rtcan.h | ||
---|---|---|
5 | 5 |
|
6 | 6 |
#include <hal.h> |
7 | 7 |
#include <hal_can.h> |
8 |
#include <hal_can_lld.h> |
|
8 | 9 |
|
9 | 10 |
#include <stdint.h> |
10 | 11 |
|
... | ... | |
15 | 16 |
|
16 | 17 |
typedef uint16_t rtcan_id_t; |
17 | 18 |
|
18 |
typedef struct { |
|
19 |
typedef struct rtcan_msg_t{
|
|
19 | 20 |
rtcan_id_t id; |
20 | 21 |
uint8_t* payload; |
21 | 22 |
uint8_t laxity:5; |
22 | 23 |
uint8_t fragmentCounter:7; |
23 | 24 |
uint8_t payloadSize; |
25 |
uint8_t msgType:2; |
|
26 |
systime_t deadline; |
|
27 |
struct rtcan_msg_t *next; |
|
28 |
|
|
24 | 29 |
|
25 | 30 |
}rtcan_msg_t; |
26 | 31 |
|
27 | 32 |
typedef struct { |
28 |
struct rtcan_msg_t *head;
|
|
29 |
struct rtcan_msg_t *tail;
|
|
33 |
rtcan_msg_t *head; |
|
34 |
rtcan_msg_t *tail; |
|
30 | 35 |
uint8_t size; |
31 | 36 |
|
32 | 37 |
}msgqueue_t; |
... | ... | |
51 | 56 |
msg_t rtcan_receive(CANDriver *canp, |
52 | 57 |
canmbx_t mailbox, |
53 | 58 |
CANRxFrame *crfp); |
59 |
bool enqueueMsg(uint8_t *payload,uint8_t msgType,systime_t deadline); |
|
54 | 60 |
#ifdef __cplusplus |
55 | 61 |
} |
56 | 62 |
#endif |
Also available in: Unified diff