stm32/pwm: add output type control
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::gpio::OutputType;
|
||||
use embassy_stm32::time::{khz, mhz};
|
||||
use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm};
|
||||
use embassy_stm32::timer::Channel;
|
||||
@ -24,7 +25,7 @@ async fn main(_spawner: Spawner) {
|
||||
let p = embassy_stm32::init(config);
|
||||
info!("Hello World!");
|
||||
|
||||
let ch1 = PwmPin::new_ch1(p.PA6);
|
||||
let ch1 = PwmPin::new_ch1(p.PA6, OutputType::PushPull);
|
||||
let mut pwm = SimplePwm::new(p.TIM3, Some(ch1), None, None, None, khz(10));
|
||||
let max = pwm.get_max_duty();
|
||||
pwm.enable(Channel::Ch1);
|
||||
|
Reference in New Issue
Block a user