Merge pull request #4121 from sebgab/reset_spi_when_applying_config_stm32
Fix STM32H7 SpiDeviceWithConfig does not properly apply the config
This commit is contained in:
commit
9907f5683b
@ -284,6 +284,10 @@ impl<'d, M: PeriMode> Spi<'d, M> {
|
||||
|
||||
#[cfg(any(spi_v3, spi_v4, spi_v5))]
|
||||
{
|
||||
self.info.regs.cr1().modify(|w| {
|
||||
w.set_spe(false);
|
||||
});
|
||||
|
||||
self.info.regs.cfg2().modify(|w| {
|
||||
w.set_cpha(cpha);
|
||||
w.set_cpol(cpol);
|
||||
@ -292,6 +296,10 @@ impl<'d, M: PeriMode> Spi<'d, M> {
|
||||
self.info.regs.cfg1().modify(|w| {
|
||||
w.set_mbr(br);
|
||||
});
|
||||
|
||||
self.info.regs.cr1().modify(|w| {
|
||||
w.set_spe(true);
|
||||
});
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user