Struct stm32h7xx_hal::crc::Crc

source ·
pub struct Crc { /* private fields */ }
Available on crate feature crc only.
Expand description

The hardware CRC unit.

Implementations§

source§

impl Crc

source

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

Set the unit’s configuration, discarding previous state.

source

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.

source

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.

source

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.

source

pub fn read_crc(&self) -> u32

Read the CRC without resetting the unit.

source

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.

source

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.

source

pub fn get_idr(&self) -> u32

Get the current value of the independent data register.

The IDR is not involved with CRC calculation.

source

pub fn inner(&self) -> &CRC

Returns a reference to the inner peripheral

source

pub fn inner_mut(&mut self) -> &mut CRC

Returns a mutable reference to the inner peripheral

Auto Trait Implementations§

§

impl Freeze for Crc

§

impl RefUnwindSafe for Crc

§

impl Send for Crc

§

impl !Sync for Crc

§

impl Unpin for Crc

§

impl UnwindSafe for Crc

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.