stm32: update stm32-metapac.
This commit is contained in:
@ -27,26 +27,24 @@ impl<'d> Crc<'d> {
|
||||
|
||||
/// Resets the CRC unit to default value (0xFFFF_FFFF)
|
||||
pub fn reset(&mut self) {
|
||||
unsafe { PAC_CRC.cr().write(|w| w.set_reset(true)) };
|
||||
PAC_CRC.cr().write(|w| w.set_reset(true));
|
||||
}
|
||||
|
||||
/// Feeds a word to the peripheral and returns the current CRC value
|
||||
pub fn feed_word(&mut self, word: u32) -> u32 {
|
||||
// write a single byte to the device, and return the result
|
||||
unsafe {
|
||||
PAC_CRC.dr().write_value(word);
|
||||
}
|
||||
PAC_CRC.dr().write_value(word);
|
||||
self.read()
|
||||
}
|
||||
/// Feed a slice of words to the peripheral and return the result.
|
||||
pub fn feed_words(&mut self, words: &[u32]) -> u32 {
|
||||
for word in words {
|
||||
unsafe { PAC_CRC.dr().write_value(*word) }
|
||||
PAC_CRC.dr().write_value(*word);
|
||||
}
|
||||
|
||||
self.read()
|
||||
}
|
||||
pub fn read(&self) -> u32 {
|
||||
unsafe { PAC_CRC.dr().read() }
|
||||
PAC_CRC.dr().read()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user