## Cyclic Redundancy Check Macro Definition Documentation

### SYS_CRC_CONFIG

#define SYS_CRC_CONFIG Sys_Set_CRC_Config(CRC, (config))

Macro wrapper for Sys_Set_CRC_Config() Configure the CRC generator type, endianness of the input data, and standard vs non-standard CRC behavior.

Location: crc.h:164

Parameters

Direction | Name | Description
--- | --- | ---
in | config | CRC generator configuration; use CRC_[CCITT | 32], CRC_[BIG | LITTLE]_ENDIAN, CRC_BIT_ORDER_[STANDARD | NON_STANDARD], CRC_FINAL_REVERSE_[STANDARD | NON_STANDARD], and CRC_FINAL_XOR_[STANDARD | NON_STANDARD]

Assumptions

Note that D_CRC supports only CRC_CCITT mode, hence no configuration is applied for this instance.

Example Code for SYS_CRC_CONFIG
// Configure the default CRC block to CRC-32 (IEEE 802.3) algorithm, // using little endian and non-standard (opposite) bit order SYS_CRC_CONFIG(CRC_32 | CRC_LITTLE_ENDIAN | CRC_BIT_ORDER_NON_STANDARD);

### SYS_CRC_32INITVALUE

#define SYS_CRC_32INITVALUE Sys_CRC_32InitValue(CRC)

Macro wrapper for Sys_CRC_32InitValue() Initialize CRC for CRC-32.

Location: crc.h:173

Assumptions

Note that D_CRC supports only CRC_CCITT mode, hence no configuration is applied for this instance.

Example Code for SYS_CRC_32INITVALUE
//Initialize the default CRC block for CRC-32 SYS_CRC_32INITVALUE();

### SYS_CRC_CCITTINITVALUE

#define SYS_CRC_CCITTINITVALUE Sys_CRC_CCITTInitValue(CRC)

Macro wrapperr for Sys_CRC_CCITTInitValue() Initialize CRC for CRC-CCITT.

Location: crc.h:181

Assumptions

CRC is configured to work in CRC-CCITT mode.

Example Code for SYS_CRC_CCITTINITVALUE
//Initialize the default CRC block for CRC-CCITT SYS_CRC_CCITTINITVALUE();

### SYS_CRC_GETCURRENTVALUE

#define SYS_CRC_GETCURRENTVALUE Sys_CRC_GetCurrentValue(CRC)

Macro wrapper for Sys_CRC_GetCurrentValue() Initialize CRC for CRC-CCITT.

Location: crc.h:188

Example Code for SYS_CRC_GETCURRENTVALUE
// Retrieve current value from the default CRC block SYS_CRC_GETCURRENTVALUE();

### SYS_CRC_GETFINALVALUE

#define SYS_CRC_GETFINALVALUE Sys_CRC_GetFinalValue(CRC)

Macro wrapper for Sys_CRC_GetFinalValue() Initialize final CRC value.

Location: crc.h:200

Return

CRC final value.

Assumptions

D_I2C only supports CRC-CCITT mode. Use Sys_CRC_GetCurrentValue instead. Returns initial value of CRC if D_CRC is passed or any other unknown instance.

Example Code for SYS_CRC_GETFINALVALUE
// Retrieve final value from the default CRC block SYS_CRC_GETFINALVALUE();

### SYS_CRC_ADD

#define SYS_CRC_ADD Sys_CRC_Add(CRC, (data), (size))

Macro wrapper for Sys_CRC_Add() Add data to the current CRC calculation, based on size.

Location: crc.h:209

Parameters

Direction | Name | Description
--- | --- | ---
in | data | Data to add
in | size | Size of data to add, 1, 8, 16, 24, 32 are valid.

Example Code for SYS_CRC_ADD
// Add 8 bits of data to the default CRC block SYS_CRC_ADD(0xF1, 8);