crc.h 681 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * \file crc.h
  3. */
  4. #ifndef __MODEL_CRC_H
  5. #define __MODEL_CRC_H
  6. #include "stdint.h"
  7. uint16_t Get_Crc16(uint8_t *puchMsg, uint16_t usDataLen);
  8. uint8_t Get_Crc8(uint8_t *ptr, uint16_t len);
  9. unsigned char CRC8(const unsigned char *dest, unsigned short int len);
  10. uint16_t Checksum_Sum(uint8_t *buf, uint16_t len);
  11. uint16_t tcpChecksum(uint8_t *buf, uint16_t len);
  12. unsigned int cal_crc16(unsigned char buffer[], unsigned char len);
  13. uint16_t cbus_crc(uint8_t pbuf[]);
  14. unsigned int crc_fullymax(unsigned char *q, int len);
  15. #define POWERAMP_CRC8_KEY (0x2A)
  16. uint8_t poweramp_CRC8(uint8_t *ptr, uint8_t len, uint8_t key);
  17. uint8_t YRSocCalcXor(uint8_t *buf, uint8_t len);
  18. #endif