From 18ee5970632612420f05042c4cd957e802ae72c2 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sun, 9 Jun 2024 21:04:32 -0400 Subject: [PATCH] Test continuous xfer-then-read behavior When we change the transmit / receive masks within a continuous transaction, we might demonstrate an LPSPI hardware defect. In the example shown here, the LPSPI SCK stalls when transmitting the final bit of the final byte, preventing the read from executing. Right now, I'm not sure if this is the LPSPI continuous transaction hardware defect, or if there's an issue in this new driver. I'll shoot for a deeper review later. --- examples/rtic_spi_blocking.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/rtic_spi_blocking.rs b/examples/rtic_spi_blocking.rs index 85fffb23..147659ca 100644 --- a/examples/rtic_spi_blocking.rs +++ b/examples/rtic_spi_blocking.rs @@ -163,6 +163,22 @@ mod app { delay(); } + + { + use eh1::spi::{ + Operation::{Read, TransferInPlace}, + SpiDevice, + }; + + let mut read = [0u8; 7]; + let mut xfer = [0u8; 16]; + for idx in 0..xfer.len() { + xfer[idx] = idx as u8; + } + + spi.transaction(&mut [TransferInPlace(&mut xfer), Read(&mut read)]) + .unwrap(); + } } } }