stm32: Implement set_config for Uart structs

This commit is contained in:
Scott Mabin
2023-09-16 22:32:14 +01:00
parent cd128c20fa
commit 88eb5cca71
4 changed files with 102 additions and 3 deletions

View File

@ -323,7 +323,7 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
}
/// Reconfigures it with the supplied config.
pub fn reconfigure(&mut self, config: Config) {
pub fn set_config(&mut self, config: Config) {
let cpha = config.raw_phase();
let cpol = config.raw_polarity();
@ -1062,6 +1062,6 @@ foreach_peripheral!(
impl<'d, T: Instance, Tx, Rx> SetConfig for Spi<'d, T, Tx, Rx> {
type Config = Config;
fn set_config(&mut self, config: &Self::Config) {
self.reconfigure(*config);
self.set_config(*config);
}
}