diff options
| author | Matous Hybl <[email protected]> | 2021-12-08 17:39:59 +0100 |
|---|---|---|
| committer | Matous Hybl <[email protected]> | 2022-01-13 16:53:55 +0100 |
| commit | e056bedd553e7fbc7d28f8f516c87fcd12859aef (patch) | |
| tree | 3a86254c58afa1ab790475b32b53debce7dcaec4 /examples/stm32g4/src/bin | |
| parent | e07df92651f58eb001ea8c22cae0130435877b17 (diff) | |
Port the PWM example to H7, add low-level API example implementing 32-bit PWM.
Diffstat (limited to 'examples/stm32g4/src/bin')
| -rw-r--r-- | examples/stm32g4/src/bin/pwm.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs index 1aa7b85f3..3dd45318d 100644 --- a/examples/stm32g4/src/bin/pwm.rs +++ b/examples/stm32g4/src/bin/pwm.rs | |||
| @@ -7,7 +7,7 @@ mod example_common; | |||
| 7 | use embassy::executor::Spawner; | 7 | use embassy::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::NoPin; | 9 | use embassy_stm32::gpio::NoPin; |
| 10 | use embassy_stm32::pwm::{Channel, Pwm}; | 10 | use embassy_stm32::pwm::{simple_pwm::SimplePwm, Channel}; |
| 11 | use embassy_stm32::time::U32Ext; | 11 | use embassy_stm32::time::U32Ext; |
| 12 | use embassy_stm32::Peripherals; | 12 | use embassy_stm32::Peripherals; |
| 13 | use example_common::*; | 13 | use example_common::*; |
| @@ -16,7 +16,7 @@ use example_common::*; | |||
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 16 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 17 | info!("Hello World!"); | 17 | info!("Hello World!"); |
| 18 | 18 | ||
| 19 | let mut pwm = Pwm::new(p.TIM2, p.PA5, NoPin, NoPin, NoPin, 10000.hz()); | 19 | let mut pwm = SimplePwm::new(p.TIM2, p.PA5, NoPin, NoPin, NoPin, 10000.hz()); |
| 20 | let max = pwm.get_max_duty(); | 20 | let max = pwm.get_max_duty(); |
| 21 | pwm.enable(Channel::Ch1); | 21 | pwm.enable(Channel::Ch1); |
| 22 | 22 | ||
