Port the PWM example to H7, add low-level API example implementing 32-bit PWM.
This commit is contained in:
@ -7,7 +7,7 @@ mod example_common;
|
||||
use embassy::executor::Spawner;
|
||||
use embassy::time::{Duration, Timer};
|
||||
use embassy_stm32::gpio::NoPin;
|
||||
use embassy_stm32::pwm::{Channel, Pwm};
|
||||
use embassy_stm32::pwm::{simple_pwm::SimplePwm, Channel};
|
||||
use embassy_stm32::time::U32Ext;
|
||||
use embassy_stm32::Peripherals;
|
||||
use example_common::*;
|
||||
@ -16,7 +16,7 @@ use example_common::*;
|
||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
info!("Hello World!");
|
||||
|
||||
let mut pwm = Pwm::new(p.TIM2, p.PA5, NoPin, NoPin, NoPin, 10000.hz());
|
||||
let mut pwm = SimplePwm::new(p.TIM2, p.PA5, NoPin, NoPin, NoPin, 10000.hz());
|
||||
let max = pwm.get_max_duty();
|
||||
pwm.enable(Channel::Ch1);
|
||||
|
||||
|
Reference in New Issue
Block a user