SmartSnippets DA1459x SDK
sdk_crc16.h
Go to the documentation of this file.
1 
34 #ifndef SDK_CRC16_
35 #define SDK_CRC16_
36 
37 #include <stddef.h>
38 #include <stdint.h>
39 
40 /*
41  * \brief Initialize CRC16
42  *
43  * \param [in] crc16 pointer to CRC16 value
44  *
45  */
46 void crc16_init(uint16_t *crc16);
47 
48 /*
49  * \brief Updates CRC16
50  *
51  * \param [in] crc16 pointer to CRC16 value
52  * \param [in] buf data buffer
53  * \param [in] len length of data
54  *
55  */
56 void crc16_update(uint16_t *crc16, const uint8_t *buf, size_t len);
57 
58 /*
59  * \brief Calculate CRC16
60  *
61  * \param [in] buf data buffer
62  * \param [in] len length of data
63  *
64  * \return CRC16 value
65  *
66  */
67 uint16_t crc16_calculate(const uint8_t *buf, size_t len);
68 
69 #endif /* SDK_CRC16_ */