aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/low_level_timer_api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32h7/src/bin/low_level_timer_api.rs')
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs14
1 files changed, 6 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 b796996ea..8de31ea5b 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -7,7 +7,7 @@ use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed};
7use embassy_stm32::time::{khz, Hertz}; 7use embassy_stm32::time::{khz, Hertz};
8use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer}; 8use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer};
9use embassy_stm32::timer::{Channel, Channel1Pin, Channel2Pin, Channel3Pin, Channel4Pin, GeneralInstance32bit4Channel}; 9use embassy_stm32::timer::{Channel, Channel1Pin, Channel2Pin, Channel3Pin, Channel4Pin, GeneralInstance32bit4Channel};
10use embassy_stm32::{into_ref, Config, Peripheral}; 10use embassy_stm32::{Config, Peri};
11use embassy_time::Timer; 11use embassy_time::Timer;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
@@ -66,15 +66,13 @@ pub struct SimplePwm32<'d, T: GeneralInstance32bit4Channel> {
66 66
67impl<'d, T: GeneralInstance32bit4Channel> SimplePwm32<'d, T> { 67impl<'d, T: GeneralInstance32bit4Channel> SimplePwm32<'d, T> {
68 pub fn new( 68 pub fn new(
69 tim: impl Peripheral<P = T> + 'd, 69 tim: Peri<'d, T>,
70 ch1: impl Peripheral<P = impl Channel1Pin<T>> + 'd, 70 ch1: Peri<'d, impl Channel1Pin<T>>,
71 ch2: impl Peripheral<P = impl Channel2Pin<T>> + 'd, 71 ch2: Peri<'d, impl Channel2Pin<T>>,
72 ch3: impl Peripheral<P = impl Channel3Pin<T>> + 'd, 72 ch3: Peri<'d, impl Channel3Pin<T>>,
73 ch4: impl Peripheral<P = impl Channel4Pin<T>> + 'd, 73 ch4: Peri<'d, impl Channel4Pin<T>>,
74 freq: Hertz, 74 freq: Hertz,
75 ) -> Self { 75 ) -> Self {
76 into_ref!(ch1, ch2, ch3, ch4);
77
78 let af1 = ch1.af_num(); 76 let af1 = ch1.af_num();
79 let af2 = ch2.af_num(); 77 let af2 = ch2.af_num();
80 let af3 = ch3.af_num(); 78 let af3 = ch3.af_num();