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