ST Expansion SW Team / RFAL

Dependents:   mbed-os-nfc05a1

Embed: (wiki syntax)

« Back to documentation index

rfal_crc.h File Reference

rfal_crc.h File Reference

CRC calculation module. More...

Go to the source code of this file.

Functions

uint16_t rfalCrcCalculateCcitt (uint16_t preloadValue, const uint8_t *buf, uint16_t length)
 Calculate CRC according to CCITT standard.

Detailed Description

CRC calculation module.

Author:
Ulrich Herrmann

Definition in file rfal_crc.h.


Function Documentation

uint16_t rfalCrcCalculateCcitt ( uint16_t  preloadValue,
const uint8_t *  buf,
uint16_t  length 
)

Calculate CRC according to CCITT standard.

This function takes length bytes from buf and calculates the CRC for this data. The result is returned.

Note:
This implementation calculates the CRC with LSB first, i.e. all bytes are "read" from right to left.
Parameters:
[in]preloadValue: Initial value of CRC calculation.
[in]buf: buffer to calculate the CRC for.
[in]length: size of the buffer.
Returns:
16 bit long crc value.

Definition at line 56 of file rfal_crc.cpp.