lcx_crc.h | Developers

lcx_crc.h

Back to the files list

CRC (Cyclic Redundancy Check). More...

Macros

#define CX_CRC16_INIT   0xFFFF
 CRC16 initial value. More...

Functions

uint16_t cx_crc16 (const void *buffer, size_t len)
 Computes a 16-bit checksum value. More...
uint16_t cx_crc16_update (uint16_t crc, const void *buffer, size_t len)
 Accumulates more data to CRC. More...

Detailed Description

CRC (Cyclic Redundancy Check).

CRC-16 is a variant of CRC, an error-detecting code, with a 16-bit long check value.

Macro Definition Documentation

CX_CRC16_INIT

#define CX_CRC16_INIT   0xFFFF

CRC16 initial value.

Function Documentation

cx_crc16()

uint16_t cx_crc16 ( const void *  buffer,
size_t  len 
)

Computes a 16-bit checksum value.

The 16-bit value is computed according to the CRC16 CCITT definition.

Parameters
[in]bufferThe buffer to compute the CRC over.
[in]lenBytes length of the buffer.
Returns
Current CRC value.

cx_crc16_update()

uint16_t cx_crc16_update ( uint16_t  crc,
const void *  buffer,
size_t  len 
)

Accumulates more data to CRC.

Parameters
[in]crcCRC value to be updated.
[in]bufferThe buffer to compute the CRC over.
[in]lenBytes length of the buffer.
Returns
Updated CRC value.

Back to the files list


Did you find this page helpful?


How would you improve this page for developers?



Getting Started
Theme Features
Customization

Nano Apps