12345678910111213141516171819202122232425262728 |
- /*
- * CRC16.h
- *
- * Created on: 2019. 7. 3.
- * Author: parkyj
- */
- #ifndef CRC16_H_
- #define CRC16_H_
- #include "main.h"
- typedef enum{
- CHECKSUM_ERROR = 0,
- NO_ERROR
- }etError;
- uint16_t CRC16_Generate(uint8_t *buf_ptr, int32_t len);
- etError CRC16_Check(uint8_t *buf_ptr, int32_t len,uint16_t checksum);
- uint8_t STH30_CreateCrc(uint8_t *data, uint8_t nbrOfBytes);
- etError STH30_CheckCrc(uint8_t *data, uint8_t nbrOfBytes, uint8_t checksum);
- #define POLYNOMIAL 0x131 // P(x) = x^8 + x^5 + x^4 + 1 = 100110001
- #endif /* CRC16_H_ */
|