AceCRC  0.1
Cyclic Redundancy Check (CRC) algorithms (e.g. crc32(), crc16ccitt()) are progammatically converted from pycrc to Arduino C++, including variants (e.g. 4-bit versus 8-bit tables) that trade space and time.
Typedefs | Functions
crc16ccitt_nibble.hpp File Reference
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for crc16ccitt_nibble.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint_fast16_t ace_crc::crc16ccitt_nibble::crc_t
 The type of the CRC values. More...
 

Functions

crc_t ace_crc::crc16ccitt_nibble::crc_update (crc_t crc, const void *data, size_t data_len)
 Update the crc value with new data. More...
 

Detailed Description

Functions and types for CRC checks.

Generated on Sun Nov 29 20:58:50 2020 by pycrc v0.9.2, https://pycrc.org using the configuration:

This file defines the functions crc_init(), crc_update() and crc_finalize().

The crc_init() function returns the inital crc value and must be called before the first call to crc_update(). Similarly, the crc_finalize() function must be called after the last call to crc_update(), before the crc is being used. is being used.

The crc_update() function can be called any number of times (including zero times) in between the crc_init() and crc_finalize() calls.

This pseudo-code shows an example usage of the API:

crc_t crc;
unsigned char data[MAX_DATA_LEN];
size_t data_len;
crc = crc_init();
while ((data_len = read_data(data, MAX_DATA_LEN)) > 0) {
crc = crc_update(crc, data, data_len);
}
crc = crc_finalize(crc);

Auto converted to Arduino C++ on Sun Nov 29 20:58:50 PST 2020 by AceCRC (https://github.com/bxparks/AceCRC). DO NOT EDIT

Definition in file crc16ccitt_nibble.hpp.

Typedef Documentation

◆ crc_t

typedef uint_fast16_t ace_crc::crc16ccitt_nibble::crc_t

The type of the CRC values.

This type must be big enough to contain at least 16 bits.

Definition at line 68 of file crc16ccitt_nibble.hpp.

Function Documentation

◆ crc_update()

crc_t ace_crc::crc16ccitt_nibble::crc_update ( crc_t  crc,
const void *  data,
size_t  data_len 
)

Update the crc value with new data.

Parameters
[in]crcThe current crc value.
[in]dataPointer to a buffer of data_len bytes.
[in]data_lenNumber of bytes in the data buffer.
Returns
The updated crc value.

Definition at line 43 of file crc16ccitt_nibble.cpp.

ace_crc::crc16ccitt_bit::crc_t
uint_fast16_t crc_t
The type of the CRC values.
Definition: crc16ccitt_bit.hpp:68
ace_crc::crc16ccitt_bit::crc_update
crc_t crc_update(crc_t crc, const void *data, size_t data_len)
Update the crc value with new data.
Definition: crc16ccitt_bit.cpp:30