DataFrame  1.0.0
Classes | Macros | Enumerations | Functions
dataframe.h File Reference
#include "stdint.h"
Include dependency graph for dataframe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DataFrame
 Class for representing data frame. More...
 

Macros

#define HEADER_CHAR1   0xCC
 
#define HEADER_CHAR2   0xDD
 

Enumerations

enum  DataframeType_t { TYPE_PLAIN, TYPE_HEADER_1B, TYPE_HEADER_2B }
 
enum  DataframeCrc_t { CRC_OFF, CRC_ON }
 
enum  DataframeError_t { ERROR_NONE, ERROR_OVERFLOW }
 

Functions

uint8_t crc8 (uint8_t crc, uint8_t Size, uint8_t *Buffer)
 Helper function to compute CRC. More...
 

Macro Definition Documentation

◆ 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

Enumeration Type Documentation

◆ 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

Function Documentation

◆ 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