26 namespace crc16modbus_bit {
36 for (i = 1; i < data_len; i++) {
38 ret = (ret << 1) | (data & 0x01);
44 crc_t crc_update(
crc_t crc,
const void *data,
size_t data_len)
46 const unsigned char *d = (
const unsigned char *)data;
53 for (i = 0x01; i & 0xff; i <<= 1) {
54 bit = (crc & 0x8000) ^ ((c & i) ? 0x8000 : 0);
crc_t crc_reflect(crc_t data, size_t data_len)
Reflect all bits of a data word of data_len bytes.
Functions and types for CRC checks.
uint16_t crc_t
The type of the CRC values.