diff options
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/asynch/spi.rs')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/asynch/spi.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs index 62b2c92a0..9890f218d 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs | |||
| @@ -122,6 +122,11 @@ impl<'a, M: RawMutex, BUS: SetConfig, CS> SpiDeviceWithConfig<'a, M, BUS, CS> { | |||
| 122 | pub fn new(bus: &'a Mutex<M, BUS>, cs: CS, config: BUS::Config) -> Self { | 122 | pub fn new(bus: &'a Mutex<M, BUS>, cs: CS, config: BUS::Config) -> Self { |
| 123 | Self { bus, cs, config } | 123 | Self { bus, cs, config } |
| 124 | } | 124 | } |
| 125 | |||
| 126 | /// Change the device's config at runtime | ||
| 127 | pub fn set_config(&mut self, config: BUS::Config) { | ||
| 128 | self.config = config; | ||
| 129 | } | ||
| 125 | } | 130 | } |
| 126 | 131 | ||
| 127 | impl<'a, M, BUS, CS> spi::ErrorType for SpiDeviceWithConfig<'a, M, BUS, CS> | 132 | impl<'a, M, BUS, CS> spi::ErrorType for SpiDeviceWithConfig<'a, M, BUS, CS> |
