mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
fmt
This commit is contained in:
parent
041eef5c2d
commit
1b32b7bcb4
@ -1,13 +1,12 @@
|
|||||||
//! PIO backed PWM driver
|
//! PIO backed PWM driver
|
||||||
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
use crate::pio::Pin;
|
|
||||||
|
|
||||||
use pio::InstructionOperands;
|
use pio::InstructionOperands;
|
||||||
|
|
||||||
use crate::clocks;
|
use crate::clocks;
|
||||||
use crate::gpio::Level;
|
use crate::gpio::Level;
|
||||||
use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, PioPin, StateMachine};
|
use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, Pin, PioPin, StateMachine};
|
||||||
|
|
||||||
/// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time
|
/// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time
|
||||||
fn to_pio_cycles(duration: Duration) -> u32 {
|
fn to_pio_cycles(duration: Duration) -> u32 {
|
||||||
@ -45,7 +44,7 @@ impl<'a, PIO: Instance> PioPwmProgram<'a, PIO> {
|
|||||||
/// Pio backed PWM output
|
/// Pio backed PWM output
|
||||||
pub struct PioPwm<'d, T: Instance, const SM: usize> {
|
pub struct PioPwm<'d, T: Instance, const SM: usize> {
|
||||||
sm: StateMachine<'d, T, SM>,
|
sm: StateMachine<'d, T, SM>,
|
||||||
pin: Pin<'d, T>
|
pin: Pin<'d, T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> {
|
impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> {
|
||||||
|
Loading…
Reference in New Issue
Block a user