Skip to content

Commit ea5b5ce

Browse files
Merge #120
120: Document implicit assumption in non-blocking spi trait r=therealprof a=david-sawatzke It should only be able to read the data returned by the last write call. Otherwise the overflow handling isn't really possible when doing only write calls (at least on stm32f0). @therealprof and me came to this conclusion after chatting on irc that this is the intended usage of this api. Co-authored-by: David Sawatzke <[email protected]> Co-authored-by: David Sawatzke <[email protected]> Co-authored-by: david-sawatzke <[email protected]>
2 parents 6f17287 + 5bae50b commit ea5b5ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/spi.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ use nb;
88
///
99
/// - It's the task of the user of this interface to manage the slave select lines
1010
///
11-
/// - Due to how full duplex SPI works each `read` call must be preceded by a `send` call.
11+
/// - Due to how full duplex SPI works each `try_read` call must be preceded by a `try_send` call.
12+
///
13+
/// - `try_read` calls only return the data received with the last `try_send` call.
14+
/// Previously received data is discarded
15+
///
16+
/// - Data is only guaranteed to be clocked out when the `try_read` call succeeds.
17+
/// The slave select line shouldn't be released before that.
1218
///
1319
/// - Some SPIs can work with 8-bit *and* 16-bit words. You can overload this trait with different
1420
/// `Word` types to allow operation in both modes.

0 commit comments

Comments
 (0)