aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/eth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32h7/src/bin/eth.rs')
-rw-r--r--examples/stm32h7/src/bin/eth.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index 6c215362d..09915799b 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -5,10 +5,10 @@ use defmt::*;
5use embassy_executor::Spawner; 5use embassy_executor::Spawner;
6use embassy_net::tcp::TcpSocket; 6use embassy_net::tcp::TcpSocket;
7use embassy_net::{Ipv4Address, StackResources}; 7use embassy_net::{Ipv4Address, StackResources};
8use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; 8use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, Sma};
9use embassy_stm32::peripherals::ETH; 9use embassy_stm32::peripherals::{ETH, ETH_SMA};
10use embassy_stm32::rng::Rng; 10use embassy_stm32::rng::Rng;
11use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; 11use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng};
12use embassy_time::Timer; 12use embassy_time::Timer;
13use embedded_io_async::Write; 13use embedded_io_async::Write;
14use static_cell::StaticCell; 14use static_cell::StaticCell;
@@ -19,7 +19,7 @@ bind_interrupts!(struct Irqs {
19 RNG => rng::InterruptHandler<peripherals::RNG>; 19 RNG => rng::InterruptHandler<peripherals::RNG>;
20}); 20});
21 21
22type Device = Ethernet<'static, ETH, GenericPhy>; 22type Device = Ethernet<'static, ETH, GenericPhy<Sma<'static, ETH_SMA>>>;
23 23
24#[embassy_executor::task] 24#[embassy_executor::task]
25async fn net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! { 25async fn net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! {
@@ -69,16 +69,16 @@ async fn main(spawner: Spawner) -> ! {
69 p.ETH, 69 p.ETH,
70 Irqs, 70 Irqs,
71 p.PA1, // ref_clk 71 p.PA1, // ref_clk
72 p.PA2, // mdio
73 p.PC1, // eth_mdc
74 p.PA7, // CRS_DV: Carrier Sense 72 p.PA7, // CRS_DV: Carrier Sense
75 p.PC4, // RX_D0: Received Bit 0 73 p.PC4, // RX_D0: Received Bit 0
76 p.PC5, // RX_D1: Received Bit 1 74 p.PC5, // RX_D1: Received Bit 1
77 p.PG13, // TX_D0: Transmit Bit 0 75 p.PG13, // TX_D0: Transmit Bit 0
78 p.PB13, // TX_D1: Transmit Bit 1 76 p.PB13, // TX_D1: Transmit Bit 1
79 p.PG11, // TX_EN: Transmit Enable 77 p.PG11, // TX_EN: Transmit Enable
80 GenericPhy::new_auto(),
81 mac_addr, 78 mac_addr,
79 p.ETH_SMA,
80 p.PA2, // mdio
81 p.PC1, // mdc
82 ); 82 );
83 83
84 let config = embassy_net::Config::dhcpv4(Default::default()); 84 let config = embassy_net::Config::dhcpv4(Default::default());