aboutsummaryrefslogtreecommitdiff
path: root/embassy-embedded-hal/src/shared_bus/asynch
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/asynch')
-rw-r--r--embassy-embedded-hal/src/shared_bus/asynch/i2c.rs18
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
44impl<'a, M: RawMutex, BUS> Clone for I2cDevice<'a, M, BUS> {
45 fn clone(&self) -> Self {
46 Self { bus: self.bus }
47 }
48}
49
44impl<'a, M: RawMutex, BUS> i2c::ErrorType for I2cDevice<'a, M, BUS> 50impl<'a, M: RawMutex, BUS> i2c::ErrorType for I2cDevice<'a, M, BUS>
45where 51where
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
122impl<'a, M: RawMutex, BUS: SetConfig> Clone for I2cDeviceWithConfig<'a, M, BUS>
123where
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
116impl<'a, M, BUS> i2c::ErrorType for I2cDeviceWithConfig<'a, M, BUS> 134impl<'a, M, BUS> i2c::ErrorType for I2cDeviceWithConfig<'a, M, BUS>
117where 135where
118 BUS: i2c::ErrorType, 136 BUS: i2c::ErrorType,