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, 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.
◆ 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
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.
◆ 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.
◆ 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.
◆ 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.
◆ enable
bool GPCRC_Init_TypeDef::enable |
Enable/disable GPCRC when initialization is completed.