CRC initialization structure.

Public Attributes#

uint32_t

CRC polynomial value.

uint32_t

CRC initialization value.

bool

Reverse byte order.

bool

Reverse bits within each input byte.

bool

Enable/disable byte mode.

bool

Enable automatic initialization by re-seeding the CRC result based on the init value after reading one of the CRC data registers.

bool

Enable/disable GPCRC when initialization is completed.

Public Attribute 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, 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 will give 0x8005 as the value to write into crcPoly.


Definition at line 110 of file platform/emlib/inc/em_gpcrc.h

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.


Definition at line 118 of file platform/emlib/inc/em_gpcrc.h

reverseByteOrder#

bool GPCRC_Init_TypeDef::reverseByteOrder

Reverse byte order.

This has an effect when sending a 32-bit word or 16-bit half word input to the CRC calculation. When set to true, the input bytes are reversed before entering the CRC calculation. When set to false, the input bytes stay in the same order.


Definition at line 126 of file platform/emlib/inc/em_gpcrc.h

reverseBits#

bool GPCRC_Init_TypeDef::reverseBits

Reverse bits within each input byte.

This setting enables or disables byte level bit reversal. When byte-level bit reversal is enabled, then each byte of input data will be reversed before entering CRC calculation.


Definition at line 133 of file platform/emlib/inc/em_gpcrc.h

enableByteMode#

bool GPCRC_Init_TypeDef::enableByteMode

Enable/disable byte mode.

When byte mode is enabled, then all input is treated as single byte input even though the input is a 32-bit word or a 16-bit half word. Only the least significant byte of the data-word will be used for CRC calculation for all writes.


Definition at line 141 of file platform/emlib/inc/em_gpcrc.h

autoInit#

bool GPCRC_Init_TypeDef::autoInit

Enable automatic initialization by re-seeding the CRC result based on the init value after reading one of the CRC data registers.


Definition at line 147 of file platform/emlib/inc/em_gpcrc.h

enable#

bool GPCRC_Init_TypeDef::enable

Enable/disable GPCRC when initialization is completed.


Definition at line 150 of file platform/emlib/inc/em_gpcrc.h