diff options
| author | melvdl <[email protected]> | 2025-06-27 01:08:45 +0200 |
|---|---|---|
| committer | melvdl <[email protected]> | 2025-06-27 01:08:45 +0200 |
| commit | 41327c1325367177548dabc644636617274de7f4 (patch) | |
| tree | b389d87f80f0843db946635837691982e41740a0 /examples/stm32f4 | |
| parent | 6f88c2c73caa63a6e534130f4a064cb95d3e9d7d (diff) | |
stm32: adapt examples to timer API changes
Diffstat (limited to 'examples/stm32f4')
| -rw-r--r-- | examples/stm32f4/src/bin/input_capture.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/pwm.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/pwm_complementary.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/ws2812_pwm.rs | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32f4/src/bin/input_capture.rs b/examples/stm32f4/src/bin/input_capture.rs index fe5e2bdfc..e15b4d26e 100644 --- a/examples/stm32f4/src/bin/input_capture.rs +++ b/examples/stm32f4/src/bin/input_capture.rs | |||
| @@ -39,7 +39,7 @@ async fn main(spawner: Spawner) { | |||
| 39 | 39 | ||
| 40 | unwrap!(spawner.spawn(blinky(p.PB2))); | 40 | unwrap!(spawner.spawn(blinky(p.PB2))); |
| 41 | 41 | ||
| 42 | let ch3 = CapturePin::new_ch3(p.PB10, Pull::None); | 42 | let ch3 = CapturePin::new(p.PB10, Pull::None); |
| 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); | 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); |
| 44 | 44 | ||
| 45 | loop { | 45 | loop { |
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs index 04811162b..e385842f0 100644 --- a/examples/stm32f4/src/bin/pwm.rs +++ b/examples/stm32f4/src/bin/pwm.rs | |||
| @@ -14,7 +14,7 @@ async fn main(_spawner: Spawner) { | |||
| 14 | let p = embassy_stm32::init(Default::default()); | 14 | let p = embassy_stm32::init(Default::default()); |
| 15 | info!("Hello World!"); | 15 | info!("Hello World!"); |
| 16 | 16 | ||
| 17 | let ch1_pin = PwmPin::new_ch1(p.PE9, OutputType::PushPull); | 17 | let ch1_pin = PwmPin::new(p.PE9, OutputType::PushPull); |
| 18 | let mut pwm = SimplePwm::new(p.TIM1, Some(ch1_pin), None, None, None, khz(10), Default::default()); | 18 | let mut pwm = SimplePwm::new(p.TIM1, Some(ch1_pin), None, None, None, khz(10), Default::default()); |
| 19 | let mut ch1 = pwm.ch1(); | 19 | let mut ch1 = pwm.ch1(); |
| 20 | ch1.enable(); | 20 | ch1.enable(); |
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs index 161f43c48..c981f1a76 100644 --- a/examples/stm32f4/src/bin/pwm_complementary.rs +++ b/examples/stm32f4/src/bin/pwm_complementary.rs | |||
| @@ -16,8 +16,8 @@ async fn main(_spawner: Spawner) { | |||
| 16 | let p = embassy_stm32::init(Default::default()); | 16 | let p = embassy_stm32::init(Default::default()); |
| 17 | info!("Hello World!"); | 17 | info!("Hello World!"); |
| 18 | 18 | ||
| 19 | let ch1 = PwmPin::new_ch1(p.PE9, OutputType::PushPull); | 19 | let ch1 = PwmPin::new(p.PE9, OutputType::PushPull); |
| 20 | let ch1n = ComplementaryPwmPin::new_ch1(p.PA7, OutputType::PushPull); | 20 | let ch1n = ComplementaryPwmPin::new(p.PA7, OutputType::PushPull); |
| 21 | let mut pwm = ComplementaryPwm::new( | 21 | let mut pwm = ComplementaryPwm::new( |
| 22 | p.TIM1, | 22 | p.TIM1, |
| 23 | Some(ch1), | 23 | Some(ch1), |
diff --git a/examples/stm32f4/src/bin/ws2812_pwm.rs b/examples/stm32f4/src/bin/ws2812_pwm.rs index ca924e181..5153e1cfd 100644 --- a/examples/stm32f4/src/bin/ws2812_pwm.rs +++ b/examples/stm32f4/src/bin/ws2812_pwm.rs | |||
| @@ -50,7 +50,7 @@ async fn main(_spawner: Spawner) { | |||
| 50 | 50 | ||
| 51 | let mut ws2812_pwm = SimplePwm::new( | 51 | let mut ws2812_pwm = SimplePwm::new( |
| 52 | dp.TIM3, | 52 | dp.TIM3, |
| 53 | Some(PwmPin::new_ch1(dp.PB4, OutputType::PushPull)), | 53 | Some(PwmPin::new(dp.PB4, OutputType::PushPull)), |
| 54 | None, | 54 | None, |
| 55 | None, | 55 | None, |
| 56 | None, | 56 | None, |
