Struct stm32_hal2::crc::Crc
source · [−]pub struct Crc { /* private fields */ }
Expand description
The hardware CRC unit.
Implementations
sourceimpl 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.
Auto Trait Implementations
impl RefUnwindSafe for Crc
impl Send for Crc
impl !Sync for Crc
impl Unpin for Crc
impl UnwindSafe for Crc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more