stm32: update stm32-metapac.

This commit is contained in:
Dario Nieuwenhuis
2023-06-19 03:07:26 +02:00
parent adaed307b4
commit 558918651e
68 changed files with 2893 additions and 3568 deletions

View File

@ -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()
}
}