Skip to content

Commit 6d6ef83

Browse files
committed
Add I2C clock low timeout error kind
1 parent 5209452 commit 6d6ef83

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

embedded-hal/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- Added `core::error::Error` implementations for every custom `impl Error`
1111
- Increased MSRV to 1.81 due to `core::error::Error`
1212

13+
## Added
14+
15+
- `i2c::ErrorKind::ClkLowTimeout` error kind.
16+
1317
## [v1.0.0] - 2023-12-28
1418

1519
Check out the [announcement blog post](https://blog.rust-embedded.org/embedded-hal-v1/) and the [migration guide](../docs/migrating-from-0.2-to-1.0.md) for help with migrating from v0.2 to v1.0.

embedded-hal/src/i2c.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ pub enum ErrorKind {
203203
NoAcknowledge(NoAcknowledgeSource),
204204
/// The peripheral receive buffer was overrun.
205205
Overrun,
206+
/// A clock low timeout occured.
207+
ClkLowTimeout,
206208
/// A different error occurred. The original error may contain more information.
207209
Other,
208210
}
@@ -242,6 +244,7 @@ impl core::fmt::Display for ErrorKind {
242244
Self::ArbitrationLoss => write!(f, "The arbitration was lost"),
243245
Self::NoAcknowledge(s) => s.fmt(f),
244246
Self::Overrun => write!(f, "The peripheral receive buffer was overrun"),
247+
Self::ClkLowTimeout => write!(f, "The peripheral had a clock low timeout"),
245248
Self::Other => write!(
246249
f,
247250
"A different error occurred. The original error may contain more information"

0 commit comments

Comments
 (0)