meh

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Fri Sep 12 16:41:52 2014 +0100
Revision:
89:552587b429a1
Release 89 of the mbed library

Main changes:

- low power optimizations for Nordic targets
- code structure changes for Freescale K64F targets
- bug fixes in various backends

Who changed what in which revision?

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