diff options
Diffstat (limited to 'examples/rp/src/bin/ethernet_w5500_tcp_server.rs')
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_server.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 7f521cdb4..db21c2b6f 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -16,7 +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::Duration; | 19 | use embassy_time::{Delay, Duration}; |
| 20 | use embedded_hal_async::spi::ExclusiveDevice; | 20 | use embedded_hal_async::spi::ExclusiveDevice; |
| 21 | use embedded_io::asynch::Write; | 21 | use embedded_io::asynch::Write; |
| 22 | use rand::RngCore; | 22 | 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 | >, |
| @@ -55,8 +55,14 @@ async fn main(spawner: Spawner) { | |||
| 55 | 55 | ||
| 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 57 | let state = make_static!(State::<8, 8>::new()); | 57 | let state = make_static!(State::<8, 8>::new()); |
| 58 | let (device, runner) = | 58 | let (device, runner) = embassy_net_w5500::new( |
| 59 | embassy_net_w5500::new(mac_addr, state, ExclusiveDevice::new(spi, cs), w5500_int, w5500_reset).await; | 59 | mac_addr, |
| 60 | state, | ||
| 61 | ExclusiveDevice::new(spi, cs, Delay), | ||
| 62 | w5500_int, | ||
| 63 | w5500_reset, | ||
| 64 | ) | ||
| 65 | .await; | ||
| 60 | unwrap!(spawner.spawn(ethernet_task(runner))); | 66 | unwrap!(spawner.spawn(ethernet_task(runner))); |
| 61 | 67 | ||
| 62 | // Generate random seed | 68 | // Generate random seed |
