GD32A50x User Manual
228
10.3.
Function overview
CRC calculation unit is used to calculate the 32-bit raw data, and CRC_DATA register
will receive the raw data and store the calculation result.
If the CRC_DATA register has not been cleared by setting the CRC_CTL register, the
new input raw data will be calculated based on the result of previous value of CRC_DATA.
CRC calculation will spend 4/2/1 AHB clock cycles for 32/16/8(7) bit data size. During
this period, AHB will not be hanged because of the existence of the 32bit input buffer.
This module supplies an 8-bit free register CRC_FDATA.
CRC_FDATA is unrelated to the CRC calculation. Independent read and write operations
can be performed at any time.
Reversible function can reverse the input data and output data.
For input data, 3 reverse types can be selected.
Original data is 0x1A2B3C4D:
1) byte reverse:
32-bit data is divided into 4 groups and reverse implement in group inside. Reversed
data: 0x58D43CB2
2) half-word reverse:
32-bit data is divided into 2 groups and reverse implement in group inside. Reversed
data: 0xD458B23C
3) word reverse:
32-bit data is divided into 1 groups and reverse implement in group inside. Reversed
data: 0xB23CD458
For output data, reverse type is word reverse.
For example: when REV_O=1, calculation result 0x22CC4488 will be converted to
0x11223344.
User configurable initial calculation data is available.
When RST bit is set or write operation to CRC_IDATA register, the CRC_DATA register
will be automatically initialized to the value in CRC_IDATA.
User configurable polynomial.
Depends on PS[1:0] bits, the valid polynomial and output bit width can be selected by
user. If the polynomial is less than 32 bit, the high bits of the input data and output data
is unavailable. It is strongly recommend resetting the CRC calculation unit after change
the PS[1:0] bits or polynomial.