diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-02-10 00:03:49 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-02-18 18:14:57 +0100 |
| commit | 52dfefb63242ad49fd126470042411f464fe624d (patch) | |
| tree | 69c559a4b4ecbab92e8b2963d8331546862d7de4 /examples/rp/src | |
| parent | dcf0868dd017c6df0c82e504864956374019f484 (diff) | |
rp/pio: update pio-rs crate, reexport it so users don't get version mismatches.
Diffstat (limited to 'examples/rp/src')
| -rw-r--r-- | examples/rp/src/bin/pio_async.rs | 7 | ||||
| -rw-r--r-- | examples/rp/src/bin/pio_dma.rs | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/rp/src/bin/pio_async.rs b/examples/rp/src/bin/pio_async.rs index ee248591b..08c702347 100644 --- a/examples/rp/src/bin/pio_async.rs +++ b/examples/rp/src/bin/pio_async.rs | |||
| @@ -6,6 +6,7 @@ use defmt::info; | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_rp::bind_interrupts; | 7 | use embassy_rp::bind_interrupts; |
| 8 | use embassy_rp::peripherals::PIO0; | 8 | use embassy_rp::peripherals::PIO0; |
| 9 | use embassy_rp::pio::program::pio_asm; | ||
| 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; | 10 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; |
| 10 | use fixed::traits::ToFixed; | 11 | use fixed::traits::ToFixed; |
| 11 | use fixed_macro::types::U56F8; | 12 | use fixed_macro::types::U56F8; |
| @@ -19,7 +20,7 @@ fn setup_pio_task_sm0<'a>(pio: &mut Common<'a, PIO0>, sm: &mut StateMachine<'a, | |||
| 19 | // Setup sm0 | 20 | // Setup sm0 |
| 20 | 21 | ||
| 21 | // Send data serially to pin | 22 | // Send data serially to pin |
| 22 | let prg = pio_proc::pio_asm!( | 23 | let prg = pio_asm!( |
| 23 | ".origin 16", | 24 | ".origin 16", |
| 24 | "set pindirs, 1", | 25 | "set pindirs, 1", |
| 25 | ".wrap_target", | 26 | ".wrap_target", |
| @@ -53,7 +54,7 @@ fn setup_pio_task_sm1<'a>(pio: &mut Common<'a, PIO0>, sm: &mut StateMachine<'a, | |||
| 53 | // Setupm sm1 | 54 | // Setupm sm1 |
| 54 | 55 | ||
| 55 | // Read 0b10101 repeatedly until ISR is full | 56 | // Read 0b10101 repeatedly until ISR is full |
| 56 | let prg = pio_proc::pio_asm!( | 57 | let prg = pio_asm!( |
| 57 | // | 58 | // |
| 58 | ".origin 8", | 59 | ".origin 8", |
| 59 | "set x, 0x15", | 60 | "set x, 0x15", |
| @@ -83,7 +84,7 @@ fn setup_pio_task_sm2<'a>(pio: &mut Common<'a, PIO0>, sm: &mut StateMachine<'a, | |||
| 83 | // Setup sm2 | 84 | // Setup sm2 |
| 84 | 85 | ||
| 85 | // Repeatedly trigger IRQ 3 | 86 | // Repeatedly trigger IRQ 3 |
| 86 | let prg = pio_proc::pio_asm!( | 87 | let prg = pio_asm!( |
| 87 | ".origin 0", | 88 | ".origin 0", |
| 88 | ".wrap_target", | 89 | ".wrap_target", |
| 89 | "set x,10", | 90 | "set x,10", |
diff --git a/examples/rp/src/bin/pio_dma.rs b/examples/rp/src/bin/pio_dma.rs index 02700269c..d00ed2142 100644 --- a/examples/rp/src/bin/pio_dma.rs +++ b/examples/rp/src/bin/pio_dma.rs | |||
| @@ -6,6 +6,7 @@ use defmt::info; | |||
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_rp::peripherals::PIO0; | 8 | use embassy_rp::peripherals::PIO0; |
| 9 | use embassy_rp::pio::program::pio_asm; | ||
| 9 | use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; | 10 | use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; |
| 10 | use embassy_rp::{bind_interrupts, Peripheral}; | 11 | use embassy_rp::{bind_interrupts, Peripheral}; |
| 11 | use fixed::traits::ToFixed; | 12 | use fixed::traits::ToFixed; |
| @@ -32,7 +33,7 @@ async fn main(_spawner: Spawner) { | |||
| 32 | .. | 33 | .. |
| 33 | } = Pio::new(pio, Irqs); | 34 | } = Pio::new(pio, Irqs); |
| 34 | 35 | ||
| 35 | let prg = pio_proc::pio_asm!( | 36 | let prg = pio_asm!( |
| 36 | ".origin 0", | 37 | ".origin 0", |
| 37 | "set pindirs,1", | 38 | "set pindirs,1", |
| 38 | ".wrap_target", | 39 | ".wrap_target", |
