Skip to content

Commit 6e9bce8

Browse files
Add spi flush call to check for end of transfer
1 parent a26a373 commit 6e9bce8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/spi.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@ pub trait FullDuplex<Word> {
3131
/// # Notes
3232
///
3333
/// - It's the task of the user of this interface to manage the slave select lines
34+
///
35+
/// - The slave select line shouldn't be released before the `flush` call succeeds
3436
#[cfg(feature = "unproven")]
3537
pub trait Send<Word> {
3638
/// An enumeration of SPI errors
3739
type Error;
3840

3941
/// Sends a word to the slave
4042
fn send(&mut self, word: Word) -> nb::Result<(), Self::Error>;
43+
44+
/// Ensures that none of the previously written words are still buffered
45+
fn flush(&mut self) -> nb::Result<(), Self::Error>;
4146
}
4247

4348
/// Write (master mode)

0 commit comments

Comments
 (0)