Skip to content

Commit 1198c8a

Browse files
Stop CIPO being stuck low.
It seems setting the internal chip-select bit is insufficient to stop CIPO being driven hard low. We now disable the SPI peripheral as well, which causes the pin to float.
1 parent cb205a4 commit 1198c8a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

neotron-bmc-pico/src/spi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ impl<const RXC: usize, const TXC: usize> SpiPeripheral<RXC, TXC> {
171171
// Tell the SPI engine it has a chip-select
172172
self.dev.cr1.modify(|_r, w| {
173173
w.ssi().slave_selected();
174+
w.spe().enabled();
174175
w
175176
});
176177
}
@@ -179,6 +180,7 @@ impl<const RXC: usize, const TXC: usize> SpiPeripheral<RXC, TXC> {
179180
pub fn stop(&mut self) {
180181
self.dev.cr1.modify(|_r, w| {
181182
w.ssi().slave_not_selected();
183+
w.spe().disabled();
182184
w
183185
});
184186
}

0 commit comments

Comments
 (0)