stm32-async-1wire 3.2.0
Non-blocking 1-Wire master for STM32 with DS18B20 temperature and DS2431 EEPROM drivers
Loading...
Searching...
No Matches
CRC Checksums

Functions

uint8_t onewire_crc8 (const uint8_t *data, uint8_t len)
 Calculate the Dallas/Maxim 1-Wire CRC-8 over a byte buffer.
uint16_t onewire_crc16 (const uint8_t *data, uint8_t len)
 Calculate the Maxim 1-Wire CRC-16 over a byte buffer.

Detailed Description

Function Documentation

◆ onewire_crc16()

uint16_t onewire_crc16 ( const uint8_t * data,
uint8_t len )

Calculate the Maxim 1-Wire CRC-16 over a byte buffer.

Parameters
[in]dataInput buffer
[in]lenNumber of bytes to process
Returns
16-bit CRC remainder (CRC-16/ARC parameters: polynomial 0x8005, reflected 0xA001, initial value 0x0000, no final XOR)
Note
This is the raw remainder (the value that, appended low-byte-first, drives a re-check to 0). Devices such as the DS2431 transmit the inverted form (~value); the caller complements when comparing against the bytes on the bus.

◆ onewire_crc8()

uint8_t onewire_crc8 ( const uint8_t * data,
uint8_t len )

Calculate the Dallas/Maxim 1-Wire CRC-8 over a byte buffer.

Parameters
[in]dataInput buffer
[in]lenNumber of bytes to process
Returns
CRC-8 checksum value