diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-23 16:14:00 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-23 16:16:29 +0200 |
| commit | b5ff7c5d60cd5cba905720b4b8f6cb8c73859ca6 (patch) | |
| tree | 2b3975074c806fe2c2981b488e8f91be62be3660 /examples/stm32h7/src | |
| parent | 042e11960e6018082801d4f268bbe0bdc62edfac (diff) | |
rename PwmPin::new_chX, update examples.
Diffstat (limited to 'examples/stm32h7/src')
| -rw-r--r-- | examples/stm32h7/src/bin/pwm.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs index f072c5375..730f637e9 100644 --- a/examples/stm32h7/src/bin/pwm.rs +++ b/examples/stm32h7/src/bin/pwm.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy::executor::Spawner; |
| 7 | use embassy::time::{Duration, Timer}; | 7 | use embassy::time::{Duration, Timer}; |
| 8 | use embassy_stm32::pwm::simple_pwm::SimplePwm; | 8 | use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; |
| 9 | use embassy_stm32::pwm::Channel; | 9 | use embassy_stm32::pwm::Channel; |
| 10 | use embassy_stm32::time::{khz, mhz}; | 10 | use embassy_stm32::time::{khz, mhz}; |
| 11 | use embassy_stm32::{Config, Peripherals}; | 11 | use embassy_stm32::{Config, Peripherals}; |
| @@ -27,7 +27,8 @@ pub fn config() -> Config { | |||
| 27 | async fn main(_spawner: Spawner, p: Peripherals) { | 27 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 28 | info!("Hello World!"); | 28 | info!("Hello World!"); |
| 29 | 29 | ||
| 30 | let mut pwm = SimplePwm::new_1ch(p.TIM3, p.PA6, khz(10)); | 30 | let ch1 = PwmPin::new_ch1(p.PA6); |
| 31 | let mut pwm = SimplePwm::new(p.TIM3, Some(ch1), None, None, None, khz(10)); | ||
| 31 | let max = pwm.get_max_duty(); | 32 | let max = pwm.get_max_duty(); |
| 32 | pwm.enable(Channel::Ch1); | 33 | pwm.enable(Channel::Ch1); |
| 33 | 34 | ||
