HAL update
All checks were successful
Rust/va108xx-hal/pipeline/head This commit looks good
Rust/va108xx-hal/pipeline/pr-main This commit looks good

- SPI: Clear TX and RX FIFO for transfers
- Added `port_mux` function to manually select function for pins
This commit is contained in:
2021-12-12 14:21:49 +01:00
parent 3fc8ce519a
commit fb158caf6e
4 changed files with 62 additions and 24 deletions

View File

@ -504,6 +504,16 @@ macro_rules! spi {
});
}
#[inline]
pub fn clear_tx_fifo(&self) {
self.spi.fifo_clr.write(|w| w.txfifo().set_bit());
}
#[inline]
pub fn clear_rx_fifo(&self) {
self.spi.fifo_clr.write(|w| w.rxfifo().set_bit());
}
#[inline]
pub fn perid(&self) -> u32 {
self.spi.perid.read().bits()
@ -640,6 +650,9 @@ macro_rules! spi {
// FIFO has a depth of 16.
const FILL_DEPTH: usize = 12;
self.clear_tx_fifo();
self.clear_rx_fifo();
if self.blockmode {
self.spi.ctrl1.modify(|_, w| {
w.mtxpause().set_bit()