ST Expansion SW Team / RFAL

Dependents:   mbed-os-nfc05a1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rfal_crc.h Source File

rfal_crc.h

Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003   * @attention
00004   *
00005   * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
00006   *
00007   * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
00008   * You may not use this file except in compliance with the License.
00009   * You may obtain a copy of the License at:
00010   *
00011   *        http://www.st.com/myliberty
00012   *
00013   * Unless required by applicable law or agreed to in writing, software 
00014   * distributed under the License is distributed on an "AS IS" BASIS, 
00015   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
00016   * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
00017   * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
00018   * See the License for the specific language governing permissions and
00019   * limitations under the License.
00020   *
00021 ******************************************************************************/
00022 
00023 /*
00024  *      PROJECT:   ST25R391x firmware
00025  *      $Revision: $
00026  *      LANGUAGE:  ISO C99
00027  */
00028 
00029 /*! \file rfal_crc.h
00030  *
00031  *  \author Ulrich Herrmann
00032  *
00033  *  \brief CRC calculation module
00034  *
00035  */
00036 /*!
00037  * 
00038  */
00039 
00040 #ifndef RFAL_CRC_H_
00041 #define RFAL_CRC_H_
00042 
00043 /*
00044 ******************************************************************************
00045 * INCLUDES
00046 ******************************************************************************
00047 */
00048 #include "platform1.h"
00049 
00050 /*
00051 ******************************************************************************
00052 * GLOBAL FUNCTION PROTOTYPES
00053 ******************************************************************************
00054 */
00055 /*! 
00056  *****************************************************************************
00057  *  \brief  Calculate CRC according to CCITT standard.
00058  *
00059  *  This function takes \a length bytes from \a buf and calculates the CRC
00060  *  for this data. The result is returned.
00061  *  \note This implementation calculates the CRC with LSB first, i.e. all
00062  *  bytes are "read" from right to left.
00063  *
00064  *  \param[in] preloadValue : Initial value of CRC calculation.
00065  *  \param[in] buf : buffer to calculate the CRC for.
00066  *  \param[in] length : size of the buffer.
00067  *
00068  *  \return 16 bit long crc value.
00069  *
00070  *****************************************************************************
00071  */
00072 extern uint16_t rfalCrcCalculateCcitt(uint16_t preloadValue, const uint8_t* buf, uint16_t length);
00073 
00074 #endif /* RFAL_CRC_H_ */
00075