crc32.h 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * crc32.h
  3. *
  4. * Change Logs:
  5. * Date Author Notes
  6. * 2020-07-02 qiyongzhong first version
  7. */
  8. #ifndef __CRC32_H__
  9. #define __CRC32_H__
  10. #include "typedef.h"
  11. #include "crc_cfg.h"
  12. #ifdef CRCLIB_USING_CRC32
  13. #if (!defined(CRC32_USING_CONST_TABLE) || ((CRC32_POLY != 0xEDB88320) && (CRC32_POLY != 0x82F63B78)))
  14. /*
  15. * @brief cyclic initialize crc table
  16. * @param none
  17. * @retval none
  18. */
  19. void crc32_table_init(void);
  20. #endif
  21. /*
  22. * @brief cyclic calculation crc check value
  23. * @param init_val - initial value
  24. * @param pdata - datas pointer
  25. * @param len - datas len
  26. * @retval calculated result
  27. */
  28. u32 crc32_cyc_cal(u32 init_val, u8 *pdata, u32 len);
  29. /*
  30. * @brief calculation crc check value, initial is CRC32_INIT_VAL
  31. * @param pdata - datas pointer
  32. * @param len - datas len
  33. * @retval calculated result
  34. */
  35. u32 crc32_cal(u8 *pdata, u32 len);
  36. #endif
  37. #endif