Multiple frames (#8)
* Add fields to mmr header * Reorder priority constants * Add message priority * Add header to message * Fix compile error * Set correct bits in header * Refactor * Create queue
This commit is contained in:
committed by
GitHub
parent
e7bb09478e
commit
174f5e8d76
+14
-2
@@ -24,18 +24,30 @@ typedef enum {
|
||||
} MmrCanMessageType;
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
MMR_CAN_MESSAGE_PRIORITY_LOW = B_(0010),
|
||||
MMR_CAN_MESSAGE_PRIORITY_NORMAL = B_(0001),
|
||||
MMR_CAN_MESSAGE_PRIORITY_HIGH = B_(0000),
|
||||
} MmrCanMessagePriority;
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* This struct encodes the values stored inside the
|
||||
* extended id field of a CAN packet.
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t priority : 5;
|
||||
uint32_t senderId : 23;
|
||||
MmrCanMessagePriority priority : 3;
|
||||
uint32_t dictionaryEntry : 10;
|
||||
uint32_t senderId : 12;
|
||||
MmrCanMessageType messageType : 4;
|
||||
} MmrCanHeader;
|
||||
|
||||
|
||||
uint32_t *MMR_CAN_HeaderToBits(MmrCanHeader *header);
|
||||
MmrCanHeader *MMR_CAN_HeaderFromBits(uint32_t *bits);
|
||||
|
||||
bool MMR_CAN_IsMultiFrame(MmrCanHeader *header);
|
||||
bool MMR_CAN_IsMultiFrameEnd(MmrCanHeader *header);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user