libs/libc/misc/lib_crc8ccitt.c: Adds implementation of CRC8-CCITT.

This commit is contained in:
Alan Carvalho de Assis
2018-10-27 16:29:32 -06:00
committed by Gregory Nutt
parent bbd8cfbfb5
commit ea1689409f
4 changed files with 146 additions and 19 deletions
+13 -1
View File
@@ -59,7 +59,8 @@ extern "C"
* Name: crc8part
*
* Description:
* Continue CRC calculation on a part of the buffer.
* Continue CRC calculation on a part of the buffer using the polynomial
* x^8+x^6+x^3+x^2+1 (Koopman, et al. "0xA6" poly).
*
****************************************************************************/
@@ -76,6 +77,17 @@ uint8_t crc8part(FAR const uint8_t *src, size_t len, uint8_t crc8val);
uint8_t crc8(FAR const uint8_t *src, size_t len);
/****************************************************************************
* Name: crc8ccitt
*
* Description:
* Return an 8-bit CRC of the contents of the 'src' buffer, length 'len'
* using the polynomial x^8+x^2+x^1+1 (aka "0x07" poly).
*
****************************************************************************/
uint8_t crc8ccitt(FAR const uint8_t *src, size_t len);
#undef EXTERN
#ifdef __cplusplus
}