diff options
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/blocking/i2c.rs')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/blocking/i2c.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs index 1b08cb28e..627767c8a 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs | |||
| @@ -132,6 +132,11 @@ impl<'a, M: RawMutex, BUS: SetConfig> I2cDeviceWithConfig<'a, M, BUS> { | |||
| 132 | pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, config: BUS::Config) -> Self { | 132 | pub fn new(bus: &'a Mutex<M, RefCell<BUS>>, config: BUS::Config) -> Self { |
| 133 | Self { bus, config } | 133 | Self { bus, config } |
| 134 | } | 134 | } |
| 135 | |||
| 136 | /// Change the device's config at runtime | ||
| 137 | pub fn set_config(&mut self, config: BUS::Config) { | ||
| 138 | self.config = config; | ||
| 139 | } | ||
| 135 | } | 140 | } |
| 136 | 141 | ||
| 137 | impl<'a, M, BUS> ErrorType for I2cDeviceWithConfig<'a, M, BUS> | 142 | impl<'a, M, BUS> ErrorType for I2cDeviceWithConfig<'a, M, BUS> |
