Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
crc.h File Reference

CRC computation function. More...

#include <zephyr/types.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define CRC8_CCITT_INITIAL_VALUE   0xFF
 

Functions

uint16_t crc16 (const uint8_t *src, size_t len, uint16_t polynomial, uint16_t initial_value, bool pad)
 Generic function for computing CRC 16. More...
 
uint8_t crc8 (const uint8_t *src, size_t len, uint8_t polynomial, uint8_t initial_value, bool reversed)
 Generic function for computing CRC 8. More...
 
uint16_t crc16_ccitt (uint16_t seed, const uint8_t *src, size_t len)
 Compute the CRC-16/CCITT checksum of a buffer. More...
 
uint16_t crc16_itu_t (uint16_t seed, const uint8_t *src, size_t len)
 Compute the CRC-16/XMODEM checksum of a buffer. More...
 
static uint16_t crc16_ansi (const uint8_t *src, size_t len)
 Compute ANSI variant of CRC 16. More...
 
uint32_t crc32_ieee (const uint8_t *data, size_t len)
 Generate IEEE conform CRC32 checksum. More...
 
uint32_t crc32_ieee_update (uint32_t crc, const uint8_t *data, size_t len)
 Update an IEEE conforming CRC32 checksum. More...
 
uint32_t crc32_c (uint32_t crc, const uint8_t *data, size_t len, bool first_pkt, bool last_pkt)
 Calculate CRC32C (Castagnoli) checksum. More...
 
uint8_t crc8_ccitt (uint8_t initial_value, const void *buf, size_t len)
 Compute CCITT variant of CRC 8. More...
 
uint8_t crc7_be (uint8_t seed, const uint8_t *src, size_t len)
 Compute the CRC-7 checksum of a buffer. More...
 

Detailed Description

CRC computation function.

Macro Definition Documentation

◆ CRC8_CCITT_INITIAL_VALUE

#define CRC8_CCITT_INITIAL_VALUE   0xFF