Skip to content

Commit

Permalink
Split I2C ErrorKind::NoAcknowledge into NoAcknowledgeAddress and NoAc…
Browse files Browse the repository at this point in the history
…knowledgeData
  • Loading branch information
eldruin committed Oct 4, 2021
1 parent da4e830 commit c3f07fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ pub enum ErrorKind {
Bus,
/// The arbitration was lost, e.g. electrical problems with the clock signal
ArbitrationLoss,
/// A bus operation was not acknowledged, e.g. due to the addressed device not being available on
/// the bus or the device not being ready to process requests at the moment
NoAcknowledge,
/// The device did not acknowledge its address. The device may be missing.
NoAcknowledgeAddress,
/// The device did not acknowled the data. It may not be ready to process requests at the moment.
NoAcknowledgeData,
/// The peripheral receive buffer was overrun
Overrun,
/// A different error occurred. The original error may contain more information.
Expand All @@ -143,7 +144,8 @@ impl core::fmt::Display for ErrorKind {
match self {
Self::Bus => write!(f, "Bus error occurred"),
Self::ArbitrationLoss => write!(f, "The arbitration was lost"),
Self::NoAcknowledge => write!(f, "A bus operation was not acknowledged"),
Self::NoAcknowledgeAddress => write!(f, "The device did not acknowledge its address"),
Self::NoAcknowledgeData => write!(f, "The device did not acknowledge the data"),
Self::Overrun => write!(f, "The peripheral receive buffer was overrun"),
Self::Other => write!(
f,
Expand Down

0 comments on commit c3f07fe

Please sign in to comment.