Skip to content

Commit 5f5570d

Browse files
authored
Merge pull request #557 from Dirbaio/i2c-no-flush
i2c: disallow returning before transfer is finished.
2 parents 13e151c + c9b953a commit 5f5570d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

embedded-hal/src/i2c.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
//! you've received from a HAL and "split" it into multiple shared ones, to instantiate
3939
//! several drivers on the same bus.
4040
//!
41+
//! # Flushing
42+
//!
43+
//! Implementations must flush the transfer, ensuring the bus has returned to an idle state before returning.
44+
//! No pipelining is allowed. Users must be able to shut down the I2C peripheral immediately after a transfer
45+
//! returns, without any risk of e.g. cutting short a stop condition.
46+
//!
47+
//! (Implementations must wait until the last ACK bit to report it as an error anyway. Therefore pipelining would only
48+
//! yield very small time savings, not worth the complexity)
49+
//!
4150
//! # For driver authors
4251
//!
4352
//! Drivers can select the adequate address length with `I2c<SevenBitAddress>` or `I2c<TenBitAddress>` depending

0 commit comments

Comments
 (0)