pub struct Crc<'d, T: Instance> { /* private fields */ }Expand description
CRC-32 driver.
Implementations§
Source§impl<'d, T: Instance> Crc<'d, T>
impl<'d, T: Instance> Crc<'d, T>
Sourcepub fn new(inner: Peri<'d, T>) -> Self
pub fn new(inner: Peri<'d, T>) -> Self
Enable the peripheral clock and start a new calculation at 0xFFFF_FFFF.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the CRC accumulator to 0xFFFF_FFFF without changing the independent data register.
Sourcepub fn feed_word(&mut self, word: u32) -> u32
pub fn feed_word(&mut self, word: u32) -> u32
Feed a 32-bit word, most-significant bit first, and return the new CRC.
Sourcepub fn feed_words(&mut self, words: &[u32]) -> u32
pub fn feed_words(&mut self, words: &[u32]) -> u32
Feed the words in slice order without resetting the accumulator and return the new CRC.
Sourcepub fn set_independent_data(&mut self, value: u8)
pub fn set_independent_data(&mut self, value: u8)
Store a byte in the independent data register.
This byte is not included in the CRC calculation and survives Self::reset.
Sourcepub fn independent_data(&self) -> u8
pub fn independent_data(&self) -> u8
Read the independent data register; it does not affect the CRC calculation.