aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-02-10 00:03:49 +0100
committerDario Nieuwenhuis <[email protected]>2025-02-18 18:14:57 +0100
commit52dfefb63242ad49fd126470042411f464fe624d (patch)
tree69c559a4b4ecbab92e8b2963d8331546862d7de4 /examples
parentdcf0868dd017c6df0c82e504864956374019f484 (diff)
rp/pio: update pio-rs crate, reexport it so users don't get version mismatches.
Diffstat (limited to 'examples')
-rw-r--r--examples/rp/Cargo.toml2
-rw-r--r--examples/rp/src/bin/pio_async.rs7
-rw-r--r--examples/rp/src/bin/pio_dma.rs3
-rw-r--r--examples/rp23/Cargo.toml2
-rw-r--r--examples/rp23/src/bin/pio_async.rs7
-rw-r--r--examples/rp23/src/bin/pio_dma.rs3
-rw-r--r--examples/rp23/src/bin/pio_rotary_encoder_rxf.rs3
7 files changed, 14 insertions, 13 deletions
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml
index e05c88a9a..a81166067 100644
--- a/examples/rp/Cargo.toml
+++ b/examples/rp/Cargo.toml
@@ -55,8 +55,6 @@ embedded-storage = { version = "0.3" }
55static_cell = "2.1" 55static_cell = "2.1"
56portable-atomic = { version = "1.5", features = ["critical-section"] } 56portable-atomic = { version = "1.5", features = ["critical-section"] }
57log = "0.4" 57log = "0.4"
58pio-proc = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
59pio = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
60rand = { version = "0.8.5", default-features = false } 58rand = { version = "0.8.5", default-features = false }
61embedded-sdmmc = "0.7.0" 59embedded-sdmmc = "0.7.0"
62 60
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;
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_rp::bind_interrupts; 7use embassy_rp::bind_interrupts;
8use embassy_rp::peripherals::PIO0; 8use embassy_rp::peripherals::PIO0;
9use embassy_rp::pio::program::pio_asm;
9use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; 10use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine};
10use fixed::traits::ToFixed; 11use fixed::traits::ToFixed;
11use fixed_macro::types::U56F8; 12use 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;
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_futures::join::join; 7use embassy_futures::join::join;
8use embassy_rp::peripherals::PIO0; 8use embassy_rp::peripherals::PIO0;
9use embassy_rp::pio::program::pio_asm;
9use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; 10use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection};
10use embassy_rp::{bind_interrupts, Peripheral}; 11use embassy_rp::{bind_interrupts, Peripheral};
11use fixed::traits::ToFixed; 12use 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",
diff --git a/examples/rp23/Cargo.toml b/examples/rp23/Cargo.toml
index b7e7dd69a..f4dfae773 100644
--- a/examples/rp23/Cargo.toml
+++ b/examples/rp23/Cargo.toml
@@ -55,8 +55,6 @@ embedded-storage = { version = "0.3" }
55static_cell = "2.1" 55static_cell = "2.1"
56portable-atomic = { version = "1.5", features = ["critical-section"] } 56portable-atomic = { version = "1.5", features = ["critical-section"] }
57log = "0.4" 57log = "0.4"
58pio-proc = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
59pio = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
60rand = { version = "0.8.5", default-features = false } 58rand = { version = "0.8.5", default-features = false }
61embedded-sdmmc = "0.7.0" 59embedded-sdmmc = "0.7.0"
62 60
diff --git a/examples/rp23/src/bin/pio_async.rs b/examples/rp23/src/bin/pio_async.rs
index ee248591b..08c702347 100644
--- a/examples/rp23/src/bin/pio_async.rs
+++ b/examples/rp23/src/bin/pio_async.rs
@@ -6,6 +6,7 @@ use defmt::info;
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_rp::bind_interrupts; 7use embassy_rp::bind_interrupts;
8use embassy_rp::peripherals::PIO0; 8use embassy_rp::peripherals::PIO0;
9use embassy_rp::pio::program::pio_asm;
9use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; 10use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine};
10use fixed::traits::ToFixed; 11use fixed::traits::ToFixed;
11use fixed_macro::types::U56F8; 12use 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/rp23/src/bin/pio_dma.rs b/examples/rp23/src/bin/pio_dma.rs
index 02700269c..d00ed2142 100644
--- a/examples/rp23/src/bin/pio_dma.rs
+++ b/examples/rp23/src/bin/pio_dma.rs
@@ -6,6 +6,7 @@ use defmt::info;
6use embassy_executor::Spawner; 6use embassy_executor::Spawner;
7use embassy_futures::join::join; 7use embassy_futures::join::join;
8use embassy_rp::peripherals::PIO0; 8use embassy_rp::peripherals::PIO0;
9use embassy_rp::pio::program::pio_asm;
9use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; 10use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection};
10use embassy_rp::{bind_interrupts, Peripheral}; 11use embassy_rp::{bind_interrupts, Peripheral};
11use fixed::traits::ToFixed; 12use 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",
diff --git a/examples/rp23/src/bin/pio_rotary_encoder_rxf.rs b/examples/rp23/src/bin/pio_rotary_encoder_rxf.rs
index ca6b5222b..0216c131b 100644
--- a/examples/rp23/src/bin/pio_rotary_encoder_rxf.rs
+++ b/examples/rp23/src/bin/pio_rotary_encoder_rxf.rs
@@ -8,6 +8,7 @@ use defmt::info;
8use embassy_executor::Spawner; 8use embassy_executor::Spawner;
9use embassy_rp::gpio::Pull; 9use embassy_rp::gpio::Pull;
10use embassy_rp::peripherals::PIO0; 10use embassy_rp::peripherals::PIO0;
11use embassy_rp::pio::program::pio_asm;
11use embassy_rp::{bind_interrupts, pio}; 12use embassy_rp::{bind_interrupts, pio};
12use embassy_time::Timer; 13use embassy_time::Timer;
13use fixed::traits::ToFixed; 14use fixed::traits::ToFixed;
@@ -46,7 +47,7 @@ impl<'d, T: Instance, const SM: usize> PioEncoder<'d, T, SM> {
46 47
47 sm.set_pin_dirs(pio::Direction::In, &[&pin_a, &pin_b]); 48 sm.set_pin_dirs(pio::Direction::In, &[&pin_a, &pin_b]);
48 49
49 let prg = pio_proc::pio_asm!( 50 let prg = pio_asm!(
50 "start:" 51 "start:"
51 // encoder count is stored in X 52 // encoder count is stored in X
52 "mov isr, x" 53 "mov isr, x"