aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/pio_programs
diff options
context:
space:
mode:
authorCaleb Jamison <[email protected]>2024-10-09 16:51:52 -0400
committerCaleb Jamison <[email protected]>2024-10-09 16:51:52 -0400
commit1b32b7bcb44a9df149bb9194cb83e6c1f370db12 (patch)
treebb79aec71315393cf57cf2e369126010f53630dd /embassy-rp/src/pio_programs
parent041eef5c2d7858178fc5d2107d8c9fdafdd2367d (diff)
fmt
Diffstat (limited to 'embassy-rp/src/pio_programs')
-rw-r--r--embassy-rp/src/pio_programs/pwm.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/embassy-rp/src/pio_programs/pwm.rs b/embassy-rp/src/pio_programs/pwm.rs
index 7b3157877..dfc5feb19 100644
--- a/embassy-rp/src/pio_programs/pwm.rs
+++ b/embassy-rp/src/pio_programs/pwm.rs
@@ -1,13 +1,12 @@
1//! PIO backed PWM driver 1//! PIO backed PWM driver
2 2
3use core::time::Duration; 3use core::time::Duration;
4use crate::pio::Pin;
5 4
6use pio::InstructionOperands; 5use pio::InstructionOperands;
7 6
8use crate::clocks; 7use crate::clocks;
9use crate::gpio::Level; 8use crate::gpio::Level;
10use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, PioPin, StateMachine}; 9use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, Pin, PioPin, StateMachine};
11 10
12/// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time 11/// This converts the duration provided into the number of cycles the PIO needs to run to make it take the same time
13fn to_pio_cycles(duration: Duration) -> u32 { 12fn to_pio_cycles(duration: Duration) -> u32 {
@@ -45,7 +44,7 @@ impl<'a, PIO: Instance> PioPwmProgram<'a, PIO> {
45/// Pio backed PWM output 44/// Pio backed PWM output
46pub struct PioPwm<'d, T: Instance, const SM: usize> { 45pub struct PioPwm<'d, T: Instance, const SM: usize> {
47 sm: StateMachine<'d, T, SM>, 46 sm: StateMachine<'d, T, SM>,
48 pin: Pin<'d, T> 47 pin: Pin<'d, T>,
49} 48}
50 49
51impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> { 50impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> {