Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers crc16.h Source File

crc16.h

Go to the documentation of this file.
00001 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  */
00012  
00013 /** @file
00014  *
00015  * @defgroup crc_compute CRC compute
00016  * @{
00017  * @ingroup hci_transport
00018  *
00019  * @brief    This module implements the CRC-16 calculation in the blocks.
00020  */
00021  
00022 #ifndef CRC16_H__
00023 #define CRC16_H__
00024 
00025 #include <stdint.h>
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 /**@brief Function for calculating CRC-16 in blocks.
00032  *
00033  * Feed each consecutive data block into this function, along with the current value of p_crc as 
00034  * returned by the previous call of this function. The first call of this function should pass NULL 
00035  * as the initial value of the crc in p_crc.
00036  *
00037  * @param[in] p_data The input data block for computation.
00038  * @param[in] size   The size of the input data block in bytes.
00039  * @param[in] p_crc  The previous calculated CRC-16 value or NULL if first call.  
00040  *
00041  * @return The updated CRC-16 value, based on the input supplied.
00042  */
00043 uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc);
00044 
00045 #ifdef __cplusplus
00046 }
00047 #endif
00048 
00049 
00050 #endif // CRC16_H__
00051  
00052 /** @} */