aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/rpi-pico-w/Cargo.toml18
-rw-r--r--examples/rpi-pico-w/src/bin/tcp_server.rs16
-rw-r--r--examples/rpi-pico-w/src/bin/tcp_server_ap.rs16
-rw-r--r--examples/rpi-pico-w/src/bin/wifi_scan.rs16
4 files changed, 24 insertions, 42 deletions
diff --git a/examples/rpi-pico-w/Cargo.toml b/examples/rpi-pico-w/Cargo.toml
index 5b46726d2..d972bf5a5 100644
--- a/examples/rpi-pico-w/Cargo.toml
+++ b/examples/rpi-pico-w/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2021"
7[dependencies] 7[dependencies]
8cyw43 = { path = "../../", features = ["defmt", "firmware-logs"] } 8cyw43 = { path = "../../", features = ["defmt", "firmware-logs"] }
9cyw43-pio = { path = "../../cyw43-pio", features = ["defmt"] } 9cyw43-pio = { path = "../../cyw43-pio", features = ["defmt"] }
10embassy-executor = { version = "0.1.0", features = ["defmt", "integrated-timers", "executor-thread", "arch-cortex-m"] } 10embassy-executor = { version = "0.2.0", features = ["defmt", "integrated-timers", "executor-thread", "arch-cortex-m"] }
11embassy-time = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] } 11embassy-time = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] }
12embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] } 12embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] }
13embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "nightly"] } 13embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "nightly"] }
@@ -27,14 +27,14 @@ heapless = "0.7.15"
27 27
28 28
29[patch.crates-io] 29[patch.crates-io]
30embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 30embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
31embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 31embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
32embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 32embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
33embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 33embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
34embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 34embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
35embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 35embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
36embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 36embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
37embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "03d6363d5af5dcaf21b52734994a466ca593d2b6" } 37embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "82f7e104d90a6628d1873017ea5ef6a7afb3b3f7" }
38 38
39[profile.dev] 39[profile.dev]
40debug = 2 40debug = 2
diff --git a/examples/rpi-pico-w/src/bin/tcp_server.rs b/examples/rpi-pico-w/src/bin/tcp_server.rs
index 9581602a7..8accc469f 100644
--- a/examples/rpi-pico-w/src/bin/tcp_server.rs
+++ b/examples/rpi-pico-w/src/bin/tcp_server.rs
@@ -12,8 +12,8 @@ use embassy_executor::Spawner;
12use embassy_net::tcp::TcpSocket; 12use embassy_net::tcp::TcpSocket;
13use embassy_net::{Config, Stack, StackResources}; 13use embassy_net::{Config, Stack, StackResources};
14use embassy_rp::gpio::{Level, Output}; 14use embassy_rp::gpio::{Level, Output};
15use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25}; 15use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
16use embassy_rp::pio::{Pio0, PioPeripheral, PioStateMachineInstance, Sm0}; 16use embassy_rp::pio::Pio;
17use embedded_io::asynch::Write; 17use embedded_io::asynch::Write;
18use static_cell::StaticCell; 18use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
@@ -28,11 +28,7 @@ macro_rules! singleton {
28 28
29#[embassy_executor::task] 29#[embassy_executor::task]
30async fn wifi_task( 30async fn wifi_task(
31 runner: cyw43::Runner< 31 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
32 'static,
33 Output<'static, PIN_23>,
34 PioSpi<PIN_25, PioStateMachineInstance<Pio0, Sm0>, DMA_CH0>,
35 >,
36) -> ! { 32) -> ! {
37 runner.run().await 33 runner.run().await
38} 34}
@@ -60,10 +56,8 @@ async fn main(spawner: Spawner) {
60 56
61 let pwr = Output::new(p.PIN_23, Level::Low); 57 let pwr = Output::new(p.PIN_23, Level::Low);
62 let cs = Output::new(p.PIN_25, Level::High); 58 let cs = Output::new(p.PIN_25, Level::High);
63 59 let mut pio = Pio::new(p.PIO0);
64 let (_, sm, _, _, _) = p.PIO0.split(); 60 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
65 let dma = p.DMA_CH0;
66 let spi = PioSpi::new(sm, cs, p.PIN_24, p.PIN_29, dma);
67 61
68 let state = singleton!(cyw43::State::new()); 62 let state = singleton!(cyw43::State::new());
69 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 63 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
diff --git a/examples/rpi-pico-w/src/bin/tcp_server_ap.rs b/examples/rpi-pico-w/src/bin/tcp_server_ap.rs
index e43412625..ee2c32379 100644
--- a/examples/rpi-pico-w/src/bin/tcp_server_ap.rs
+++ b/examples/rpi-pico-w/src/bin/tcp_server_ap.rs
@@ -12,8 +12,8 @@ use embassy_executor::Spawner;
12use embassy_net::tcp::TcpSocket; 12use embassy_net::tcp::TcpSocket;
13use embassy_net::{Config, Stack, StackResources}; 13use embassy_net::{Config, Stack, StackResources};
14use embassy_rp::gpio::{Level, Output}; 14use embassy_rp::gpio::{Level, Output};
15use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25}; 15use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
16use embassy_rp::pio::{Pio0, PioPeripheral, PioStateMachineInstance, Sm0}; 16use embassy_rp::pio::Pio;
17use embedded_io::asynch::Write; 17use embedded_io::asynch::Write;
18use static_cell::StaticCell; 18use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
@@ -28,11 +28,7 @@ macro_rules! singleton {
28 28
29#[embassy_executor::task] 29#[embassy_executor::task]
30async fn wifi_task( 30async fn wifi_task(
31 runner: cyw43::Runner< 31 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
32 'static,
33 Output<'static, PIN_23>,
34 PioSpi<PIN_25, PioStateMachineInstance<Pio0, Sm0>, DMA_CH0>,
35 >,
36) -> ! { 32) -> ! {
37 runner.run().await 33 runner.run().await
38} 34}
@@ -60,10 +56,8 @@ async fn main(spawner: Spawner) {
60 56
61 let pwr = Output::new(p.PIN_23, Level::Low); 57 let pwr = Output::new(p.PIN_23, Level::Low);
62 let cs = Output::new(p.PIN_25, Level::High); 58 let cs = Output::new(p.PIN_25, Level::High);
63 59 let mut pio = Pio::new(p.PIO0);
64 let (_, sm, _, _, _) = p.PIO0.split(); 60 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
65 let dma = p.DMA_CH0;
66 let spi = PioSpi::new(sm, cs, p.PIN_24, p.PIN_29, dma);
67 61
68 let state = singleton!(cyw43::State::new()); 62 let state = singleton!(cyw43::State::new());
69 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 63 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
diff --git a/examples/rpi-pico-w/src/bin/wifi_scan.rs b/examples/rpi-pico-w/src/bin/wifi_scan.rs
index da8fadfd8..a2a44f99d 100644
--- a/examples/rpi-pico-w/src/bin/wifi_scan.rs
+++ b/examples/rpi-pico-w/src/bin/wifi_scan.rs
@@ -11,8 +11,8 @@ use defmt::*;
11use embassy_executor::Spawner; 11use embassy_executor::Spawner;
12use embassy_net::Stack; 12use embassy_net::Stack;
13use embassy_rp::gpio::{Level, Output}; 13use embassy_rp::gpio::{Level, Output};
14use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25}; 14use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
15use embassy_rp::pio::{Pio0, PioPeripheral, PioStateMachineInstance, Sm0}; 15use embassy_rp::pio::Pio;
16use static_cell::StaticCell; 16use static_cell::StaticCell;
17use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
18 18
@@ -26,11 +26,7 @@ macro_rules! singleton {
26 26
27#[embassy_executor::task] 27#[embassy_executor::task]
28async fn wifi_task( 28async fn wifi_task(
29 runner: cyw43::Runner< 29 runner: cyw43::Runner<'static, Output<'static, PIN_23>, PioSpi<'static, PIN_25, PIO0, 0, DMA_CH0>>,
30 'static,
31 Output<'static, PIN_23>,
32 PioSpi<PIN_25, PioStateMachineInstance<Pio0, Sm0>, DMA_CH0>,
33 >,
34) -> ! { 30) -> ! {
35 runner.run().await 31 runner.run().await
36} 32}
@@ -58,10 +54,8 @@ async fn main(spawner: Spawner) {
58 54
59 let pwr = Output::new(p.PIN_23, Level::Low); 55 let pwr = Output::new(p.PIN_23, Level::Low);
60 let cs = Output::new(p.PIN_25, Level::High); 56 let cs = Output::new(p.PIN_25, Level::High);
61 57 let mut pio = Pio::new(p.PIO0);
62 let (_, sm, _, _, _) = p.PIO0.split(); 58 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
63 let dma = p.DMA_CH0;
64 let spi = PioSpi::new(sm, cs, p.PIN_24, p.PIN_29, dma);
65 59
66 let state = singleton!(cyw43::State::new()); 60 let state = singleton!(cyw43::State::new());
67 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 61 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;