Skip to content

Commit 52dfefb

Browse files
committed
rp/pio: update pio-rs crate, reexport it so users don't get version mismatches.
1 parent dcf0868 commit 52dfefb

File tree

21 files changed

+45
-43
lines changed

21 files changed

+45
-43
lines changed

cyw43-pio/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ documentation = "https://docs.embassy.dev/cyw43-pio"
1212
[dependencies]
1313
cyw43 = { version = "0.3.0", path = "../cyw43" }
1414
embassy-rp = { version = "0.3.0", path = "../embassy-rp" }
15-
pio-proc = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
16-
pio = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
1715
fixed = "1.23.1"
1816
defmt = { version = "0.3", optional = true }
1917

cyw43-pio/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use core::slice;
88
use cyw43::SpiBusCyw43;
99
use embassy_rp::dma::Channel;
1010
use embassy_rp::gpio::{Drive, Level, Output, Pull, SlewRate};
11+
use embassy_rp::pio::program::pio_asm;
1112
use embassy_rp::pio::{Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine};
1213
use embassy_rp::{Peripheral, PeripheralRef};
1314
use fixed::types::extra::U8;
1415
use fixed::FixedU32;
15-
use pio_proc::pio_asm;
1616

1717
/// SPI comms driven by PIO.
1818
pub struct PioSpi<'d, PIO: Instance, const SM: usize, DMA> {

embassy-rp/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ embedded-hal-1 = { package = "embedded-hal", version = "1.0" }
164164
embedded-hal-async = { version = "1.0" }
165165
embedded-hal-nb = { version = "1.0" }
166166

167-
pio-proc = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
168-
pio = { git = "https://github.com/rp-rs/pio-rs", rev = "fa586448b0b223217eec8c92c19fe6823dd04cc4" }
167+
pio = { git = "https://github.com/rp-rs/pio-rs", rev = "506a51b9bc135845e8544a0debd75847b73754dc" }
169168
rp2040-boot2 = "0.3"
170169
document-features = "0.2.10"
171170
sha2-const-stable = "0.1"

embassy-rp/src/pio/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ use crate::{pac, peripherals, RegExt};
2020

2121
mod instr;
2222

23+
#[doc(inline)]
24+
pub use pio as program;
25+
2326
/// Wakers for interrupts and FIFOs.
2427
pub struct Wakers([AtomicWaker; 12]);
2528

