aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xci.sh1
-rwxr-xr-xci_stable.sh1
-rw-r--r--embassy-rp/Cargo.toml4
-rw-r--r--embassy-rp/src/gpio.rs17
4 files changed, 19 insertions, 4 deletions
diff --git a/ci.sh b/ci.sh
index 2693c1be5..954ad3e9f 100755
--- a/ci.sh
+++ b/ci.sh
@@ -58,6 +58,7 @@ cargo batch \
58 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ 58 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \
59 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ 59 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \
60 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \ 60 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \
61 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,qspi-as-gpio \
61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,unstable-traits \ 62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,unstable-traits \
62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any \ 63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any \
63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any \ 64 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any \
diff --git a/ci_stable.sh b/ci_stable.sh
index daae98961..56f72131f 100755
--- a/ci_stable.sh
+++ b/ci_stable.sh
@@ -36,6 +36,7 @@ cargo batch \
36 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \ 36 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \
37 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \ 37 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \
38 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \ 38 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \
39 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features qspi-as-gpio \
39 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,unstable-traits \ 40 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,unstable-traits \
40 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,unstable-traits \ 41 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,unstable-traits \
41 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,unstable-traits \ 42 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,unstable-traits \
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index 6310ffb62..564d44ecd 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -42,6 +42,10 @@ boot2-ram-memcpy = []
42boot2-w25q080 = [] 42boot2-w25q080 = []
43boot2-w25x10cl = [] 43boot2-w25x10cl = []
44 44
45# Allow using QSPI pins as GPIO pins. This is mostly not what you want (because your flash lives there)
46# and would add both code and memory overhead when enabled needlessly.
47qspi-as-gpio = []
48
45# Indicate code is running from RAM. 49# Indicate code is running from RAM.
46# Set this if all code is in RAM, and the cores never access memory-mapped flash memory through XIP. 50# Set this if all code is in RAM, and the cores never access memory-mapped flash memory through XIP.
47# This allows the flash driver to not force pausing execution on both cores when doing flash operations. 51# This allows the flash driver to not force pausing execution on both cores when doing flash operations.
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index bac126d43..9861429f3 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -67,6 +67,7 @@ pub enum SlewRate {
67#[derive(Debug, Eq, PartialEq)] 67#[derive(Debug, Eq, PartialEq)]
68pub enum Bank { 68pub enum Bank {
69 Bank0 = 0, 69 Bank0 = 0,
70 #[cfg(feature = "qspi-as-gpio")]
70 Qspi = 1, 71 Qspi = 1,
71} 72}
72 73
@@ -636,16 +637,17 @@ pub(crate) mod sealed {
636 637
637 #[inline] 638 #[inline]
638 fn _bank(&self) -> Bank { 639 fn _bank(&self) -> Bank {
639 if self.pin_bank() & 0x20 == 0 { 640 match self.pin_bank() & 0x20 {
640 Bank::Bank0 641 #[cfg(feature = "qspi-as-gpio")]
641 } else { 642 1 => Bank::Qspi,
642 Bank::Qspi 643 _ => Bank::Bank0,
643 } 644 }
644 } 645 }
645 646
646 fn io(&self) -> pac::io::Io { 647 fn io(&self) -> pac::io::Io {
647 match self._bank() { 648 match self._bank() {
648 Bank::Bank0 => crate::pac::IO_BANK0, 649 Bank::Bank0 => crate::pac::IO_BANK0,
650 #[cfg(feature = "qspi-as-gpio")]
649 Bank::Qspi => crate::pac::IO_QSPI, 651 Bank::Qspi => crate::pac::IO_QSPI,
650 } 652 }
651 } 653 }
@@ -657,6 +659,7 @@ pub(crate) mod sealed {
657 fn pad_ctrl(&self) -> Reg<pac::pads::regs::GpioCtrl, RW> { 659 fn pad_ctrl(&self) -> Reg<pac::pads::regs::GpioCtrl, RW> {
658 let block = match self._bank() { 660 let block = match self._bank() {
659 Bank::Bank0 => crate::pac::PADS_BANK0, 661 Bank::Bank0 => crate::pac::PADS_BANK0,
662 #[cfg(feature = "qspi-as-gpio")]
660 Bank::Qspi => crate::pac::PADS_QSPI, 663 Bank::Qspi => crate::pac::PADS_QSPI,
661 }; 664 };
662 block.gpio(self._pin() as _) 665 block.gpio(self._pin() as _)
@@ -766,11 +769,17 @@ impl_pin!(PIN_27, Bank::Bank0, 27);
766impl_pin!(PIN_28, Bank::Bank0, 28); 769impl_pin!(PIN_28, Bank::Bank0, 28);
767impl_pin!(PIN_29, Bank::Bank0, 29); 770impl_pin!(PIN_29, Bank::Bank0, 29);
768 771
772#[cfg(feature = "qspi-as-gpio")]
769impl_pin!(PIN_QSPI_SCLK, Bank::Qspi, 0); 773impl_pin!(PIN_QSPI_SCLK, Bank::Qspi, 0);
774#[cfg(feature = "qspi-as-gpio")]
770impl_pin!(PIN_QSPI_SS, Bank::Qspi, 1); 775impl_pin!(PIN_QSPI_SS, Bank::Qspi, 1);
776#[cfg(feature = "qspi-as-gpio")]
771impl_pin!(PIN_QSPI_SD0, Bank::Qspi, 2); 777impl_pin!(PIN_QSPI_SD0, Bank::Qspi, 2);
778#[cfg(feature = "qspi-as-gpio")]
772impl_pin!(PIN_QSPI_SD1, Bank::Qspi, 3); 779impl_pin!(PIN_QSPI_SD1, Bank::Qspi, 3);
780#[cfg(feature = "qspi-as-gpio")]
773impl_pin!(PIN_QSPI_SD2, Bank::Qspi, 4); 781impl_pin!(PIN_QSPI_SD2, Bank::Qspi, 4);
782#[cfg(feature = "qspi-as-gpio")]
774impl_pin!(PIN_QSPI_SD3, Bank::Qspi, 5); 783impl_pin!(PIN_QSPI_SD3, Bank::Qspi, 5);
775 784
776// ==================== 785// ====================