aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authormelvdl <[email protected]>2025-06-27 01:08:45 +0200
committermelvdl <[email protected]>2025-06-27 01:08:45 +0200
commit41327c1325367177548dabc644636617274de7f4 (patch)
treeb389d87f80f0843db946635837691982e41740a0 /examples/stm32h7
parent6f88c2c73caa63a6e534130f4a064cb95d3e9d7d (diff)
stm32: adapt examples to timer API changes
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs10
-rw-r--r--examples/stm32h7/src/bin/pwm.rs2
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs
index 8de31ea5b..12abb8693 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -6,7 +6,7 @@ use embassy_executor::Spawner;
6use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed}; 6use 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::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance32bit4Channel, TimerPin};
10use embassy_stm32::{Config, Peri}; 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 _};
@@ -67,10 +67,10 @@ pub struct SimplePwm32<'d, T: GeneralInstance32bit4Channel> {
67impl<'d, T: GeneralInstance32bit4Channel> SimplePwm32<'d, T> { 67impl<'d, T: GeneralInstance32bit4Channel> SimplePwm32<'d, T> {
68 pub fn new( 68 pub fn new(
69 tim: Peri<'d, T>, 69 tim: Peri<'d, T>,
70 ch1: Peri<'d, impl Channel1Pin<T>>, 70 ch1: Peri<'d, impl TimerPin<T, Ch1>>,
71 ch2: Peri<'d, impl Channel2Pin<T>>, 71 ch2: Peri<'d, impl TimerPin<T, Ch2>>,
72 ch3: Peri<'d, impl Channel3Pin<T>>, 72 ch3: Peri<'d, impl TimerPin<T, Ch3>>,
73 ch4: Peri<'d, impl Channel4Pin<T>>, 73 ch4: Peri<'d, impl TimerPin<T, Ch4>>,
74 freq: Hertz, 74 freq: Hertz,
75 ) -> Self { 75 ) -> Self {
76 let af1 = ch1.af_num(); 76 let af1 = ch1.af_num();
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs
index a1c53fc3f..73b43be69 100644
--- a/examples/stm32h7/src/bin/pwm.rs
+++ b/examples/stm32h7/src/bin/pwm.rs
@@ -36,7 +36,7 @@ async fn main(_spawner: Spawner) {
36 let p = embassy_stm32::init(config); 36 let p = embassy_stm32::init(config);
37 info!("Hello World!"); 37 info!("Hello World!");
38 38
39 let ch1_pin = PwmPin::new_ch1(p.PA6, OutputType::PushPull); 39 let ch1_pin = PwmPin::new(p.PA6, OutputType::PushPull);
40 let mut pwm = SimplePwm::new(p.TIM3, Some(ch1_pin), None, None, None, khz(10), Default::default()); 40 let mut pwm = SimplePwm::new(p.TIM3, Some(ch1_pin), None, None, None, khz(10), Default::default());
41 let mut ch1 = pwm.ch1(); 41 let mut ch1 = pwm.ch1();
42 ch1.enable(); 42 ch1.enable();