crc.h File Reference
Cyclic Redundancy Check 16 (CRC). More...
#include <cfg/compiler.h>
Go to the source code of this file.
Defines | |
| #define | UPDCRC16(c, oldcrc) (crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))] ^ ((oldcrc) << 8)) |
| Compute the updated CRC16 value for one octet (macro version). | |
Functions | |
| uint16_t | updcrc16 (uint8_t c, uint16_t oldcrc) |
| Compute the updated CRC16 value for one octet (macro version). | |
| uint16_t | crc16 (uint16_t crc, const void *buf, size_t len) |
| This function implements the CRC 16 calculation on a buffer. | |
Variables | |
| const uint16_t | crc16tab [256] |
| crctab calculated by Mark G. | |
Detailed Description
Cyclic Redundancy Check 16 (CRC).
- Note:
- This algorithm is incompatible with the CCITT-CRC16.
Programmers may incorporate any or all code into their programs, giving proper credit within the source. Publication of the source routines is permitted so long as proper credit is given to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, Omen Technology.
- Version:
- Id
- crc.h 2506 2009-04-15 08:29:07Z duplo
Definition in file crc.h.
Define Documentation
| #define UPDCRC16 | ( | c, | |||
| oldcrc | ) | (crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))] ^ ((oldcrc) << 8)) |
Compute the updated CRC16 value for one octet (macro version).
- Note:
- This version is only intended for old/broken compilers. Use the inline function in new code.
- Parameters:
-
c New octet (range 0-255) oldcrc Previous CRC16 value (referenced twice, beware of side effects)
Function Documentation
| uint16_t crc16 | ( | uint16_t | crc, | |
| const void * | buf, | |||
| size_t | len | |||
| ) |
Variable Documentation
| const uint16_t crc16tab[256] |
