diff options
| author | Bailey Townsend <[email protected]> | 2024-12-28 00:07:14 -0600 |
|---|---|---|
| committer | Bailey Townsend <[email protected]> | 2024-12-28 00:07:14 -0600 |
| commit | 8243a8a3892dc499be560a0bf2134e641b856760 (patch) | |
| tree | d7e2d8d7371c4672879a9dfbb1219529d5ea5c29 /examples/rp/src | |
| parent | dd31ffadfbd145f26b6bb54cf2036cb54149aefe (diff) | |
Added new param to examples and created a pico plus 2 w example
Diffstat (limited to 'examples/rp/src')
| -rw-r--r-- | examples/rp/src/bin/wifi_ap_tcp_server.rs | 13 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_blinky.rs | 13 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_scan.rs | 13 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_tcp_server.rs | 13 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_webrequest.rs | 13 |
5 files changed, 55 insertions, 10 deletions
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index 4c9651433..e97ddb4c1 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43_pio::PioSpi; | 10 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; |
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_net::tcp::TcpSocket; | 13 | use embassy_net::tcp::TcpSocket; |
| @@ -57,7 +57,16 @@ async fn main(spawner: Spawner) { | |||
| 57 | let pwr = Output::new(p.PIN_23, Level::Low); | 57 | let pwr = Output::new(p.PIN_23, Level::Low); |
| 58 | let cs = Output::new(p.PIN_25, Level::High); | 58 | let cs = Output::new(p.PIN_25, Level::High); |
| 59 | let mut pio = Pio::new(p.PIO0, Irqs); | 59 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 60 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 60 | let spi = PioSpi::new( |
| 61 | &mut pio.common, | ||
| 62 | pio.sm0, | ||
| 63 | DEFAULT_CLOCK_DIVIDER, | ||
| 64 | pio.irq0, | ||
| 65 | cs, | ||
| 66 | p.PIN_24, | ||
| 67 | p.PIN_29, | ||
| 68 | p.DMA_CH0, | ||
| 69 | ); | ||
| 61 | 70 | ||
| 62 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 71 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 63 | let state = STATE.init(cyw43::State::new()); | 72 | let state = STATE.init(cyw43::State::new()); |
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs index 0107a2326..6e91ce167 100644 --- a/examples/rp/src/bin/wifi_blinky.rs +++ b/examples/rp/src/bin/wifi_blinky.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | 7 | ||
| 8 | use cyw43_pio::PioSpi; | 8 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; |
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::bind_interrupts; | 11 | use embassy_rp::bind_interrupts; |
| @@ -41,7 +41,16 @@ async fn main(spawner: Spawner) { | |||
| 41 | let pwr = Output::new(p.PIN_23, Level::Low); | 41 | let pwr = Output::new(p.PIN_23, Level::Low); |
| 42 | let cs = Output::new(p.PIN_25, Level::High); | 42 | let cs = Output::new(p.PIN_25, Level::High); |
| 43 | let mut pio = Pio::new(p.PIO0, Irqs); | 43 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 44 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 44 | let spi = PioSpi::new( |
| 45 | &mut pio.common, | ||
| 46 | pio.sm0, | ||
| 47 | DEFAULT_CLOCK_DIVIDER, | ||
| 48 | pio.irq0, | ||
| 49 | cs, | ||
| 50 | p.PIN_24, | ||
| 51 | p.PIN_29, | ||
| 52 | p.DMA_CH0, | ||
| 53 | ); | ||
| 45 | 54 | ||
| 46 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 55 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 47 | let state = STATE.init(cyw43::State::new()); | 56 | let state = STATE.init(cyw43::State::new()); |
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs index 2ef899080..fe9c363d9 100644 --- a/examples/rp/src/bin/wifi_scan.rs +++ b/examples/rp/src/bin/wifi_scan.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use core::str; | 8 | use core::str; |
| 9 | 9 | ||
| 10 | use cyw43_pio::PioSpi; | 10 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; |
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_rp::bind_interrupts; | 13 | use embassy_rp::bind_interrupts; |
| @@ -45,7 +45,16 @@ async fn main(spawner: Spawner) { | |||
| 45 | let pwr = Output::new(p.PIN_23, Level::Low); | 45 | let pwr = Output::new(p.PIN_23, Level::Low); |
| 46 | let cs = Output::new(p.PIN_25, Level::High); | 46 | let cs = Output::new(p.PIN_25, Level::High); |
| 47 | let mut pio = Pio::new(p.PIO0, Irqs); | 47 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 48 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 48 | let spi = PioSpi::new( |
| 49 | &mut pio.common, | ||
| 50 | pio.sm0, | ||
| 51 | DEFAULT_CLOCK_DIVIDER, | ||
| 52 | pio.irq0, | ||
| 53 | cs, | ||
| 54 | p.PIN_24, | ||
| 55 | p.PIN_29, | ||
| 56 | p.DMA_CH0, | ||
| 57 | ); | ||
| 49 | 58 | ||
| 50 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 59 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 51 | let state = STATE.init(cyw43::State::new()); | 60 | let state = STATE.init(cyw43::State::new()); |
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 7bf546e01..14dbf4552 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43::JoinOptions; | 10 | use cyw43::JoinOptions; |
| 11 | use cyw43_pio::PioSpi; | 11 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; |
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_net::tcp::TcpSocket; | 14 | use embassy_net::tcp::TcpSocket; |
| @@ -61,7 +61,16 @@ async fn main(spawner: Spawner) { | |||
| 61 | let pwr = Output::new(p.PIN_23, Level::Low); | 61 | let pwr = Output::new(p.PIN_23, Level::Low); |
| 62 | let cs = Output::new(p.PIN_25, Level::High); | 62 | let cs = Output::new(p.PIN_25, Level::High); |
| 63 | let mut pio = Pio::new(p.PIO0, Irqs); | 63 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 64 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 64 | let spi = PioSpi::new( |
| 65 | &mut pio.common, | ||
| 66 | pio.sm0, | ||
| 67 | DEFAULT_CLOCK_DIVIDER, | ||
| 68 | pio.irq0, | ||
| 69 | cs, | ||
| 70 | p.PIN_24, | ||
| 71 | p.PIN_29, | ||
| 72 | p.DMA_CH0, | ||
| 73 | ); | ||
| 65 | 74 | ||
| 66 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 75 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 67 | let state = STATE.init(cyw43::State::new()); | 76 | let state = STATE.init(cyw43::State::new()); |
diff --git a/examples/rp/src/bin/wifi_webrequest.rs b/examples/rp/src/bin/wifi_webrequest.rs index 1ae909917..f1b398b65 100644 --- a/examples/rp/src/bin/wifi_webrequest.rs +++ b/examples/rp/src/bin/wifi_webrequest.rs | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| 9 | 9 | ||
| 10 | use cyw43::JoinOptions; | 10 | use cyw43::JoinOptions; |
| 11 | use cyw43_pio::PioSpi; | 11 | use cyw43_pio::{PioSpi, DEFAULT_CLOCK_DIVIDER}; |
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_net::dns::DnsSocket; | 14 | use embassy_net::dns::DnsSocket; |
| @@ -63,7 +63,16 @@ async fn main(spawner: Spawner) { | |||
| 63 | let pwr = Output::new(p.PIN_23, Level::Low); | 63 | let pwr = Output::new(p.PIN_23, Level::Low); |
| 64 | let cs = Output::new(p.PIN_25, Level::High); | 64 | let cs = Output::new(p.PIN_25, Level::High); |
| 65 | let mut pio = Pio::new(p.PIO0, Irqs); | 65 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 66 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 66 | let spi = PioSpi::new( |
| 67 | &mut pio.common, | ||
| 68 | pio.sm0, | ||
| 69 | DEFAULT_CLOCK_DIVIDER, | ||
| 70 | pio.irq0, | ||
| 71 | cs, | ||
| 72 | p.PIN_24, | ||
| 73 | p.PIN_29, | ||
| 74 | p.DMA_CH0, | ||
| 75 | ); | ||
| 67 | 76 | ||
| 68 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 77 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 69 | let state = STATE.init(cyw43::State::new()); | 78 | let state = STATE.init(cyw43::State::new()); |
