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