2022-11-18 22:06:06 +08:00
|
|
|
#ifndef __CRC_H_
|
|
|
|
#define __CRC_H_
|
|
|
|
|
2023-04-19 18:52:40 +08:00
|
|
|
// 裁判系统官方CRC校验,LUT和module/algorithms中的不同,后续需要统一实现crc,提供8/16/32的支持
|
2023-02-14 11:13:32 +08:00
|
|
|
|
2022-12-12 22:29:51 +08:00
|
|
|
#include <stdint.h>
|
2022-11-18 22:06:06 +08:00
|
|
|
|
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
// CRC8
|
2022-11-19 15:34:15 +08:00
|
|
|
void Append_CRC8_Check_Sum(uint8_t *pchMessage, uint16_t dwLength);
|
|
|
|
uint32_t Verify_CRC8_Check_Sum(uint8_t *pchMessage, uint16_t dwLength);
|
|
|
|
uint8_t Get_CRC8_Check_Sum(uint8_t *pchMessage, uint16_t dwLength, uint8_t ucCRC8);
|
2022-11-18 22:06:06 +08:00
|
|
|
|
|
|
|
// CRC16
|
2022-11-19 15:34:15 +08:00
|
|
|
void Append_CRC16_Check_Sum(uint8_t *pchMessage, uint32_t dwLength);
|
2022-11-18 22:06:06 +08:00
|
|
|
uint32_t Verify_CRC16_Check_Sum(uint8_t *pchMessage, uint32_t dwLength);
|
2022-11-19 15:34:15 +08:00
|
|
|
uint16_t Get_CRC16_Check_Sum(uint8_t *pchMessage, uint32_t dwLength, uint16_t wCRC);
|
2022-11-18 22:06:06 +08:00
|
|
|
|
|
|
|
#endif
|