diff options
Diffstat (limited to 'examples/rp/src/bin/ethernet_w5500_multisocket.rs')
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_multisocket.rs | 14 |
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; | |||
| 15 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 15 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 16 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; | 16 | use embassy_rp::peripherals::{PIN_17, PIN_20, PIN_21, SPI0}; |
| 17 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | 17 | use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; |
| 18 | use embassy_time::Duration; | 18 | use embassy_time::{Delay, Duration}; |
| 19 | use embedded_hal_async::spi::ExclusiveDevice; | 19 | use embedded_hal_async::spi::ExclusiveDevice; |
| 20 | use embedded_io::asynch::Write; | 20 | use embedded_io::asynch::Write; |
| 21 | use rand::RngCore; | 21 | use rand::RngCore; |
| @@ -26,7 +26,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 26 | async fn ethernet_task( | 26 | async 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 |
