aboutsummaryrefslogtreecommitdiff
path: root/cyw43-pio
diff options
context:
space:
mode:
Diffstat (limited to 'cyw43-pio')
-rw-r--r--cyw43-pio/src/lib.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/cyw43-pio/src/lib.rs b/cyw43-pio/src/lib.rs
index 5efab10e4..8c217b995 100644
--- a/cyw43-pio/src/lib.rs
+++ b/cyw43-pio/src/lib.rs
@@ -7,25 +7,24 @@ use core::slice;
7 7
8use cyw43::SpiBusCyw43; 8use cyw43::SpiBusCyw43;
9use embassy_rp::dma::Channel; 9use embassy_rp::dma::Channel;
10use embassy_rp::gpio::{Drive, Level, Output, Pin, Pull, SlewRate}; 10use embassy_rp::gpio::{Drive, Level, Output, Pull, SlewRate};
11use embassy_rp::pio::{instr, Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; 11use embassy_rp::pio::{instr, Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine};
12use embassy_rp::{Peripheral, PeripheralRef}; 12use embassy_rp::{Peripheral, PeripheralRef};
13use fixed::FixedU32; 13use fixed::FixedU32;
14use pio_proc::pio_asm; 14use pio_proc::pio_asm;
15 15
16/// SPI comms driven by PIO. 16/// SPI comms driven by PIO.
17pub struct PioSpi<'d, CS: Pin, PIO: Instance, const SM: usize, DMA> { 17pub struct PioSpi<'d, PIO: Instance, const SM: usize, DMA> {
18 cs: Output<'d, CS>, 18 cs: Output<'d>,
19 sm: StateMachine<'d, PIO, SM>, 19 sm: StateMachine<'d, PIO, SM>,
20 irq: Irq<'d, PIO, 0>, 20 irq: Irq<'d, PIO, 0>,
21 dma: PeripheralRef<'d, DMA>, 21 dma: PeripheralRef<'d, DMA>,
22 wrap_target: u8, 22 wrap_target: u8,
23} 23}
24 24
25impl<'d, CS, PIO, const SM: usize, DMA> PioSpi<'d, CS, PIO, SM, DMA> 25impl<'d, PIO, const SM: usize, DMA> PioSpi<'d, PIO, SM, DMA>
26where 26where
27 DMA: Channel, 27 DMA: Channel,
28 CS: Pin,
29 PIO: Instance, 28 PIO: Instance,
30{ 29{
31 /// Create a new instance of PioSpi. 30 /// Create a new instance of PioSpi.
@@ -33,7 +32,7 @@ where
33 common: &mut Common<'d, PIO>, 32 common: &mut Common<'d, PIO>,
34 mut sm: StateMachine<'d, PIO, SM>, 33 mut sm: StateMachine<'d, PIO, SM>,
35 irq: Irq<'d, PIO, 0>, 34 irq: Irq<'d, PIO, 0>,
36 cs: Output<'d, CS>, 35 cs: Output<'d>,
37 dio: DIO, 36 dio: DIO,
38 clk: CLK, 37 clk: CLK,
39 dma: impl Peripheral<P = DMA> + 'd, 38 dma: impl Peripheral<P = DMA> + 'd,
@@ -206,9 +205,8 @@ where
206 } 205 }
207} 206}
208 207
209impl<'d, CS, PIO, const SM: usize, DMA> SpiBusCyw43 for PioSpi<'d, CS, PIO, SM, DMA> 208impl<'d, PIO, const SM: usize, DMA> SpiBusCyw43 for PioSpi<'d, PIO, SM, DMA>
210where 209where
211 CS: Pin,
212 PIO: Instance, 210 PIO: Instance,
213 DMA: Channel, 211 DMA: Channel,
214{ 212{