crc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. This software is subject to the license described in the license.txt file included with this software distribution.
  3. You may not use this file except in compliance with this license.
  4. Copyright © Dynastream Innovations Inc. 2012
  5. All rights reserved.
  6. */
  7. /** @file
  8. * @brief The CRC-16 interface.
  9. * This file is based on implementation originally made by Dynastream Innovations Inc. - August 2012
  10. * @defgroup ant_fs_client_main ANT-FS client device simulator
  11. * @{
  12. * @ingroup nrf_ant_fs_client
  13. *
  14. * @brief The ANT-FS client device simulator.
  15. *
  16. */
  17. #ifndef CRC_H__
  18. #define CRC_H__
  19. #include <stdint.h>
  20. /**@brief Function for calculating CRC-16 in blocks.
  21. *
  22. * Feed each consecutive data block into this function, along with the current value of current_crc
  23. * as returned by the previous call of this function. The first call of this function should pass
  24. * the initial value (usually 0) of the crc in current_crc.
  25. * @param[in] current_crc The current calculated CRC-16 value.
  26. * @param[in] p_data The input data block for computation.
  27. * @param[in] size The size of the input data block in bytes.
  28. *
  29. * @return The updated CRC-16 value, based on the input supplied.
  30. */
  31. uint16_t crc_crc16_update(uint16_t current_crc, const volatile void * p_data, uint32_t size);
  32. #endif // CRC_H__
  33. /**
  34. *@}
  35. **/