--- libelwix/inc/elwix/acrc.h 2024/10/10 23:53:00 1.7.36.1 +++ libelwix/inc/elwix/acrc.h 2024/10/12 16:08:18 1.9 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: acrc.h,v 1.7.36.1 2024/10/10 23:53:00 misho Exp $ +* $Id: acrc.h,v 1.9 2024/10/12 16:08:18 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -85,6 +85,7 @@ unsigned int crcCalc(unsigned char * __restrict psBuf, #define crc_16(x, l) crcCalc((x), (l), 16, REVOPTS_REVERTBYTE|REVOPTS_REVERTCRC, 0x0, 0x0) #define crc_16_ccitt(x, l) crcCalc((x), (l), 161, 0, 0x0, 0x0) #define crc_16_xmodem(x, l) crcCalc((x), (l), 162, REVOPTS_REVERTBYTE|REVOPTS_REVERTCRC, 0x0, 0x0) +#define crc_8(x, l) crcCalc((x), (l), 8, 0, 0x0, 0x0) /* * crc16_ccitt() - Checksum calculation @@ -165,6 +166,15 @@ unsigned int crcAdler(unsigned char * __restrict psBuf */ #define crcEther(psBuf, bufLen) crcCalc((psBuf), (bufLen), 32, 3, 0xFFFFFFFF, 0xFFFFFFFF) +/* + * crc8tbl() - CRC8 calculation from table + * + * @crc = Initial crc value + * @buf = Data for calculation + * @len = Length of data + * return: calculated CRC8 + */ +uint8_t crc8tbl(unsigned char crc, const unsigned char * __restrict buf, unsigned int len); /* * crc32tbl() - CRC32 calculation from table *