aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src/bin/ethernet_w5500_udp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rp/src/bin/ethernet_w5500_udp.rs')
-rw-r--r--examples/rp/src/bin/ethernet_w5500_udp.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs
index ada86ae55..038432b17 100644
--- a/examples/rp/src/bin/ethernet_w5500_udp.rs
+++ b/examples/rp/src/bin/ethernet_w5500_udp.rs
@@ -16,6 +16,7 @@ use 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::{PIN_17, PIN_20, PIN_21, SPI0};
18use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; 18use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
19use embassy_time::Delay;
19use embedded_hal_async::spi::ExclusiveDevice; 20use embedded_hal_async::spi::ExclusiveDevice;
20use rand::RngCore; 21use rand::RngCore;
21use static_cell::make_static; 22use static_cell::make_static;
@@ -24,7 +25,7 @@ use {defmt_rtt as _, panic_probe as _};
24async fn ethernet_task( 25async fn ethernet_task(
25 runner: Runner< 26 runner: Runner<
26 'static, 27 'static,
27 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>>, 28 ExclusiveDevice<Spi<'static, SPI0, Async>, Output<'static, PIN_17>, Delay>,
28 Input<'static, PIN_21>, 29 Input<'static, PIN_21>,
29 Output<'static, PIN_20>, 30 Output<'static, PIN_20>,
30 >, 31 >,
@@ -52,8 +53,14 @@ async fn main(spawner: Spawner) {
52 53
53 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 54 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
54 let state = make_static!(State::<8, 8>::new()); 55 let state = make_static!(State::<8, 8>::new());
55 let (device, runner) = 56 let (device, runner) = embassy_net_w5500::new(
56 embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await; 57 mac_addr,
58 state,
59 ExclusiveDevice::new(spi, cs, Delay),
60 w5500_int,
61 w5500_reset,
62 )
63 .await;
57 unwrap!(spawner.spawn(ethernet_task(runner))); 64 unwrap!(spawner.spawn(ethernet_task(runner)));
58 65
59 // Generate random seed 66 // Generate random seed