AceCRC  0.3.1
Cyclic Redundancy Check (CRC) algorithms (e.g. crc32(), crc16ccitt()) programmatically converted from C99 code generated by pycrc (https://pycrc.org) to Arduino C++ using namespaces and PROGMEM flash memory.
Typedefs | Functions | Variables
crc8_byte.hpp File Reference
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for crc8_byte.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint8_t ace_crc::crc8_byte::crc_t
 The type of the CRC values. More...
 

Functions

crc_t ace_crc::crc8_byte::crc_init (void)
 Calculate the initial crc value. More...
 
crc_t ace_crc::crc8_byte::crc_update (crc_t crc, const void *data, size_t data_len)
 Update the crc value with new data. More...
 
crc_t ace_crc::crc8_byte::crc_finalize (crc_t crc)
 Calculate the final crc value. More...
 
crc_t ace_crc::crc8_byte::crc_calculate (const void *data, size_t data_len)
 Calculate the crc in one-shot. More...
 

Variables

const uint8_t ace_crc::crc8_byte::CRC_ALGO_TABLE_DRIVEN = 1
 The definition of the used algorithm. More...
 

Detailed Description

Functions and types for CRC checks.

Generated on Thu Dec 3 21:05:47 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 Thu Dec 3 21:05:47 PST 2020 by AceCRC (https://github.com/bxparks/AceCRC). DO NOT EDIT

Definition in file crc8_byte.hpp.

Typedef Documentation

◆ crc_t

typedef uint8_t ace_crc::crc8_byte::crc_t

The type of the CRC values.

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

Definition at line 68 of file crc8_byte.hpp.

Function Documentation

◆ crc_calculate()

crc_t ace_crc::crc8_byte::crc_calculate ( const void *  data,
size_t  data_len 
)
inline

Calculate the crc in one-shot.

This is a convenience function added by AceCRC.

Parameters
[in]dataPointer to a buffer of data_len bytes.
[in]data_lenNumber of bytes in the data buffer.

Definition at line 112 of file crc8_byte.hpp.

◆ crc_finalize()

crc_t ace_crc::crc8_byte::crc_finalize ( crc_t  crc)
inline

Calculate the final crc value.

Parameters
[in]crcThe current crc value.
Returns
The final crc value.

Definition at line 99 of file crc8_byte.hpp.

◆ crc_init()

crc_t ace_crc::crc8_byte::crc_init ( void  )
inline

Calculate the initial crc value.

Returns
The initial crc value.

Definition at line 76 of file crc8_byte.hpp.

◆ crc_update()

crc_t ace_crc::crc8_byte::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 57 of file crc8_byte.cpp.

Variable Documentation

◆ CRC_ALGO_TABLE_DRIVEN

const uint8_t ace_crc::crc8_byte::CRC_ALGO_TABLE_DRIVEN = 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 60 of file crc8_byte.hpp.

ace_crc::crc16ccitt_bit::crc_init
crc_t crc_init(void)
Calculate the initial crc value.
Definition: crc16ccitt_bit.hpp:76
ace_crc::crc16ccitt_bit::crc_finalize
crc_t crc_finalize(crc_t crc)
Calculate the final crc value.
Definition: crc16ccitt_bit.hpp:99
ace_crc::crc16ccitt_bit::crc_t
uint16_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