utils
utilities in C for microcontrollers
|
functions for calculating 16 bit cyclic redundancy codes More...
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | CRC16_INIT (0xffff) |
initial crc value | |
#define | CRC16_FINALIZE(val) (val ^ 0xffff) |
finalize crc value More... | |
Functions | |
int | crc16 (uint16_t *crc, const uint8_t *data, size_t size) |
computes the crc for data and uses crc for the result More... | |
functions for calculating 16 bit cyclic redundancy codes
#define CRC16_FINALIZE | ( | val | ) | (val ^ 0xffff) |
finalize crc value
val | an initialized crc value |
int crc16 | ( | uint16_t * | crc, |
const uint8_t * | data, | ||
size_t | size | ||
) |
computes the crc for data and uses crc for the result
crc | pointer to initialized crc value |
data | pointer to data over which to calculate crc |
size | number of bytes of data |