|
| constexpr | Crc8 (uint8_t polynomial, uint8_t initial_value, bool reflect_in, bool reflect_out, uint8_t xor_out) |
| | Constructs a Crc8 calculator with the specified parameters.
|
| |
| constexpr uint8_t | Calculate (pw::span< const std::byte > data) const |
| | Calculates the CRC-8 value for the given data.
|
| |
|
|
static const Crc8 | kCrc8 |
| | CRC-8: poly=0x07, init=0x00, refin=false, refout=false, xout=0x00.
|
| |
|
static const Crc8 | kMaxim |
| | CRC-8/MAXIM: poly=0x31, init=0x00, refin=true, refout=true, xout=0x00.
|
| |
|
static const Crc8 | kWcdma |
| | CRC-8/WCDMA: poly=0x9B, init=0x00, refin=true, refout=true, xout=0x00.
|
| |
|
static const Crc8 | kItu |
| | CRC-8/ITU: poly=0x07, init=0x00, refin=false, refout=false, xout=0x55.
|
| |
|
static const Crc8 | kRohc |
| | CRC-8/ROHC: poly=0x07, init=0xFF, refin=true, refout=true, xout=0x00.
|
| |
◆ Crc8()
| constexpr pw::checksum::Crc8::Crc8 |
( |
uint8_t |
polynomial, |
|
|
uint8_t |
initial_value, |
|
|
bool |
reflect_in, |
|
|
bool |
reflect_out, |
|
|
uint8_t |
xor_out |
|
) |
| |
|
inlineconstexpr |
Constructs a Crc8 calculator with the specified parameters.
- Parameters
-
| polynomial | The polynomial used for the CRC calculation. |
| initial_value | The initial value of the CRC register. |
| reflect_in | Whether the input bytes should be reflected before processing. |
| reflect_out | Whether the final CRC value should be reflected. |
| xor_out | The value to XOR with the final CRC result. |
◆ Calculate()
| constexpr uint8_t pw::checksum::Crc8::Calculate |
( |
pw::span< const std::byte > |
data | ) |
const |
|
constexpr |
Calculates the CRC-8 value for the given data.
- Parameters
-
| data | The data to calculate the CRC-8 for. |
- Returns
- The CRC-8 value.
The documentation for this class was generated from the following file:
- pw_checksum/public/pw_checksum/crc8.h