algo_crc

接口

#define ALGO_CRC8 (0)               // Initial value 0x00
#define ALGO_CRC8_ITU (1)           // Initial value 0x00
#define ALGO_CRC8_ROHC (2)          // Initial value 0xff
#define ALGO_CRC8_MAXIM (3)         // Initial value 0x00
#define ALGO_CRC16_IBM (4)          // Initial value 0x00
#define ALGO_CRC16_MAXIM (5)        // Initial value 0x00
#define ALGO_CRC16_USB (6)          // Initial value 0xffff
#define ALGO_CRC16_MODBUS (7)       // Initial value 0xffff
#define ALGO_CRC16_CCITT (8)        // Initial value 0x00
#define ALGO_CRC16_CCITT_FALSE (9)  // Initial value 0xffff
#define ALGO_CRC16_X25 (10)         // Initial value 0xffff
#define ALGO_CRC16_XMODEM (11)      // Initial value 0x00
#define ALGO_CRC16_DNP (12)         // Initial value 0x00
#define ALGO_CRC32 (13)             // Initial value 0xffffffff
#define ALGO_CRC32_MPEG2 (14)       // Initial value 0xffffffff

/**
 * \brief CRC 直接计算
 * \return uint32_t
 */
uint32_t crc_calculate(uint8_t type, uint8_t *pbuf, uint32_t len);

/**
 * \brief CRC 分段计算
 * \param handle 通过 CRC_REG_SBS_HANDLE 创建后传入指针
 */
void crc_calculate_sbs(algo_crc_sbs_t *phandle, uint8_t *pbuf, uint32_t len);