diff options
| author | Caleb Jamison <[email protected]> | 2024-10-09 16:51:52 -0400 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-10-09 16:51:52 -0400 |
| commit | 1b32b7bcb44a9df149bb9194cb83e6c1f370db12 (patch) | |
| tree | bb79aec71315393cf57cf2e369126010f53630dd /embassy-rp/src/pio_programs | |
| parent | 041eef5c2d7858178fc5d2107d8c9fdafdd2367d (diff) | |
fmt
Diffstat (limited to 'embassy-rp/src/pio_programs')
| -rw-r--r-- | embassy-rp/src/pio_programs/pwm.rs | 5 |
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 | ||
| 3 | use core::time::Duration; | 3 | use core::time::Duration; |
| 4 | use crate::pio::Pin; | ||
| 5 | 4 | ||
| 6 | use pio::InstructionOperands; | 5 | use pio::InstructionOperands; |
| 7 | 6 | ||
| 8 | use crate::clocks; | 7 | use crate::clocks; |
| 9 | use crate::gpio::Level; | 8 | use crate::gpio::Level; |
| 10 | use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, PioPin, StateMachine}; | 9 | use 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 |
| 13 | fn to_pio_cycles(duration: Duration) -> u32 { | 12 | fn 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 |
| 46 | pub struct PioPwm<'d, T: Instance, const SM: usize> { | 45 | pub 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 | ||
| 51 | impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> { | 50 | impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> { |
