Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.
source/nordic_sdk/components/libraries/crc16/crc16.h@19:47192cb9def7, 2016-04-07 (annotated)
- Committer:
- vcoubard
- Date:
- Thu Apr 07 17:37:40 2016 +0100
- Revision:
- 19:47192cb9def7
- Parent:
- 10:233fefd8162b
- Child:
- 20:a90c48eb1d30
Synchronized with git rev 9251259f
Author: Liyou Zhou
Copy over coresponding files from nordic-sdk 9.0.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vcoubard | 19:47192cb9def7 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
vcoubard | 19:47192cb9def7 | 2 | * |
vcoubard | 19:47192cb9def7 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
vcoubard | 19:47192cb9def7 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
vcoubard | 19:47192cb9def7 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
vcoubard | 19:47192cb9def7 | 6 | * |
vcoubard | 19:47192cb9def7 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
vcoubard | 19:47192cb9def7 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
vcoubard | 19:47192cb9def7 | 9 | * the file. |
vcoubard | 19:47192cb9def7 | 10 | * |
Vincent Coubard |
0:f2542974c862 | 11 | */ |
Vincent Coubard |
0:f2542974c862 | 12 | |
Vincent Coubard |
0:f2542974c862 | 13 | /** @file |
Vincent Coubard |
0:f2542974c862 | 14 | * |
Vincent Coubard |
0:f2542974c862 | 15 | * @defgroup crc_compute CRC compute |
Vincent Coubard |
0:f2542974c862 | 16 | * @{ |
Vincent Coubard |
0:f2542974c862 | 17 | * @ingroup hci_transport |
Vincent Coubard |
0:f2542974c862 | 18 | * |
Vincent Coubard |
0:f2542974c862 | 19 | * @brief This module implements the CRC-16 calculation in the blocks. |
Vincent Coubard |
0:f2542974c862 | 20 | */ |
Vincent Coubard |
0:f2542974c862 | 21 | |
Vincent Coubard |
0:f2542974c862 | 22 | #ifndef CRC16_H__ |
Vincent Coubard |
0:f2542974c862 | 23 | #define CRC16_H__ |
Vincent Coubard |
0:f2542974c862 | 24 | |
Vincent Coubard |
0:f2542974c862 | 25 | #include <stdint.h> |
Vincent Coubard |
0:f2542974c862 | 26 | |
Vincent Coubard |
0:f2542974c862 | 27 | /**@brief Function for calculating CRC-16 in blocks. |
Vincent Coubard |
0:f2542974c862 | 28 | * |
Vincent Coubard |
0:f2542974c862 | 29 | * Feed each consecutive data block into this function, along with the current value of p_crc as |
Vincent Coubard |
0:f2542974c862 | 30 | * returned by the previous call of this function. The first call of this function should pass NULL |
Vincent Coubard |
0:f2542974c862 | 31 | * as the initial value of the crc in p_crc. |
Vincent Coubard |
0:f2542974c862 | 32 | * |
Vincent Coubard |
0:f2542974c862 | 33 | * @param[in] p_data The input data block for computation. |
Vincent Coubard |
0:f2542974c862 | 34 | * @param[in] size The size of the input data block in bytes. |
Vincent Coubard |
0:f2542974c862 | 35 | * @param[in] p_crc The previous calculated CRC-16 value or NULL if first call. |
Vincent Coubard |
0:f2542974c862 | 36 | * |
Vincent Coubard |
0:f2542974c862 | 37 | * @return The updated CRC-16 value, based on the input supplied. |
Vincent Coubard |
0:f2542974c862 | 38 | */ |
Vincent Coubard |
0:f2542974c862 | 39 | uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc); |
Vincent Coubard |
0:f2542974c862 | 40 | |
Vincent Coubard |
0:f2542974c862 | 41 | #endif // CRC16_H__ |
Vincent Coubard |
0:f2542974c862 | 42 | |
vcoubard | 1:ebc0e0ef0a11 | 43 | /** @} */ |