crc16.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * \file stdout
  3. * Functions and types for CRC checks.
  4. *
  5. * Generated on Tue Jun 30 23:02:56 2009,
  6. * by pycrc v0.7.1, http://www.tty1.net/pycrc/
  7. * using the configuration:
  8. * Width = 16
  9. * Poly = 0x8005
  10. * XorIn = 0x0000
  11. * ReflectIn = True
  12. * XorOut = 0x0000
  13. * ReflectOut = True
  14. * Algorithm = bit-by-bit-fast
  15. * Direct = True
  16. *****************************************************************************/
  17. #ifndef __STDOUT__
  18. #define __STDOUT__
  19. #include <stdint.h>
  20. #include <stdlib.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /**
  25. * The definition of the used algorithm.
  26. *****************************************************************************/
  27. #define CRC_ALGO_BIT_BY_BIT_FAST 1
  28. /**
  29. * The type of the CRC values.
  30. *
  31. * This type must be big enough to contain at least 16 bits.
  32. *****************************************************************************/
  33. typedef uint16_t crc_t;
  34. /**
  35. * Update the crc value with new data.
  36. *
  37. * \param crc The current crc value.
  38. * \param data Pointer to a buffer of \a data_len bytes.
  39. * \param data_len Number of bytes in the \a data buffer.
  40. * \return The updated crc value.
  41. *****************************************************************************/
  42. crc_t crc16_update(crc_t crc, const unsigned char *data, size_t data_len);
  43. #ifdef __cplusplus
  44. } /* closing brace for extern "C" */
  45. #endif
  46. #endif /* __STDOUT__ */