Defined Constants and Types for the STM32G4xx CRC Generator
More...
Defined Constants and Types for the STM32G4xx CRC Generator
- Version
- 1.0.0
LGPL License Terms libopencm3 License
- Author
- © 2010 Thomas Otto tommi.nosp@m.@via.nosp@m.dmin..nosp@m.org
-
© 2016 Cem Basoglu cem.b.nosp@m.asog.nosp@m.lu@we.nosp@m.b.de
◆ CRC_POL_DEFAULT
#define CRC_POL_DEFAULT 0x04C11DB7 |
Default polynomial.
Definition at line 90 of file crc_v2.h.
◆ crc_calculate()
uint32_t crc_calculate |
( |
uint32_t |
data | ) |
|
Writes a data word to the register, the write operation stalling until the computation is complete.
- Parameters
-
[in] | data | new word to add to the CRC calculator |
- Returns
- int32 Computed CRC result
Definition at line 36 of file crc_common_all.c.
References CRC_DR.
◆ crc_calculate_block()
uint32_t crc_calculate_block |
( |
uint32_t * |
datap, |
|
|
int |
size |
|
) |
| |
Add a block of data to the CRC calculator and return the final result.
Writes data words consecutively to the register, the write operation stalling until the computation of each word is complete, then returns the final result
- Parameters
-
[in] | datap | pointer to an array of 32 bit data words. |
[in] | size | length of data, in 32bit increments |
- Returns
- final CRC calculator value
Definition at line 43 of file crc_common_all.c.
References CRC_DR.
◆ crc_reset()
◆ crc_reverse_output_disable()
void crc_reverse_output_disable |
( |
void |
| ) |
|
Disable reverse output data.
Disables the reversal of the bit order of the output data.
Definition at line 49 of file crc_v2.c.
References CRC_CR.
◆ crc_reverse_output_enable()
void crc_reverse_output_enable |
( |
void |
| ) |
|
Enable reverse output data.
Enables the reversal of the bit order of the output data.
Definition at line 38 of file crc_v2.c.
References CRC_CR, and CRC_CR_REV_OUT.
◆ crc_set_initial()
void crc_set_initial |
( |
uint32_t |
initial | ) |
|
CRC Initial value.
Sets the crc initial value.
- Parameters
-
[in] | initial | Unsigned int32. CRC initial value. |
Definition at line 110 of file crc_v2.c.
References CRC_INIT.
◆ crc_set_polynomial()
void crc_set_polynomial |
( |
uint32_t |
polynomial | ) |
|
Polynomial coefficient.
Set the coefficients of the polynomial to be used for CRC calculation. If the polynomial size is less than 32-bits, the least significant bits have to be used to program the correct value.
- Note
- To obtain a reliable CRC calculation, any changes to the polynomial value or size can not be performed during a CRC calculation. As a result, if a CRC calculation is ongoing, the application must either reset the crc unit it or perform a CRC_DR read before changing the polynomial.
-
The default polynomial value is the CRC-32 (Ethernet) polynomial: 0x4C11DB7.
- Parameters
-
[in] | polynomial | Unsigned int32. Polynomial coefficient. |
Definition at line 98 of file crc_v2.c.
References CRC_POL.
◆ crc_set_polysize()
void crc_set_polysize |
( |
uint32_t |
polysize | ) |
|
Polynomial size.
Set the size of the polynomial.
- Parameters
-
Definition at line 75 of file crc_v2.c.
References CRC_CR.
◆ crc_set_reverse_input()
void crc_set_reverse_input |
( |
uint32_t |
reverse_in | ) |
|
Reverse input data.
Controls the reversal of the bit order of the input data
- Parameters
-
Definition at line 61 of file crc_v2.c.
References CRC_CR.