embassy-rp/src/pio_programs/hd44780.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct PioHD44780CommandWordProgram<'a, PIO: Instance> {
1515
impl<'a, PIO: Instance> PioHD44780CommandWordProgram<'a, PIO> {
1616
/// Load the program into the given pio
1717
pub fn new(common: &mut Common<'a, PIO>) -> Self {
18-
let prg = pio_proc::pio_asm!(
18+
let prg = pio::pio_asm!(
1919
r#"
2020
.side_set 1 opt
2121
.origin 20
@@ -46,7 +46,7 @@ impl<'a, PIO: Instance> PioHD44780CommandSequenceProgram<'a, PIO> {
4646
/// Load the program into the given pio
4747
pub fn new(common: &mut Common<'a, PIO>) -> Self {
4848
// many side sets are only there to free up a delay bit!
49-
let prg = pio_proc::pio_asm!(
49+
let prg = pio::pio_asm!(
5050
r#"
5151
.origin 27
5252
.side_set 1

embassy-rp/src/pio_programs/i2s.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct PioI2sOutProgram<'a, PIO: Instance> {
1616
impl<'a, PIO: Instance> PioI2sOutProgram<'a, PIO> {
1717
/// Load the program into the given pio
1818
pub fn new(common: &mut Common<'a, PIO>) -> Self {
19-
let prg = pio_proc::pio_asm!(
19+
let prg = pio::pio_asm!(
2020
".side_set 2",
2121
" set x, 14 side 0b01", // side 0bWB - W = Word Clock, B = Bit Clock
2222
"left_data:",

embassy-rp/src/pio_programs/onewire.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! OneWire pio driver
22
3-
use crate::pio::{self, Common, Config, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine};
3+
use crate::pio::{Common, Config, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine};
44

55
/// This struct represents an onewire driver program
66
pub struct PioOneWireProgram<'a, PIO: Instance> {
@@ -10,7 +10,7 @@ pub struct PioOneWireProgram<'a, PIO: Instance> {
1010
impl<'a, PIO: Instance> PioOneWireProgram<'a, PIO> {
1111
/// Load the program into the given pio
1212
pub fn new(common: &mut Common<'a, PIO>) -> Self {
13-
let prg = pio_proc::pio_asm!(
13+
let prg = pio::pio_asm!(
1414
r#"
1515
.wrap_target
1616
again:
@@ -60,11 +60,11 @@ impl<'a, PIO: Instance> PioOneWireProgram<'a, PIO> {
6060
}
6161

6262
/// Pio backed OneWire driver
63-
pub struct PioOneWire<'d, PIO: pio::Instance, const SM: usize> {
63+
pub struct PioOneWire<'d, PIO: Instance, const SM: usize> {
6464
sm: StateMachine<'d, PIO, SM>,
6565
}
6666

67-
impl<'d, PIO: pio::Instance, const SM: usize> PioOneWire<'d, PIO, SM> {
67+
impl<'d, PIO: Instance, const SM: usize> PioOneWire<'d, PIO, SM> {
6868
/// Create a new instance the driver
6969
pub fn new(
7070
common: &mut Common<'d, PIO>,

embassy-rp/src/pio_programs/pwm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct PioPwmProgram<'a, PIO: Instance> {
2121
impl<'a, PIO: Instance> PioPwmProgram<'a, PIO> {
2222
/// Load the program into the given pio
2323
pub fn new(common: &mut Common<'a, PIO>) -> Self {
24-
let prg = pio_proc::pio_asm!(
24+
let prg = pio::pio_asm!(
2525
".side_set 1 opt"
2626
"pull noblock side 0"
2727
"mov x, osr"

embassy-rp/src/pio_programs/rotary_encoder.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
use fixed::traits::ToFixed;
44

55
use crate::gpio::Pull;
6-
use crate::pio::{self, Common, Config, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine};
6+
use crate::pio::{
7+
Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine,
8+
};
79

810
/// This struct represents an Encoder program loaded into pio instruction memory.
911
pub struct PioEncoderProgram<'a, PIO: Instance> {
@@ -13,7 +15,7 @@ pub struct PioEncoderProgram<'a, PIO: Instance> {
1315
impl<'a, PIO: Instance> PioEncoderProgram<'a, PIO> {
1416
/// Load the program into the given pio
1517
pub fn new(common: &mut Common<'a, PIO>) -> Self {
16-
let prg = pio_proc::pio_asm!("wait 1 pin 1", "wait 0 pin 1", "in pins, 2", "push",);
18+
let prg = pio::pio_asm!("wait 1 pin 1", "wait 0 pin 1", "in pins, 2", "push",);
1719

1820
let prg = common.load_program(&prg.program);
1921

@@ -39,7 +41,7 @@ impl<'d, T: Instance, const SM: usize> PioEncoder<'d, T, SM> {
3941
let mut pin_b = pio.make_pio_pin(pin_b);
4042
pin_a.set_pull(Pull::Up);
4143
pin_b.set_pull(Pull::Up);
42-
sm.set_pin_dirs(pio::Direction::In, &[&pin_a, &pin_b]);
44+
sm.set_pin_dirs(PioDirection::In, &[&pin_a, &pin_b]);
4345

4446
let mut cfg = Config::default();
4547
cfg.set_in_pins(&[&pin_a, &pin_b]);

embassy-rp/src/pio_programs/stepper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct PioStepperProgram<'a, PIO: Instance> {
1616
impl<'a, PIO: Instance> PioStepperProgram<'a, PIO> {
1717
/// Load the program into the given pio
1818
pub fn new(common: &mut Common<'a, PIO>) -> Self {
19-
let prg = pio_proc::pio_asm!(
19+
let prg = pio::pio_asm!(
2020
"pull block",
2121
"mov x, osr",
2222
"pull block",

0 commit comments

Comments
 (0)