diff options
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/mod.rs')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/mod.rs b/embassy-embedded-hal/src/shared_bus/mod.rs index 79a90bd52..b0159ac09 100644 --- a/embassy-embedded-hal/src/shared_bus/mod.rs +++ b/embassy-embedded-hal/src/shared_bus/mod.rs | |||
| @@ -14,6 +14,8 @@ pub mod blocking; | |||
| 14 | pub enum I2cDeviceError<BUS> { | 14 | pub enum I2cDeviceError<BUS> { |
| 15 | /// An operation on the inner I2C bus failed. | 15 | /// An operation on the inner I2C bus failed. |
| 16 | I2c(BUS), | 16 | I2c(BUS), |
| 17 | /// Configuration of the inner I2C bus failed. | ||
| 18 | Config, | ||
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | impl<BUS> i2c::Error for I2cDeviceError<BUS> | 21 | impl<BUS> i2c::Error for I2cDeviceError<BUS> |
| @@ -23,6 +25,7 @@ where | |||
| 23 | fn kind(&self) -> i2c::ErrorKind { | 25 | fn kind(&self) -> i2c::ErrorKind { |
| 24 | match self { | 26 | match self { |
| 25 | Self::I2c(e) => e.kind(), | 27 | Self::I2c(e) => e.kind(), |
| 28 | Self::Config => i2c::ErrorKind::Other, | ||
| 26 | } | 29 | } |
| 27 | } | 30 | } |
| 28 | } | 31 | } |
| @@ -38,6 +41,8 @@ pub enum SpiDeviceError<BUS, CS> { | |||
| 38 | Cs(CS), | 41 | Cs(CS), |
| 39 | /// DelayUs operations are not supported when the `time` Cargo feature is not enabled. | 42 | /// DelayUs operations are not supported when the `time` Cargo feature is not enabled. |
| 40 | DelayUsNotSupported, | 43 | DelayUsNotSupported, |
| 44 | /// The SPI bus could not be configured. | ||
| 45 | Config, | ||
| 41 | } | 46 | } |
| 42 | 47 | ||
| 43 | impl<BUS, CS> spi::Error for SpiDeviceError<BUS, CS> | 48 | impl<BUS, CS> spi::Error for SpiDeviceError<BUS, CS> |
| @@ -50,6 +55,7 @@ where | |||
| 50 | Self::Spi(e) => e.kind(), | 55 | Self::Spi(e) => e.kind(), |
| 51 | Self::Cs(_) => spi::ErrorKind::Other, | 56 | Self::Cs(_) => spi::ErrorKind::Other, |
| 52 | Self::DelayUsNotSupported => spi::ErrorKind::Other, | 57 | Self::DelayUsNotSupported => spi::ErrorKind::Other, |
| 58 | Self::Config => spi::ErrorKind::Other, | ||
| 53 | } | 59 | } |
| 54 | } | 60 | } |
| 55 | } | 61 | } |
