boot_crc.h 597 B

123456789101112131415161718
  1. #ifndef BOOT_CRC_H
  2. #define BOOT_CRC_H
  3. #include <stdint.h>
  4. /* CRC32(zlib 参数):支持流式(NOR 分块读入)与一次性两种用法 */
  5. uint32_t boot_crc32_init(void);
  6. uint32_t boot_crc32_update(uint32_t crc, const uint8_t *buf, uint32_t len);
  7. uint32_t boot_crc32_finish(uint32_t crc);
  8. uint32_t boot_crc32(const uint8_t *buf, uint32_t len);
  9. /* Boot 状态记录保护 CRC-16/CCITT-FALSE */
  10. uint16_t boot_crc16_ccitt(const uint8_t *buf, uint32_t len);
  11. /* YMODEM 块 CRC-16/XMODEM(init=0) */
  12. uint16_t boot_ymodem_crc16(const uint8_t *buf, uint32_t len);
  13. #endif /* BOOT_CRC_H */