aboutsummaryrefslogtreecommitdiff
path: root/examples/rp
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-01-22 21:30:29 +0100
committerDario Nieuwenhuis <[email protected]>2024-01-22 21:32:10 +0100
commitee0ebe3121e5d51240e671d8c5cc19ad878b9db9 (patch)
treecaabf0c20ce7d2d07e292690b1afb9baa606610f /examples/rp
parent2bc5e9523d4373002487614ecfef1e3f0858fd66 (diff)
rp/gpio: remove generics.
Diffstat (limited to 'examples/rp')
-rw-r--r--examples/rp/src/bin/blinky_two_tasks.rs2
-rw-r--r--examples/rp/src/bin/ethernet_w5500_multisocket.rs8
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_client.rs8
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_server.rs8
-rw-r--r--examples/rp/src/bin/ethernet_w5500_udp.rs8
-rw-r--r--examples/rp/src/bin/multicore.rs3
-rw-r--r--examples/rp/src/bin/wifi_ap_tcp_server.rs6
-rw-r--r--examples/rp/src/bin/wifi_blinky.rs6
-rw-r--r--examples/rp/src/bin/wifi_scan.rs6
-rw-r--r--examples/rp/src/bin/wifi_tcp_server.rs6
10 files changed, 26 insertions, 35 deletions
diff --git a/examples/rp/src/bin/blinky_two_tasks.rs b/examples/rp/src/bin/blinky_two_tasks.rs
index a03f3a592..a57b513d6 100644
--- a/examples/rp/src/bin/blinky_two_tasks.rs
+++ b/examples/rp/src/bin/blinky_two_tasks.rs
@@ -14,7 +14,7 @@ use embassy_time::{Duration, Ticker};
14use gpio::{AnyPin, Level, Output}; 14use gpio::{AnyPin, Level, Output};
15use {defmt_rtt as _, panic_probe as _}; 15use {defmt_rtt as _, panic_probe as _};
16 16
17type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static, AnyPin>>>; 17type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>;
18static LED: LedType = Mutex::new(None); 18static LED: LedType = Mutex::new(None);
19 19
20#[embassy_executor::main] 20#[embassy_executor::main]
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
index a16ea0007..bd52cadca 100644
--- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs
+++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
@@ -13,7 +13,7 @@ use embassy_net_wiznet::chip::W5500;
13use embassy_net_wiznet::*; 13use embassy_net_wiznet::*;
14use embassy_rp::clocks::RoscRng; 14use embassy_rp::clocks::RoscRng;
15use embassy_rp::gpio::{Input, Level, Output, Pull}; 15use embassy_rp::gpio::{Input, Level, Output, Pull};
16use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; 16use embassy_rp::peripherals::SPI0;
17use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; 17use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
18use embassy_time::{Delay, Duration}; 18use embassy_time::{Delay, Duration};
19use embedded_hal_bus::spi::ExclusiveDevice; 19use embedded_hal_bus::spi::ExclusiveDevice;
@@ -27,9 +27,9 @@ async fn ethernet_task(
27 runner: Runner< 27 runner: Runner<
28 'static, 28 'static,
29 W5500, 29 W5500,
30 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, 30 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static>, Delay>,
31 Input<'static, PIN_21>, 31 Input<'static>,
32 Output<'static, PIN_20>, 32 Output<'static>,
33 >, 33 >,
34) -> ! { 34) -> ! {
35 runner.run().await 35 runner.run().await
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
index 975b3d385..3e4fbd2e6 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
@@ -15,7 +15,7 @@ use embassy_net_wiznet::chip::W5500;
15use embassy_net_wiznet::*; 15use embassy_net_wiznet::*;
16use embassy_rp::clocks::RoscRng; 16use embassy_rp::clocks::RoscRng;
17use embassy_rp::gpio::{Input, Level, Output, Pull}; 17use embassy_rp::gpio::{Input, Level, Output, Pull};
18use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; 18use embassy_rp::peripherals::SPI0;
19use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; 19use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
20use embassy_time::{Delay, Duration, Timer}; 20use embassy_time::{Delay, Duration, Timer};
21use embedded_hal_bus::spi::ExclusiveDevice; 21use embedded_hal_bus::spi::ExclusiveDevice;
@@ -29,9 +29,9 @@ async fn ethernet_task(
29 runner: Runner< 29 runner: Runner<
30 'static, 30 'static,
31 W5500, 31 W5500,
32 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, 32 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static>, Delay>,
33 Input<'static, PIN_21>, 33 Input<'static>,
34 Output<'static, PIN_20>, 34 Output<'static>,
35 >, 35 >,
36) -> ! { 36) -> ! {
37 runner.run().await 37 runner.run().await
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
index 489af2c76..5532851f3 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
@@ -14,7 +14,7 @@ use embassy_net_wiznet::chip::W5500;
14use embassy_net_wiznet::*; 14use embassy_net_wiznet::*;
15use embassy_rp::clocks::RoscRng; 15use embassy_rp::clocks::RoscRng;
16use embassy_rp::gpio::{Input, Level, Output, Pull}; 16use embassy_rp::gpio::{Input, Level, Output, Pull};
17use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; 17use embassy_rp::peripherals::SPI0;
18use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; 18use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
19use embassy_time::{Delay, Duration}; 19use embassy_time::{Delay, Duration};
20use embedded_hal_bus::spi::ExclusiveDevice; 20use embedded_hal_bus::spi::ExclusiveDevice;
@@ -28,9 +28,9 @@ async fn ethernet_task(
28 runner: Runner< 28 runner: Runner<
29 'static, 29 'static,
30 W5500, 30 W5500,
31 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, 31 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static>, Delay>,
32 Input<'static, PIN_21>, 32 Input<'static>,
33 Output<'static, PIN_20>, 33 Output<'static>,
34 >, 34 >,
35) -> ! { 35) -> ! {
36 runner.run().await 36 runner.run().await
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs
index 41bd7d077..adb1d8941 100644
--- a/examples/rp/src/bin/ethernet_w5500_udp.rs
+++ b/examples/rp/src/bin/ethernet_w5500_udp.rs
@@ -14,7 +14,7 @@ use embassy_net_wiznet::chip::W5500;
14use embassy_net_wiznet::*; 14use embassy_net_wiznet::*;
15use embassy_rp::clocks::RoscRng; 15use embassy_rp::clocks::RoscRng;
16use embassy_rp::gpio::{Input, Level, Output, Pull}; 16use embassy_rp::gpio::{Input, Level, Output, Pull};
17use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; 17use embassy_rp::peripherals::SPI0;
18use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; 18use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
19use embassy_time::Delay; 19use embassy_time::Delay;
20use embedded_hal_bus::spi::ExclusiveDevice; 20use embedded_hal_bus::spi::ExclusiveDevice;
@@ -27,9 +27,9 @@ async fn ethernet_task(
27 runner: Runner< 27 runner: Runner<
28 'static, 28 'static,
29 W5500, 29 W5500,
30 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, 30 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static>, Delay>,
31 Input<'static, PIN_21>, 31 Input<'static>,
32 Output<'static, PIN_20>, 32 Output<'static>,
33 >, 33 >,
34) -> ! { 34) -> ! {
35 runner.run().await 35 runner.run().await
diff --git a/examples/rp/src/bin/multicore.rs b/examples/rp/src/bin/multicore.rs
index a1678d99a..c7b087476 100644
--- a/examples/rp/src/bin/multicore.rs
+++ b/examples/rp/src/bin/multicore.rs
@@ -9,7 +9,6 @@ use defmt::*;
9use embassy_executor::Executor; 9use embassy_executor::Executor;
10use embassy_rp::gpio::{Level, Output}; 10use embassy_rp::gpio::{Level, Output};
11use embassy_rp::multicore::{spawn_core1, Stack}; 11use embassy_rp::multicore::{spawn_core1, Stack};
12use embassy_rp::peripherals::PIN_25;
13use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; 12use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
14use embassy_sync::channel::Channel; 13use embassy_sync::channel::Channel;
15use embassy_time::Timer; 14use embassy_time::Timer;
@@ -52,7 +51,7 @@ async fn core0_task() {
52} 51}
53 52
54#[embassy_executor::task] 53#[embassy_executor::task]
55async fn core1_task(mut led: Output<'static, PIN_25>) { 54async fn core1_task(mut led: Output<'static>) {
56 info!("Hello from core 1"); 55 info!("Hello from core 1");
57 loop { 56 loop {
58 match CHANNEL.receive().await { 57 match CHANNEL.receive().await {
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs
index 1bd75607e..b60852359 100644
--- a/examples/rp/src/bin/wifi_ap_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs
@@ -14,7 +14,7 @@ use embassy_net::tcp::TcpSocket;
14use embassy_net::{Config, Stack, StackResources}; 14use embassy_net::{Config, Stack, StackResources};
15use embassy_rp::bind_interrupts; 15use embassy_rp::bind_interrupts;
16use embassy_rp::gpio::{Level, Output}; 16use embassy_rp::gpio::{Level, Output};
17use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 17use embassy_rp::peripherals::{DMA_CH0, PIO0};
18use embassy_rp::pio::{InterruptHandler, Pio}; 18use embassy_rp::pio::{InterruptHandler, Pio};
19use embassy_time::Duration; 19use embassy_time::Duration;
20use embedded_io_async::Write; 20use embedded_io_async::Write;
@@ -26,9 +26,7 @@ bind_interrupts!(struct Irqs {
26}); 26});
27 27
28#[embassy_executor::task] 28#[embassy_executor::task]
29async fn wifi_task( 29async fn wifi_task(runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>) -> ! {
30 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
31) -> ! {
32 runner.run().await 30 runner.run().await
33} 31}
34 32
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs
index 1ed74993c..18eefe41f 100644
--- a/examples/rp/src/bin/wifi_blinky.rs
+++ b/examples/rp/src/bin/wifi_blinky.rs
@@ -10,7 +10,7 @@ use defmt::*;
10use embassy_executor::Spawner; 10use embassy_executor::Spawner;
11use embassy_rp::bind_interrupts; 11use embassy_rp::bind_interrupts;
12use embassy_rp::gpio::{Level, Output}; 12use embassy_rp::gpio::{Level, Output};
13use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 13use embassy_rp::peripherals::{DMA_CH0, PIO0};
14use embassy_rp::pio::{InterruptHandler, Pio}; 14use embassy_rp::pio::{InterruptHandler, Pio};
15use embassy_time::{Duration, Timer}; 15use embassy_time::{Duration, Timer};
16use static_cell::StaticCell; 16use static_cell::StaticCell;
@@ -21,9 +21,7 @@ bind_interrupts!(struct Irqs {
21}); 21});
22 22
23#[embassy_executor::task] 23#[embassy_executor::task]
24async fn wifi_task( 24async fn wifi_task(runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>) -> ! {
25 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
26) -> ! {
27 runner.run().await 25 runner.run().await
28} 26}
29 27
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs
index e678209dd..e0f85a6b0 100644
--- a/examples/rp/src/bin/wifi_scan.rs
+++ b/examples/rp/src/bin/wifi_scan.rs
@@ -13,7 +13,7 @@ use embassy_executor::Spawner;
13use embassy_net::Stack; 13use embassy_net::Stack;
14use embassy_rp::bind_interrupts; 14use embassy_rp::bind_interrupts;
15use embassy_rp::gpio::{Level, Output}; 15use embassy_rp::gpio::{Level, Output};
16use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 16use embassy_rp::peripherals::{DMA_CH0, PIO0};
17use embassy_rp::pio::{InterruptHandler, Pio}; 17use embassy_rp::pio::{InterruptHandler, Pio};
18use static_cell::StaticCell; 18use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
@@ -23,9 +23,7 @@ bind_interrupts!(struct Irqs {
23}); 23});
24 24
25#[embassy_executor::task] 25#[embassy_executor::task]
26async fn wifi_task( 26async fn wifi_task(runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>) -> ! {
27 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
28) -> ! {
29 runner.run().await 27 runner.run().await
30} 28}
31 29
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs
index c346f1ded..f1afc4a00 100644
--- a/examples/rp/src/bin/wifi_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_tcp_server.rs
@@ -14,7 +14,7 @@ use embassy_net::tcp::TcpSocket;
14use embassy_net::{Config, Stack, StackResources}; 14use embassy_net::{Config, Stack, StackResources};
15use embassy_rp::bind_interrupts; 15use embassy_rp::bind_interrupts;
16use embassy_rp::gpio::{Level, Output}; 16use embassy_rp::gpio::{Level, Output};
17use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 17use embassy_rp::peripherals::{DMA_CH0, PIO0};
18use embassy_rp::pio::{InterruptHandler, Pio}; 18use embassy_rp::pio::{InterruptHandler, Pio};
19use embassy_time::{Duration, Timer}; 19use embassy_time::{Duration, Timer};
20use embedded_io_async::Write; 20use embedded_io_async::Write;
@@ -29,9 +29,7 @@ const WIFI_NETWORK: &str = "EmbassyTest";
29const WIFI_PASSWORD: &str = "V8YxhKt5CdIAJFud"; 29const WIFI_PASSWORD: &str = "V8YxhKt5CdIAJFud";
30 30
31#[embassy_executor::task] 31#[embassy_executor::task]
32async fn wifi_task( 32async fn wifi_task(runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>) -> ! {
33 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
34) -> ! {
35 runner.run().await 33 runner.run().await
36} 34}
37 35