Skip to content

Commit d870969

Browse files
committed
Split I2C ErrorKind::NoAcknowledge into NoAcknowledgeAddress and NoAcknowledgeData
1 parent 1f4fea9 commit d870969

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/i2c.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ pub enum ErrorKind {
123123
Bus,
124124
/// The arbitration was lost, e.g. electrical problems with the clock signal
125125
ArbitrationLoss,
126-
/// A bus operation was not acknowledged, e.g. due to the addressed device not being available on
127-
/// the bus or the device not being ready to process requests at the moment
128-
NoAcknowledge,
126+
/// The device did not acknowledge its address. The device may be missing.
127+
NoAcknowledgeAddress,
128+
/// The device did not acknowled the data. It may not be ready to process requests at the moment.
129+
NoAcknowledgeData,
129130
/// The peripheral receive buffer was overrun
130131
Overrun,
131132
/// A different error occurred. The original error may contain more information.
@@ -143,7 +144,8 @@ impl core::fmt::Display for ErrorKind {
143144
match self {
144145
Self::Bus => write!(f, "Bus error occurred"),
145146
Self::ArbitrationLoss => write!(f, "The arbitration was lost"),
146-
Self::NoAcknowledge => write!(f, "A bus operation was not acknowledged"),
147+
Self::NoAcknowledgeAddress => write!(f, "The device did not acknowledge its address"),
148+
Self::NoAcknowledgeData => write!(f, "The device did not acknowledge the data"),
147149
Self::Overrun => write!(f, "The peripheral receive buffer was overrun"),
148150
Self::Other => write!(
149151
f,

0 commit comments

Comments
 (0)