diff options
| author | Adrian Wowk <[email protected]> | 2025-07-02 21:18:44 -0500 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-09-05 20:35:48 +0200 |
| commit | 83b42e0db620b7fc2364763b452b346b711e8d9f (patch) | |
| tree | 16c7f4097eb7aa3ea9a16d164c5d251aab1c0d0a /embassy-rp/src | |
| parent | 236662c748eab43a701bf4f43570b191ec2c1158 (diff) | |
style: cleanup with rustfmt
Diffstat (limited to 'embassy-rp/src')
| -rw-r--r-- | embassy-rp/src/pio_programs/spi.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/embassy-rp/src/pio_programs/spi.rs b/embassy-rp/src/pio_programs/spi.rs index 27d401fc9..a1b36c1c8 100644 --- a/embassy-rp/src/pio_programs/spi.rs +++ b/embassy-rp/src/pio_programs/spi.rs | |||
| @@ -5,24 +5,23 @@ use core::marker::PhantomData; | |||
| 5 | use embassy_futures::join::join; | 5 | use embassy_futures::join::join; |
| 6 | use embassy_hal_internal::Peri; | 6 | use embassy_hal_internal::Peri; |
| 7 | use embedded_hal_02::spi::{Phase, Polarity}; | 7 | use embedded_hal_02::spi::{Phase, Polarity}; |
| 8 | use fixed::{traits::ToFixed, types::extra::U8}; | 8 | use fixed::traits::ToFixed; |
| 9 | use fixed::types::extra::U8; | ||
| 9 | 10 | ||
| 10 | use crate::{ | 11 | use crate::clocks::clk_sys_freq; |
| 11 | clocks::clk_sys_freq, | 12 | use crate::dma::{AnyChannel, Channel}; |
| 12 | dma::{AnyChannel, Channel}, | 13 | use crate::gpio::Level; |
| 13 | gpio::Level, | 14 | use crate::pio::{Common, Direction, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine}; |
| 14 | pio::{Common, Direction, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine}, | 15 | use crate::spi::{Async, Blocking, Mode}; |
| 15 | spi::{Async, Blocking, Mode}, | ||
| 16 | }; | ||
| 17 | 16 | ||
| 18 | /// This struct represents a uart tx program loaded into pio instruction memory. | 17 | /// This struct represents a uart tx program loaded into pio instruction memory. |
| 19 | pub struct PioSpiProgram<'d, PIO: crate::pio::Instance> { | 18 | pub struct PioSpiProgram<'d, PIO: Instance> { |
| 20 | prg: LoadedProgram<'d, PIO>, | 19 | prg: LoadedProgram<'d, PIO>, |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | impl<'d, PIO: crate::pio::Instance> PioSpiProgram<'d, PIO> { | 22 | impl<'d, PIO: Instance> PioSpiProgram<'d, PIO> { |
| 24 | /// Load the spi program into the given pio | 23 | /// Load the spi program into the given pio |
| 25 | pub fn new(common: &mut crate::pio::Common<'d, PIO>, phase: Phase) -> Self { | 24 | pub fn new(common: &mut Common<'d, PIO>, phase: Phase) -> Self { |
| 26 | // These PIO programs are taken straight from the datasheet (3.6.1 in | 25 | // These PIO programs are taken straight from the datasheet (3.6.1 in |
| 27 | // RP2040 datasheet, 11.6.1 in RP2350 datasheet) | 26 | // RP2040 datasheet, 11.6.1 in RP2350 datasheet) |
| 28 | 27 | ||
