diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index 28026f83c..a93a5d987 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs @@ -11,6 +11,7 @@ use embassy_embedded_hal::SetConfig; use embassy_futures::select::{select, Either}; use embassy_hal_internal::drop::OnDrop; use embedded_hal_1::i2c::Operation; +use mode::Master; use super::*; use crate::mode::Mode as PeriMode; @@ -41,7 +42,7 @@ pub unsafe fn on_interrupt() { }); } -impl<'d, M: PeriMode> I2c<'d, M> { +impl<'d, M: PeriMode> I2c<'d, M, Master> { pub(crate) fn init(&mut self, freq: Hertz, _config: Config) { self.info.regs.cr1().modify(|reg| { reg.set_pe(false); @@ -354,7 +355,7 @@ impl<'d, M: PeriMode> I2c<'d, M> { } } -impl<'d> I2c<'d, Async> { +impl<'d> I2c<'d, Async, Master> { async fn write_frame(&mut self, address: u8, write: &[u8], frame: FrameOptions) -> Result<(), Error> { self.info.regs.cr2().modify(|w| { // Note: Do not enable the ITBUFEN bit in the I2C_CR2 register if DMA is used for @@ -800,7 +801,7 @@ impl Timings { } } -impl<'d, M: PeriMode> SetConfig for I2c<'d, M> { +impl<'d, M: PeriMode> SetConfig for I2c<'d, M, Master> { type Config = Hertz; type ConfigError = (); fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {