#include "stdint.h"
Go to the source code of this file.
|
uint8_t | crc8 (uint8_t crc, uint8_t Size, uint8_t *Buffer) |
| Helper function to compute CRC. More...
|
|
◆ HEADER_CHAR1
#define HEADER_CHAR1 0xCC |
Character for preamble - 1st byte, if is needed
◆ HEADER_CHAR2
#define HEADER_CHAR2 0xDD |
Character for preamble - 2nd byte, if is needed
◆ DataframeCrc_t
Can globally set the CRC computation for dataframe.
Enumerator |
---|
CRC_OFF | DataFrame does not contain any CRC
|
CRC_ON | DataFrame contain CRC byte as last byte of packet
|
◆ DataframeError_t
Internal representation of error state.
Enumerator |
---|
ERROR_NONE | There is no error in dataframe create.
|
ERROR_OVERFLOW | The dataframe has small capacity
|
◆ DataframeType_t
Definition of DatFrame type. Can be simple frame, or frame with some preamble.
Enumerator |
---|
TYPE_PLAIN | Dataframe with plain content. There is no header of preamble in frame
|
TYPE_HEADER_1B | Dataframe contain first byte as a preamble of packet
|
TYPE_HEADER_2B | Dataframe contain first 2 bytes as a preamble of packet
|
◆ crc8()
uint8_t crc8 |
( |
uint8_t |
crc, |
|
|
uint8_t |
Size, |
|
|
uint8_t * |
Buffer |
|
) |
| |
Helper function to compute CRC.
- Parameters
-
crc | - initial CRC, use 0 if dont know about it. |
Size | - size of input buffer |
Buffer | - input array with bytes |