Skip to content

Commit 28df44c

Browse files
committed
spi: clarify flushing/blocking behavior.
Fixes #455.
1 parent 3a7c3ca commit 28df44c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

embedded-hal/src/spi.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@
142142
//! # Flushing
143143
//!
144144
//! To improve performance, [`SpiBus`] implementations are allowed to return before the operation is finished, i.e. when the bus is still not
145-
//! idle.
145+
//! idle. This allows pipelining SPI transfers with CPU work.
146+
//!
147+
//! When calling another method when a previous operation is still in progress, implementations can either wait for the previous operation
148+
//! to finish, or enqueue the new one, but they must not return a "busy" error. Users must be able to do multiple method calls in a row
149+
//! and have them executed "as if" they were done sequentially, without having to check for "busy" errors.
146150
//!
147151
//! When using a [`SpiBus`], call [`flush`](SpiBusFlush::flush) to wait for operations to actually finish. Examples of situations
148152
//! where this is needed are:

0 commit comments

Comments
 (0)