diff options
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/asynch/i2c.rs')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/asynch/i2c.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs index 6de685ee1..48246270e 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs | |||
| @@ -41,6 +41,12 @@ impl<'a, M: RawMutex, BUS> I2cDevice<'a, M, BUS> { | |||
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | impl<'a, M: RawMutex, BUS> Clone for I2cDevice<'a, M, BUS> { | ||
| 45 | fn clone(&self) -> Self { | ||
| 46 | Self { bus: self.bus } | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 44 | impl<'a, M: RawMutex, BUS> i2c::ErrorType for I2cDevice<'a, M, BUS> | 50 | impl<'a, M: RawMutex, BUS> i2c::ErrorType for I2cDevice<'a, M, BUS> |
| 45 | where | 51 | where |
| 46 | BUS: i2c::ErrorType, | 52 | BUS: i2c::ErrorType, |
| @@ -113,6 +119,18 @@ impl<'a, M: RawMutex, BUS: SetConfig> I2cDeviceWithConfig<'a, M, BUS> { | |||
| 113 | } | 119 | } |
| 114 | } | 120 | } |
| 115 | 121 | ||
| 122 | impl<'a, M: RawMutex, BUS: SetConfig> Clone for I2cDeviceWithConfig<'a, M, BUS> | ||
| 123 | where | ||
| 124 | BUS::Config: Clone, | ||
| 125 | { | ||
| 126 | fn clone(&self) -> Self { | ||
| 127 | Self { | ||
| 128 | bus: self.bus, | ||
| 129 | config: self.config.clone(), | ||
| 130 | } | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 116 | impl<'a, M, BUS> i2c::ErrorType for I2cDeviceWithConfig<'a, M, BUS> | 134 | impl<'a, M, BUS> i2c::ErrorType for I2cDeviceWithConfig<'a, M, BUS> |
| 117 | where | 135 | where |
| 118 | BUS: i2c::ErrorType, | 136 | BUS: i2c::ErrorType, |
