diff options
Diffstat (limited to 'examples/stm32h7')
| -rw-r--r-- | examples/stm32h7/src/bin/low_level_timer_api.rs | 10 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/pwm.rs | 2 |
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; | |||
| 6 | use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed}; | 6 | use embassy_stm32::gpio::{AfType, Flex, OutputType, Speed}; |
| 7 | use embassy_stm32::time::{khz, Hertz}; | 7 | use embassy_stm32::time::{khz, Hertz}; |
| 8 | use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer}; | 8 | use embassy_stm32::timer::low_level::{OutputCompareMode, Timer as LLTimer}; |
| 9 | use embassy_stm32::timer::{Channel, Channel1Pin, Channel2Pin, Channel3Pin, Channel4Pin, GeneralInstance32bit4Channel}; | 9 | use embassy_stm32::timer::{Ch1, Ch2, Ch3, Ch4, Channel, GeneralInstance32bit4Channel, TimerPin}; |
| 10 | use embassy_stm32::{Config, Peri}; | 10 | use embassy_stm32::{Config, Peri}; |
| 11 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -67,10 +67,10 @@ pub struct SimplePwm32<'d, T: GeneralInstance32bit4Channel> { | |||
| 67 | impl<'d, T: GeneralInstance32bit4Channel> SimplePwm32<'d, T> { | 67 | impl<'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(); |
