The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NRF51_DK/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/nrf-sdk/app_common/crc16.h@91:031413cf7a89, 2014-10-29 (annotated)
- Committer:
- Kojto
- Date:
- Wed Oct 29 11:02:04 2014 +0000
- Revision:
- 91:031413cf7a89
Release 91 of the mbed library
Changes:
- RBLAB_NANO - new target addition
- NRF51_DK - new target addition
- NRF51_DONGLE - new target addition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 91:031413cf7a89 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
Kojto | 91:031413cf7a89 | 2 | * |
Kojto | 91:031413cf7a89 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
Kojto | 91:031413cf7a89 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
Kojto | 91:031413cf7a89 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
Kojto | 91:031413cf7a89 | 6 | * |
Kojto | 91:031413cf7a89 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
Kojto | 91:031413cf7a89 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
Kojto | 91:031413cf7a89 | 9 | * the file. |
Kojto | 91:031413cf7a89 | 10 | * |
Kojto | 91:031413cf7a89 | 11 | */ |
Kojto | 91:031413cf7a89 | 12 | |
Kojto | 91:031413cf7a89 | 13 | /** @file |
Kojto | 91:031413cf7a89 | 14 | * |
Kojto | 91:031413cf7a89 | 15 | * @defgroup crc_compute CRC compute |
Kojto | 91:031413cf7a89 | 16 | * @{ |
Kojto | 91:031413cf7a89 | 17 | * @ingroup hci_transport |
Kojto | 91:031413cf7a89 | 18 | * |
Kojto | 91:031413cf7a89 | 19 | * @brief This module implements the CRC-16 calculation in the blocks. |
Kojto | 91:031413cf7a89 | 20 | */ |
Kojto | 91:031413cf7a89 | 21 | |
Kojto | 91:031413cf7a89 | 22 | #ifndef CRC16_H__ |
Kojto | 91:031413cf7a89 | 23 | #define CRC16_H__ |
Kojto | 91:031413cf7a89 | 24 | |
Kojto | 91:031413cf7a89 | 25 | #include <stdint.h> |
Kojto | 91:031413cf7a89 | 26 | |
Kojto | 91:031413cf7a89 | 27 | #ifdef __cplusplus |
Kojto | 91:031413cf7a89 | 28 | extern "C" { |
Kojto | 91:031413cf7a89 | 29 | #endif |
Kojto | 91:031413cf7a89 | 30 | |
Kojto | 91:031413cf7a89 | 31 | /**@brief Function for calculating CRC-16 in blocks. |
Kojto | 91:031413cf7a89 | 32 | * |
Kojto | 91:031413cf7a89 | 33 | * Feed each consecutive data block into this function, along with the current value of p_crc as |
Kojto | 91:031413cf7a89 | 34 | * returned by the previous call of this function. The first call of this function should pass NULL |
Kojto | 91:031413cf7a89 | 35 | * as the initial value of the crc in p_crc. |
Kojto | 91:031413cf7a89 | 36 | * |
Kojto | 91:031413cf7a89 | 37 | * @param[in] p_data The input data block for computation. |
Kojto | 91:031413cf7a89 | 38 | * @param[in] size The size of the input data block in bytes. |
Kojto | 91:031413cf7a89 | 39 | * @param[in] p_crc The previous calculated CRC-16 value or NULL if first call. |
Kojto | 91:031413cf7a89 | 40 | * |
Kojto | 91:031413cf7a89 | 41 | * @return The updated CRC-16 value, based on the input supplied. |
Kojto | 91:031413cf7a89 | 42 | */ |
Kojto | 91:031413cf7a89 | 43 | uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc); |
Kojto | 91:031413cf7a89 | 44 | |
Kojto | 91:031413cf7a89 | 45 | #ifdef __cplusplus |
Kojto | 91:031413cf7a89 | 46 | } |
Kojto | 91:031413cf7a89 | 47 | #endif |
Kojto | 91:031413cf7a89 | 48 | |
Kojto | 91:031413cf7a89 | 49 | |
Kojto | 91:031413cf7a89 | 50 | #endif // CRC16_H__ |
Kojto | 91:031413cf7a89 | 51 | |
Kojto | 91:031413cf7a89 | 52 | /** @} */ |