Struct stm32h7xx_hal::crc::Crc
source · pub struct Crc { /* private fields */ }
crc
only.Expand description
The hardware CRC unit.
Implementations§
source§impl Crc
impl Crc
sourcepub fn set_config(&mut self, config: &Config)
pub fn set_config(&mut self, config: &Config)
Set the unit’s configuration, discarding previous state.
sourcepub fn update(&mut self, data: &[u8])
pub fn update(&mut self, data: &[u8])
Write data to the CRC unit. Note that CRC calculation works faster if more data is given at once.
sourcepub fn update_and_read(&mut self, data: &[u8]) -> u32
pub fn update_and_read(&mut self, data: &[u8]) -> u32
Write data to the CRC unit, return CRC so far. This function should only be used if you need its result, as retrieving the CRC takes time.
sourcepub fn finish(&mut self) -> u32
pub fn finish(&mut self) -> u32
Read the CRC and reset DR to initial value in preparation for a new CRC. This does not reset the configuration options.
sourcepub fn read_state(&self) -> u32
pub fn read_state(&self) -> u32
Read the state of the CRC calculation. When used as the initial value of an otherwise identical CRC config, this allows resuming calculation from the current state.
This is equivalent to read_crc()
in the case of an
algorithm that does not apply an output XOR or reverse the output bits.
sourcepub fn set_idr(&mut self, value: u32)
pub fn set_idr(&mut self, value: u32)
Write the independent data register. The IDR can be used as temporary storage. It is not cleared on CRC hash reset.
The IDR is not involved with CRC calculation.