SCOM Serial Communication Protocol  0.5.2
scom_ack_frame.h
Go to the documentation of this file.
1 
10 #ifndef SCOM_ACK_H_
11 #define SCOM_ACK_H_
12 
13 #include "hal.h"
14 #include "scom_frame.h"
15 #include <stdbool.h>
16 #include <stdint.h>
17 
18 
20 typedef struct HAL_PACKED {
21  uint8_t sync;
22  uint8_t soack;
23  uint8_t ctrl;
24  uint8_t type;
25  uint16_t frame_crc;
26  uint16_t crc;
27 } SCOMAckFrame;
28 
29 enum {
30 
32 };
33 
41 bool SCOMAckFrame_Initialize(SCOMAckFrame* const ackFrame, const SCOMFrame* const frame);
42 
51 bool SCOMAckFrame_IsValidAck(const SCOMAckFrame* const ackFrame, const SCOMFrame* const frame);
52 
59 uint16_t SCOMAckFrame_CalculateCRC(const SCOMAckFrame* const ackFrame);
60 
61 
62 #endif /* EXTERNALS_SCOM_SCOM_ACK_H_ */
uint8_t sync
synchronization field: always 0xFF
struct HAL_PACKED SCOMAckFrame
Definition of an SCOM acknowledgment frame.
SCOM version record.
Definition: scom.h:81
Start of frame character.
bool SCOMAckFrame_IsValidAck(const SCOMAckFrame *const ackFrame, const SCOMFrame *const frame)
uint8_t type
frame type field
bool SCOMAckFrame_Initialize(SCOMAckFrame *const ackFrame, const SCOMFrame *const frame)
uint8_t soack
start of ACK frame field
uint8_t ctrl
frame control field
uint16_t crc
crc field
uint16_t SCOMAckFrame_CalculateCRC(const SCOMAckFrame *const ackFrame)
uint16_t frame_crc
frame crc field
SCOM frame definition.