Solaris Software
Loading...
Searching...
No Matches
crc.h File Reference

CRC-16/CCITT checksum utility. More...

#include "spp/core/types.h"
Include dependency graph for crc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define K_SPP_CRC_POLY   (0x1021U)
 CRC-16/CCITT polynomial (0x1021).
#define K_SPP_CRC_INIT   (0xFFFFU)
 CRC-16 initial value.

Functions

spp_uint16_t SPP_UTIL_crc16 (const spp_uint8_t *p_data, spp_uint32_t length)
 Compute a CRC-16/CCITT checksum over a byte buffer.

Detailed Description

CRC-16/CCITT checksum utility.

Naming conventions used in this file:

Definition in file crc.h.

Macro Definition Documentation

◆ K_SPP_CRC_POLY

#define K_SPP_CRC_POLY   (0x1021U)

CRC-16/CCITT polynomial (0x1021).

Definition at line 20 of file crc.h.

Referenced by SPP_UTIL_crc16().

◆ K_SPP_CRC_INIT

#define K_SPP_CRC_INIT   (0xFFFFU)

CRC-16 initial value.

Definition at line 23 of file crc.h.

Referenced by SPP_UTIL_crc16().

Function Documentation

◆ SPP_UTIL_crc16()

spp_uint16_t SPP_UTIL_crc16 ( const spp_uint8_t * p_data,
spp_uint32_t length )

Compute a CRC-16/CCITT checksum over a byte buffer.

Parameters
[in]p_dataPointer to the data buffer.
[in]lengthNumber of bytes to process.
Returns
16-bit CRC value.

Definition at line 8 of file crc.c.

References K_SPP_CRC_INIT, K_SPP_CRC_POLY, and SPP_UTIL_crc16().

Referenced by packetCrc(), and SPP_UTIL_crc16().

Here is the call graph for this function:
Here is the caller graph for this function: