Struct stm32h7xx_hal::crc::Crc[][src]

pub struct Crc { /* fields omitted */ }

The hardware CRC unit.

Implementations

impl Crc[src]

pub fn set_config(&mut self, config: &Config)[src]

Set the unit’s configuration, discarding previous state.

pub fn update(&mut self, data: &[u8])[src]

Write data to the CRC unit. Note that CRC calculation works faster if more data is given at once.

#[must_use = "retrieving the CRC takes time, use update() if not needed"]pub fn update_and_read(&mut self, data: &[u8]) -> u32[src]

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.

pub fn finish(&mut self) -> u32[src]

Read the CRC and reset DR to initial value in preparation for a new CRC. This does not reset the configuration options.

pub fn read_crc(&self) -> u32[src]

Read the CRC without resetting the unit.

pub fn read_state(&self) -> u32[src]

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.

pub fn set_idr(&mut self, value: u32)[src]

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.

pub fn get_idr(&self) -> u32[src]

Get the current value of the independent data register.

The IDR is not involved with CRC calculation.

Auto Trait Implementations

impl Send for Crc

impl !Sync for Crc

impl Unpin for Crc

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.