sth30_crc.h 301 B

12345678910111213
  1. #include<stdio.h>
  2. #define POLYNOMIAL 0x131 // P(x) = x^8 + x^5 + x^4 + 1 = 100110001
  3. typedef enum{
  4. CHECKSUM_ERROR = 0,
  5. NO_ERROR
  6. }etError;
  7. extern uint8_t STH30_CreateCrc(uint8_t *data, uint8_t nbrOfBytes);
  8. extern etError STH30_CheckCrc(uint8_t *data, uint8_t nbrOfBytes, uint8_t checksum);