diff --git a/embassy-stm32/src/hrtim/mod.rs b/embassy-stm32/src/hrtim/mod.rs index ddf8cc2a..3a05719b 100644 --- a/embassy-stm32/src/hrtim/mod.rs +++ b/embassy-stm32/src/hrtim/mod.rs @@ -2,7 +2,7 @@ mod traits; use core::marker::PhantomData; -use embassy_hal_common::{into_ref, PeripheralRef}; +use embassy_hal_internal::{into_ref, PeripheralRef}; #[allow(unused_imports)] use crate::gpio::sealed::{AFType, Pin}; diff --git a/embassy-stm32/src/hrtim/traits.rs b/embassy-stm32/src/hrtim/traits.rs index 16193a45..7f2cedda 100644 --- a/embassy-stm32/src/hrtim/traits.rs +++ b/embassy-stm32/src/hrtim/traits.rs @@ -1,3 +1,4 @@ +use crate::rcc::sealed::RccPeripheral; use crate::time::Hertz; #[derive(Clone, Copy)] @@ -92,7 +93,9 @@ impl HighResolutionControlPrescaler { pub(crate) mod sealed { use super::*; - pub trait HighResolutionCaptureCompare16bitInstance: crate::timer::sealed::HighResolutionControlInstance { + pub trait HighResolutionCaptureCompare16bitInstance: RccPeripheral { + fn regs() -> crate::pac::hrtim::Hrtim; + fn set_master_frequency(frequency: Hertz); fn set_channel_frequency(channnel: usize, frequency: Hertz); @@ -114,9 +117,12 @@ pub trait HighResolutionCaptureCompare16bitInstance: foreach_interrupt! { ($inst:ident, hrtim, HRTIM, MASTER, $irq:ident) => { impl sealed::HighResolutionCaptureCompare16bitInstance for crate::peripherals::$inst { + fn regs() -> crate::pac::hrtim::Hrtim { + crate::pac::$inst + } + fn set_master_frequency(frequency: Hertz) { use crate::rcc::sealed::RccPeripheral; - use crate::timer::sealed::HighResolutionControlInstance; let f = frequency.0; let timer_f = Self::frequency().0; @@ -139,7 +145,6 @@ foreach_interrupt! { fn set_channel_frequency(channel: usize, frequency: Hertz) { use crate::rcc::sealed::RccPeripheral; - use crate::timer::sealed::HighResolutionControlInstance; let f = frequency.0; let timer_f = Self::frequency().0; @@ -161,7 +166,6 @@ foreach_interrupt! { } fn set_channel_dead_time(channel: usize, dead_time: u16) { - use crate::timer::sealed::HighResolutionControlInstance; let regs = Self::regs(); diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 286ab556..6c2d6d82 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs @@ -429,17 +429,4 @@ foreach_interrupt! { }; - - ($inst:ident, hrtim, HRTIM, MASTER, $irq:ident) => { - impl sealed::HighResolutionControlInstance for crate::peripherals::$inst { - type Interrupt = crate::interrupt::typelevel::$irq; - - fn regs() -> crate::pac::hrtim::Hrtim { - crate::pac::$inst - } - } - - impl HighResolutionControlInstance for crate::peripherals::$inst { - } - }; }