Merge #1477
1477: embassy-embedded-hal: Add i2c transaction to I2cDevice r=Dirbaio a=CBJamo Not sure why this was a todo before, but this seems to be working fine in my limited testing. Co-authored-by: Caleb Jamison <caleb@hellbender.com>
This commit is contained in:
		| @@ -84,9 +84,11 @@ where | |||||||
|         address: u8, |         address: u8, | ||||||
|         operations: &mut [embedded_hal_async::i2c::Operation<'_>], |         operations: &mut [embedded_hal_async::i2c::Operation<'_>], | ||||||
|     ) -> Result<(), I2cDeviceError<BUS::Error>> { |     ) -> Result<(), I2cDeviceError<BUS::Error>> { | ||||||
|         let _ = address; |         let mut bus = self.bus.lock().await; | ||||||
|         let _ = operations; |         bus.transaction(address, operations) | ||||||
|         todo!() |             .await | ||||||
|  |             .map_err(I2cDeviceError::I2c)?; | ||||||
|  |         Ok(()) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -150,8 +152,11 @@ where | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     async fn transaction(&mut self, address: u8, operations: &mut [i2c::Operation<'_>]) -> Result<(), Self::Error> { |     async fn transaction(&mut self, address: u8, operations: &mut [i2c::Operation<'_>]) -> Result<(), Self::Error> { | ||||||
|         let _ = address; |         let mut bus = self.bus.lock().await; | ||||||
|         let _ = operations; |         bus.set_config(&self.config); | ||||||
|         todo!() |         bus.transaction(address, operations) | ||||||
|  |             .await | ||||||
|  |             .map_err(I2cDeviceError::I2c)?; | ||||||
|  |         Ok(()) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user