Base class of the CRC8 calculator.
More...
#include <crc.hpp>
|
| CRC8 (const uint8_t init, const uint8_t polynomial, const bool refIn, const bool refOut, const uint8_t xorout) |
|
uint8_t | range (const uint8_t *data, size_t len) |
| Calculate the CRC of the specified range.
|
|
uint8_t | update (const uint8_t *data, size_t len) |
| Stores the CRC of the specified array using the current internal information.
|
|
uint8_t | value () const |
| CRC value at the time of the call.
|
|
|
static uint8_t | calculate (const uint8_t *data, size_t len, const uint8_t init, const uint8_t polynomial, const bool refIn, const bool refOut, const uint8_t xorout, bool do_finalize=true) |
| Calculate CRC8.
|
|
|
static uint8_t | finalize (const uint8_t value, const bool refOut, const uint8_t xorout) |
|
Base class of the CRC8 calculator.
◆ CRC8()
m5::utility::CRC8::CRC8 |
( |
const uint8_t | init, |
|
|
const uint8_t | polynomial, |
|
|
const bool | refIn, |
|
|
const bool | refOut, |
|
|
const uint8_t | xorout ) |
|
inline |
- Parameters
-
init | Initial value |
polynormal | Generated polynomial |
refIn | Inverted input? |
refOut | Inverted output? |
xorout | Exclusive OR output |
◆ calculate()
static uint8_t m5::utility::CRC8::calculate |
( |
const uint8_t * | data, |
|
|
size_t | len, |
|
|
const uint8_t | init, |
|
|
const uint8_t | polynomial, |
|
|
const bool | refIn, |
|
|
const bool | refOut, |
|
|
const uint8_t | xorout, |
|
|
bool | do_finalize = true ) |
|
inlinestatic |
Calculate CRC8.
- Parameters
-
data | Pointer of the array |
len | Length of the array |
polynormal | Generated polynomial |
refIn | Inverted input? |
refOut | Inverted output? |
xorout | Exclusive OR output |
do_finalize | Apply processing to output values?(true as defaut) |
- Returns
- CRC value
◆ range()
uint8_t m5::utility::CRC8::range |
( |
const uint8_t * | data, |
|
|
size_t | len ) |
|
inline |
Calculate the CRC of the specified range.
- Parameters
-
data | Pointer of the array |
len | Length of the array |
- Returns
- CRC value
◆ update()
uint8_t m5::utility::CRC8::update |
( |
const uint8_t * | data, |
|
|
size_t | len ) |
|
inline |
Stores the CRC of the specified array using the current internal information.
- Parameters
-
data | Pointer of the array |
len | Length of the array |
- Returns
- CRC value
- Note
- Used when you want to calculate the value of the entire divided continuous data, such as streaming data
◆ value()
uint8_t m5::utility::CRC8::value |
( |
| ) |
const |
|
inline |
CRC value at the time of the call.
- Returns
- CRC value