|
ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
|
#include <stdint.h>#include <stdlib.h>

Go to the source code of this file.
Macros | |
| #define | CRC_ALGO_BIT_BY_BIT 1 |
Typedefs | |
| typedef uint_fast16_t | crc_16_dnp_bbb_t |
Functions | |
| static crc_16_dnp_bbb_t | crc_16_dnp_bbb_init (void) |
| crc_16_dnp_bbb_t | crc_16_dnp_bbb_update (crc_16_dnp_bbb_t crc, const void *data, size_t data_len) |
| crc_16_dnp_bbb_t | crc_16_dnp_bbb_finalize (crc_16_dnp_bbb_t crc) |
Functions and types for CRC checks.
Generated on Mon Aug 24 06:27:49 2020 by pycrc v0.9.2, https://pycrc.org using the configuration:
This file defines the functions crc_16_dnp_bbb_init(), crc_16_dnp_bbb_update() and crc_16_dnp_bbb_finalize().
The crc_16_dnp_bbb_init() function returns the inital crc value and must be called before the first call to crc_16_dnp_bbb_update(). Similarly, the crc_16_dnp_bbb_finalize() function must be called after the last call to crc_16_dnp_bbb_update(), before the crc is being used. is being used.
The crc_16_dnp_bbb_update() function can be called any number of times (including zero times) in between the crc_16_dnp_bbb_init() and crc_16_dnp_bbb_finalize() calls.
This pseudo-code shows an example usage of the API:
Definition in file crc_16_dnp_bbb.h.
| #define CRC_ALGO_BIT_BY_BIT 1 |
The definition of the used algorithm.
This is not used anywhere in the generated code, but it may be used by the application code to call algorithm-specific code, if desired.
Definition at line 57 of file crc_16_dnp_bbb.h.
| typedef uint_fast16_t crc_16_dnp_bbb_t |
The type of the CRC values.
This type must be big enough to contain at least 16 bits.
Definition at line 64 of file crc_16_dnp_bbb.h.
| crc_16_dnp_bbb_t crc_16_dnp_bbb_finalize | ( | crc_16_dnp_bbb_t | crc | ) |
Calculate the final crc value.
| [in] | crc | The current crc value. |
Definition at line 58 of file crc_16_dnp_bbb.c.
|
inlinestatic |
Calculate the initial crc value.
Definition at line 71 of file crc_16_dnp_bbb.h.
| crc_16_dnp_bbb_t crc_16_dnp_bbb_update | ( | crc_16_dnp_bbb_t | crc, |
| const void * | data, | ||
| size_t | data_len ) |
Update the crc value with new data.
| [in] | crc | The current crc value. |
| [in] | data | Pointer to a buffer of data_len bytes. |
| [in] | data_len | Number of bytes in the data buffer. |
Definition at line 37 of file crc_16_dnp_bbb.c.