]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/nordic_sdk/components/libraries/crc16/crc16.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_NORDIC / TARGET_MCU_NRF51822 / Lib / nordic_sdk / components / libraries / crc16 / crc16.h
1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  *
11  */
12  
13 /** @file
14  *
15  * @defgroup crc_compute CRC compute
16  * @{
17  * @ingroup hci_transport
18  *
19  * @brief    This module implements the CRC-16 calculation in the blocks.
20  */
21  
22 #ifndef CRC16_H__
23 #define CRC16_H__
24
25 #include <stdint.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**@brief Function for calculating CRC-16 in blocks.
32  *
33  * Feed each consecutive data block into this function, along with the current value of p_crc as 
34  * returned by the previous call of this function. The first call of this function should pass NULL 
35  * as the initial value of the crc in p_crc.
36  *
37  * @param[in] p_data The input data block for computation.
38  * @param[in] size   The size of the input data block in bytes.
39  * @param[in] p_crc  The previous calculated CRC-16 value or NULL if first call.  
40  *
41  * @return The updated CRC-16 value, based on the input supplied.
42  */
43 uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49 #endif // CRC16_H__
50  
51 /** @} */