diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-08-15 21:15:52 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-15 21:15:52 +0000 |
| commit | ffe96889525105ac37cb74add67ac73f148726f6 (patch) | |
| tree | 19eda8e5e80a5d19e966ac108cedaf51795cb348 /examples | |
| parent | 96e0ace89e48cffd073749cc3b08835a0a7d6cc9 (diff) | |
| parent | 11b66a73b4fc85469eeb8f718531492aed128e26 (diff) | |
Merge pull request #1525 from embassy-rs/w5100s
wip: w5100s
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_multisocket.rs | 6 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_client.rs | 6 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_server.rs | 7 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_udp.rs | 7 |
5 files changed, 19 insertions, 9 deletions
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index d83e370df..6742ce7ef 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -13,7 +13,7 @@ embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["ni | |||
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
| 16 | embassy-net-w5500 = { version = "0.1.0", path = "../../embassy-net-w5500", features = ["defmt"] } | 16 | embassy-net-wiznet = { version = "0.1.0", path = "../../embassy-net-wiznet", features = ["defmt"] } |
| 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 18 | embassy-usb-logger = { version = "0.1.0", path = "../../embassy-usb-logger" } | 18 | embassy-usb-logger = { version = "0.1.0", path = "../../embassy-usb-logger" } |
| 19 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"] } | 19 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"] } |
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index 9f800d0d9..d4af87642 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -10,7 +10,8 @@ use defmt::*; | |||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_futures::yield_now; | 11 | use embassy_futures::yield_now; |
| 12 | use embassy_net::{Stack, StackResources}; | 12 | use embassy_net::{Stack, StackResources}; |
| 13 | use embassy_net_w5500::*; | 13 | use embassy_net_wiznet::chip::W5500; |
| 14 | use embassy_net_wiznet::*; | ||
| 14 | use embassy_rp::clocks::RoscRng; | 15 | use embassy_rp::clocks::RoscRng; |
| 15 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 16 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| @@ -26,6 +27,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 26 | async fn ethernet_task( | 27 | async fn ethernet_task( |
| 27 | runner: Runner< | 28 | runner: Runner< |
| 28 | 'static, | 29 | 'static, |
| 30 | W5500, | ||
| 29 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 30 | Input<'static, PIN_21>, | 32 | Input<'static, PIN_21>, |
| 31 | Output<'static, PIN_20>, | 33 | Output<'static, PIN_20>, |
| @@ -54,7 +56,7 @@ async fn main(spawner: Spawner) { | |||
| 54 | 56 | ||
| 55 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 56 | let state = make_static!(State::<8, 8>::new()); | 58 | let state = make_static!(State::<8, 8>::new()); |
| 57 | let (device, runner) = embassy_net_w5500::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 58 | mac_addr, | 60 | mac_addr, |
| 59 | state, | 61 | state, |
| 60 | ExclusiveDevice::new(spi, cs, Delay), | 62 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index fee84b613..78340492e 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -12,7 +12,8 @@ use defmt::*; | |||
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_futures::yield_now; | 13 | use embassy_futures::yield_now; |
| 14 | use embassy_net::{Stack, StackResources}; | 14 | use embassy_net::{Stack, StackResources}; |
| 15 | use embassy_net_w5500::*; | 15 | use embassy_net_wiznet::chip::W5500; |
| 16 | use embassy_net_wiznet::*; | ||
| 16 | use embassy_rp::clocks::RoscRng; | 17 | use embassy_rp::clocks::RoscRng; |
| 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 18 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 19 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| @@ -28,6 +29,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 28 | async fn ethernet_task( | 29 | async fn ethernet_task( |
| 29 | runner: Runner< | 30 | runner: Runner< |
| 30 | 'static, | 31 | 'static, |
| 32 | W5500, | ||
| 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 33 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 32 | Input<'static, PIN_21>, | 34 | Input<'static, PIN_21>, |
| 33 | Output<'static, PIN_20>, | 35 | Output<'static, PIN_20>, |
| @@ -57,7 +59,7 @@ async fn main(spawner: Spawner) { | |||
| 57 | 59 | ||
| 58 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 60 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 59 | let state = make_static!(State::<8, 8>::new()); | 61 | let state = make_static!(State::<8, 8>::new()); |
| 60 | let (device, runner) = embassy_net_w5500::new( | 62 | let (device, runner) = embassy_net_wiznet::new( |
| 61 | mac_addr, | 63 | mac_addr, |
| 62 | state, | 64 | state, |
| 63 | ExclusiveDevice::new(spi, cs, Delay), | 65 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 024574267..e6d132740 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -11,7 +11,8 @@ use defmt::*; | |||
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_futures::yield_now; | 12 | use embassy_futures::yield_now; |
| 13 | use embassy_net::{Stack, StackResources}; | 13 | use embassy_net::{Stack, StackResources}; |
| 14 | use embassy_net_w5500::*; | 14 | use embassy_net_wiznet::chip::W5500; |
| 15 | use embassy_net_wiznet::*; | ||
| 15 | use embassy_rp::clocks::RoscRng; | 16 | use embassy_rp::clocks::RoscRng; |
| 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| @@ -22,10 +23,12 @@ use embedded_io_async::Write; | |||
| 22 | use rand::RngCore; | 23 | use rand::RngCore; |
| 23 | use static_cell::make_static; | 24 | use static_cell::make_static; |
| 24 | use {defmt_rtt as _, panic_probe as _}; | 25 | use {defmt_rtt as _, panic_probe as _}; |
| 26 | |||
| 25 | #[embassy_executor::task] | 27 | #[embassy_executor::task] |
| 26 | async fn ethernet_task( | 28 | async fn ethernet_task( |
| 27 | runner: Runner< | 29 | runner: Runner< |
| 28 | 'static, | 30 | 'static, |
| 31 | W5500, | ||
| 29 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 32 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 30 | Input<'static, PIN_21>, | 33 | Input<'static, PIN_21>, |
| 31 | Output<'static, PIN_20>, | 34 | Output<'static, PIN_20>, |
| @@ -55,7 +58,7 @@ async fn main(spawner: Spawner) { | |||
| 55 | 58 | ||
| 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 59 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 57 | let state = make_static!(State::<8, 8>::new()); | 60 | let state = make_static!(State::<8, 8>::new()); |
| 58 | let (device, runner) = embassy_net_w5500::new( | 61 | let (device, runner) = embassy_net_wiznet::new( |
| 59 | mac_addr, | 62 | mac_addr, |
| 60 | state, | 63 | state, |
| 61 | ExclusiveDevice::new(spi, cs, Delay), | 64 | ExclusiveDevice::new(spi, cs, Delay), |
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index 038432b17..b546714df 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -11,7 +11,8 @@ use embassy_executor::Spawner; | |||
| 11 | use embassy_futures::yield_now; | 11 | use embassy_futures::yield_now; |
| 12 | use embassy_net::udp::{PacketMetadata, UdpSocket}; | 12 | use embassy_net::udp::{PacketMetadata, UdpSocket}; |
| 13 | use embassy_net::{Stack, StackResources}; | 13 | use embassy_net::{Stack, StackResources}; |
| 14 | use embassy_net_w5500::*; | 14 | use embassy_net_wiznet::chip::W5500; |
| 15 | use embassy_net_wiznet::*; | ||
| 15 | use embassy_rp::clocks::RoscRng; | 16 | use embassy_rp::clocks::RoscRng; |
| 16 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 17 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 17 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 18 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| @@ -21,10 +22,12 @@ use embedded_hal_async::spi::ExclusiveDevice; | |||
| 21 | use rand::RngCore; | 22 | use rand::RngCore; |
| 22 | use static_cell::make_static; | 23 | use static_cell::make_static; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 24 | use {defmt_rtt as _, panic_probe as _}; |
| 25 | |||
| 24 | #[embassy_executor::task] | 26 | #[embassy_executor::task] |
| 25 | async fn ethernet_task( | 27 | async fn ethernet_task( |
| 26 | runner: Runner< | 28 | runner: Runner< |
| 27 | 'static, | 29 | 'static, |
| 30 | W5500, | ||
| 28 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, | 31 | ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>, |
| 29 | Input<'static, PIN_21>, | 32 | Input<'static, PIN_21>, |
| 30 | Output<'static, PIN_20>, | 33 | Output<'static, PIN_20>, |
| @@ -53,7 +56,7 @@ async fn main(spawner: Spawner) { | |||
| 53 | 56 | ||
| 54 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 55 | let state = make_static!(State::<8, 8>::new()); | 58 | let state = make_static!(State::<8, 8>::new()); |
| 56 | let (device, runner) = embassy_net_w5500::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 57 | mac_addr, | 60 | mac_addr, |
| 58 | state, | 61 | state, |
| 59 | ExclusiveDevice::new(spi, cs, Delay), | 62 | ExclusiveDevice::new(spi, cs, Delay), |
