diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-01-22 21:30:29 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-01-22 21:32:10 +0100 |
| commit | ee0ebe3121e5d51240e671d8c5cc19ad878b9db9 (patch) | |
| tree | caabf0c20ce7d2d07e292690b1afb9baa606610f /cyw43-pio/src | |
| parent | 2bc5e9523d4373002487614ecfef1e3f0858fd66 (diff) | |
rp/gpio: remove generics.
Diffstat (limited to 'cyw43-pio/src')
| -rw-r--r-- | cyw43-pio/src/lib.rs | 14 |
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 | ||
| 8 | use cyw43::SpiBusCyw43; | 8 | use cyw43::SpiBusCyw43; |
| 9 | use embassy_rp::dma::Channel; | 9 | use embassy_rp::dma::Channel; |
| 10 | use embassy_rp::gpio::{Drive, Level, Output, Pin, Pull, SlewRate}; | 10 | use embassy_rp::gpio::{Drive, Level, Output, Pull, SlewRate}; |
| 11 | use embassy_rp::pio::{instr, Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; | 11 | use embassy_rp::pio::{instr, Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; |
| 12 | use embassy_rp::{Peripheral, PeripheralRef}; | 12 | use embassy_rp::{Peripheral, PeripheralRef}; |
| 13 | use fixed::FixedU32; | 13 | use fixed::FixedU32; |
| 14 | use pio_proc::pio_asm; | 14 | use pio_proc::pio_asm; |
| 15 | 15 | ||
| 16 | /// SPI comms driven by PIO. | 16 | /// SPI comms driven by PIO. |
| 17 | pub struct PioSpi<'d, CS: Pin, PIO: Instance, const SM: usize, DMA> { | 17 | pub 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 | ||
| 25 | impl<'d, CS, PIO, const SM: usize, DMA> PioSpi<'d, CS, PIO, SM, DMA> | 25 | impl<'d, PIO, const SM: usize, DMA> PioSpi<'d, PIO, SM, DMA> |
| 26 | where | 26 | where |
| 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 | ||
| 209 | impl<'d, CS, PIO, const SM: usize, DMA> SpiBusCyw43 for PioSpi<'d, CS, PIO, SM, DMA> | 208 | impl<'d, PIO, const SM: usize, DMA> SpiBusCyw43 for PioSpi<'d, PIO, SM, DMA> |
| 210 | where | 209 | where |
| 211 | CS: Pin, | ||
| 212 | PIO: Instance, | 210 | PIO: Instance, |
| 213 | DMA: Channel, | 211 | DMA: Channel, |
| 214 | { | 212 | { |
