ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
Loading...
Searching...
No Matches
hdlc_common.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for hdlc_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HDLC_FRAME_T
 Generic HDLC frame buffer descriptor. More...
 

Macros

HDLC Constants
#define HDLC_FLAG_BYTE   0x7E
 
#define HDLC_ESCAPE_BYTE   0x7D
 
#define HDLC_ESCAPE_XOR   0x20
 

Functions

uint16_t hdlc_crc16 (const uint8_t *payload, size_t num_bytes)
 Compute HDLC CRC16 (FCS) over a payload.
 

Macro Definition Documentation

◆ HDLC_ESCAPE_BYTE

#define HDLC_ESCAPE_BYTE   0x7D

Definition at line 30 of file hdlc_common.h.

◆ HDLC_ESCAPE_XOR

#define HDLC_ESCAPE_XOR   0x20

Definition at line 31 of file hdlc_common.h.

◆ HDLC_FLAG_BYTE

#define HDLC_FLAG_BYTE   0x7E

Definition at line 29 of file hdlc_common.h.

Function Documentation

◆ hdlc_crc16()

uint16_t hdlc_crc16 ( const uint8_t *  payload,
size_t  num_bytes 
)

Compute HDLC CRC16 (FCS) over a payload.

Parameters
payloadInput data bytes.
num_bytesNumber of bytes in payload.
Returns
Computed CRC16 value.

Definition at line 45 of file hdlc_common.c.

References crc16_ccitt_false().

Referenced by hdlc_decode(), hdlc_decode_byte(), hdlc_encode(), and hdlc_encode_byte().

Here is the call graph for this function:
Here is the caller graph for this function: