diff options
Diffstat (limited to 'examples/stm32h7/src/bin/low_level_timer_api.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/low_level_timer_api.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index e54f1bb67..d7c6da5bd 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -9,7 +9,7 @@ use embassy_stm32::gpio::low_level::AFType; | |||
| 9 | use embassy_stm32::gpio::Speed; | 9 | use embassy_stm32::gpio::Speed; |
| 10 | use embassy_stm32::pwm::*; | 10 | use embassy_stm32::pwm::*; |
| 11 | use embassy_stm32::time::{khz, mhz, Hertz}; | 11 | use embassy_stm32::time::{khz, mhz, Hertz}; |
| 12 | use embassy_stm32::{unborrow, Config, Peripherals, Unborrow, Unborrowed}; | 12 | use embassy_stm32::{into_ref, Config, Peripheral, PeripheralRef, Peripherals}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | pub fn config() -> Config { | 15 | pub fn config() -> Config { |
| @@ -47,19 +47,19 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 47 | } | 47 | } |
| 48 | } | 48 | } |
| 49 | pub struct SimplePwm32<'d, T: CaptureCompare32bitInstance> { | 49 | pub struct SimplePwm32<'d, T: CaptureCompare32bitInstance> { |
| 50 | inner: Unborrowed<'d, T>, | 50 | inner: PeripheralRef<'d, T>, |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { | 53 | impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { |
| 54 | pub fn new( | 54 | pub fn new( |
| 55 | tim: impl Unborrow<Target = T> + 'd, | 55 | tim: impl Peripheral<P = T> + 'd, |
| 56 | ch1: impl Unborrow<Target = impl Channel1Pin<T>> + 'd, | 56 | ch1: impl Peripheral<P = impl Channel1Pin<T>> + 'd, |
| 57 | ch2: impl Unborrow<Target = impl Channel2Pin<T>> + 'd, | 57 | ch2: impl Peripheral<P = impl Channel2Pin<T>> + 'd, |
| 58 | ch3: impl Unborrow<Target = impl Channel3Pin<T>> + 'd, | 58 | ch3: impl Peripheral<P = impl Channel3Pin<T>> + 'd, |
| 59 | ch4: impl Unborrow<Target = impl Channel4Pin<T>> + 'd, | 59 | ch4: impl Peripheral<P = impl Channel4Pin<T>> + 'd, |
| 60 | freq: Hertz, | 60 | freq: Hertz, |
| 61 | ) -> Self { | 61 | ) -> Self { |
| 62 | unborrow!(tim, ch1, ch2, ch3, ch4); | 62 | into_ref!(tim, ch1, ch2, ch3, ch4); |
| 63 | 63 | ||
| 64 | T::enable(); | 64 | T::enable(); |
| 65 | <T as embassy_stm32::rcc::low_level::RccPeripheral>::reset(); | 65 | <T as embassy_stm32::rcc::low_level::RccPeripheral>::reset(); |
