GPCRC_Init_TypeDef Struct Reference

CRC initialization structure.

#include <em_gpcrc.h>

Data Fields

uint32_t crcPoly
CRC polynomial value.
uint32_t initValue
CRC initialization value.
bool reverseByteOrder
Reverse byte order.
bool reverseBits
Reverse bits within each input byte.
bool enableByteMode
Enable/disable byte mode.
bool autoInit
Enable automatic initialization by re-seeding the CRC result based on the init value after reading one of the CRC data registers.
bool enable
Enable/disable GPCRC when initialization is completed.

CRC initialization structure.

Field Documentation

crcPoly

uint32_t GPCRC_Init_TypeDef::crcPoly

CRC polynomial value.

GPCRC supports either a fixed 32-bit polynomial or a user configurable 16 bit polynomial. The fixed 32-bit polynomial is the one used in IEEE 802.3, which has the value 0x04C11DB7. To use the 32-bit fixed polynomial, just assign 0x04C11DB7 to the crcPoly field. To use a 16-bit polynomial, assign a value to crcPoly where the upper 16 bits are zero.

The polynomial should be written in normal bit order. For instance, to use the CRC-16 polynomial X^16 + X^15 + X^2 + 1, first convert it to hex representation and remove the highest order term of the polynomial. This would give us 0x8005 as the value to write into crcPoly.

initValue

uint32_t GPCRC_Init_TypeDef::initValue

CRC initialization value.

This value is assigned to the GPCRC_INIT register. The initValue is loaded into the data register when calling the GPCRC_Start function or when one of the data registers are read while autoInit is enabled.

reverseByteOrder