diff options
Diffstat (limited to 'tests/rp/src/bin/gpio.rs')
| -rw-r--r-- | tests/rp/src/bin/gpio.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/rp/src/bin/gpio.rs b/tests/rp/src/bin/gpio.rs index e0c309887..6c37ac5be 100644 --- a/tests/rp/src/bin/gpio.rs +++ b/tests/rp/src/bin/gpio.rs | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #[cfg(feature = "rp2040")] | ||
| 3 | teleprobe_meta::target!(b"rpi-pico"); | 4 | teleprobe_meta::target!(b"rpi-pico"); |
| 5 | #[cfg(feature = "rp235xb")] | ||
| 6 | teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | ||
| 4 | 7 | ||
| 5 | use defmt::{assert, *}; | 8 | use defmt::{assert, *}; |
| 6 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 7 | use embassy_rp::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull}; | 10 | #[cfg(feature = "rp2040")] |
| 11 | use embassy_rp::gpio::OutputOpenDrain; | ||
| 12 | use embassy_rp::gpio::{Flex, Input, Level, Output, Pull}; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 14 | ||
| 10 | #[embassy_executor::main] | 15 | #[embassy_executor::main] |
| @@ -76,6 +81,7 @@ async fn main(_spawner: Spawner) { | |||
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | // Test input pulldown | 83 | // Test input pulldown |
| 84 | #[cfg(feature = "rp2040")] | ||
| 79 | { | 85 | { |
| 80 | let b = Input::new(&mut b, Pull::Down); | 86 | let b = Input::new(&mut b, Pull::Down); |
| 81 | delay(); | 87 | delay(); |
| @@ -104,6 +110,7 @@ async fn main(_spawner: Spawner) { | |||
| 104 | } | 110 | } |
| 105 | 111 | ||
| 106 | // OUTPUT OPEN DRAIN | 112 | // OUTPUT OPEN DRAIN |
| 113 | #[cfg(feature = "rp2040")] | ||
| 107 | { | 114 | { |
| 108 | let mut b = OutputOpenDrain::new(&mut b, Level::High); | 115 | let mut b = OutputOpenDrain::new(&mut b, Level::High); |
| 109 | let mut a = Flex::new(&mut a); | 116 | let mut a = Flex::new(&mut a); |
| @@ -202,6 +209,7 @@ async fn main(_spawner: Spawner) { | |||
| 202 | } | 209 | } |
| 203 | 210 | ||
| 204 | // Test input pulldown | 211 | // Test input pulldown |
| 212 | #[cfg(feature = "rp2040")] | ||
| 205 | { | 213 | { |
| 206 | let mut b = Flex::new(&mut b); | 214 | let mut b = Flex::new(&mut b); |
| 207 | b.set_as_input(); | 215 | b.set_as_input(); |
