diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-02-01 01:39:52 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-02-01 01:39:52 +0100 |
| commit | e613324e1603741df150730fd26652458d0d0c50 (patch) | |
| tree | 1f3167311f5b88f1d5c02ecb6a0c323e2d118602 | |
| parent | 42d8f3930a861dcc4540198bf2038151eb4e3e27 (diff) | |
stm32/eth: rename new_rmii to new, update metapac to fix issues with PC2_C.
| -rw-r--r-- | embassy-stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/v2/mod.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h5/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth_client.rs | 3 | ||||
| -rw-r--r-- | tests/stm32/src/bin/eth.rs | 21 |
8 files changed, 9 insertions, 29 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 6c7591f57..698febf71 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -68,7 +68,7 @@ rand_core = "0.6.3" | |||
| 68 | sdio-host = "0.5.0" | 68 | sdio-host = "0.5.0" |
| 69 | critical-section = "1.1" | 69 | critical-section = "1.1" |
| 70 | #stm32-metapac = { version = "15" } | 70 | #stm32-metapac = { version = "15" } |
| 71 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d" } | 71 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15" } |
| 72 | vcell = "0.1.3" | 72 | vcell = "0.1.3" |
| 73 | bxcan = "0.7.0" | 73 | bxcan = "0.7.0" |
| 74 | nb = "1.0.0" | 74 | nb = "1.0.0" |
| @@ -89,7 +89,7 @@ critical-section = { version = "1.1", features = ["std"] } | |||
| 89 | proc-macro2 = "1.0.36" | 89 | proc-macro2 = "1.0.36" |
| 90 | quote = "1.0.15" | 90 | quote = "1.0.15" |
| 91 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} | 91 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} |
| 92 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d", default-features = false, features = ["metadata"]} | 92 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15", default-features = false, features = ["metadata"]} |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | [features] | 95 | [features] |
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index a176b01e5..4b22d1d21 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -64,7 +64,7 @@ macro_rules! config_pins { | |||
| 64 | 64 | ||
| 65 | impl<'d, T: Instance, P: PHY> Ethernet<'d, T, P> { | 65 | impl<'d, T: Instance, P: PHY> Ethernet<'d, T, P> { |
| 66 | /// Create a new RMII ethernet driver using 9 pins. | 66 | /// Create a new RMII ethernet driver using 9 pins. |
| 67 | pub fn new_rmii<const TX: usize, const RX: usize>( | 67 | pub fn new<const TX: usize, const RX: usize>( |
| 68 | queue: &'d mut PacketQueue<TX, RX>, | 68 | queue: &'d mut PacketQueue<TX, RX>, |
| 69 | peri: impl Peripheral<P = T> + 'd, | 69 | peri: impl Peripheral<P = T> + 'd, |
| 70 | irq: impl interrupt::typelevel::Binding<interrupt::typelevel::ETH, InterruptHandler> + 'd, | 70 | irq: impl interrupt::typelevel::Binding<interrupt::typelevel::ETH, InterruptHandler> + 'd, |
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index 2933cfe3c..7f5c8fdb1 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs | |||
| @@ -63,7 +63,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 63 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 63 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 64 | 64 | ||
| 65 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | 65 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); |
| 66 | let device = Ethernet::new_rmii( | 66 | let device = Ethernet::new( |
| 67 | PACKETS.init(PacketQueue::<16, 16>::new()), | 67 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 68 | p.ETH, | 68 | p.ETH, |
| 69 | Irqs, | 69 | Irqs, |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 85b5bd3e0..5bff48197 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 65 | 65 | ||
| 66 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | 66 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); |
| 67 | let device = Ethernet::new_rmii( | 67 | let device = Ethernet::new( |
| 68 | PACKETS.init(PacketQueue::<16, 16>::new()), | 68 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 69 | p.ETH, | 69 | p.ETH, |
| 70 | Irqs, | 70 | Irqs, |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 79288877f..2370656e6 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -67,7 +67,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 67 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 67 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 68 | 68 | ||
| 69 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); | 69 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); |
| 70 | let device = Ethernet::new_rmii( | 70 | let device = Ethernet::new( |
| 71 | PACKETS.init(PacketQueue::<4, 4>::new()), | 71 | PACKETS.init(PacketQueue::<4, 4>::new()), |
| 72 | p.ETH, | 72 | p.ETH, |
| 73 | Irqs, | 73 | Irqs, |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 9abdcf3c0..cd9a27fcd 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 65 | 65 | ||
| 66 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); | 66 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); |
| 67 | let device = Ethernet::new_rmii( | 67 | let device = Ethernet::new( |
| 68 | PACKETS.init(PacketQueue::<4, 4>::new()), | 68 | PACKETS.init(PacketQueue::<4, 4>::new()), |
| 69 | p.ETH, | 69 | p.ETH, |
| 70 | Irqs, | 70 | Irqs, |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index c4da5776f..aeb169e19 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -65,7 +65,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 65 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 65 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 66 | 66 | ||
| 67 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | 67 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); |
| 68 | let device = Ethernet::new_rmii( | 68 | |
| 69 | let device = Ethernet::new( | ||
| 69 | PACKETS.init(PacketQueue::<16, 16>::new()), | 70 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 70 | p.ETH, | 71 | p.ETH, |
| 71 | Irqs, | 72 | Irqs, |
diff --git a/tests/stm32/src/bin/eth.rs b/tests/stm32/src/bin/eth.rs index b244874e7..7c02f0354 100644 --- a/tests/stm32/src/bin/eth.rs +++ b/tests/stm32/src/bin/eth.rs | |||
| @@ -71,7 +71,6 @@ async fn main(spawner: Spawner) { | |||
| 71 | const PACKET_QUEUE_SIZE: usize = 4; | 71 | const PACKET_QUEUE_SIZE: usize = 4; |
| 72 | 72 | ||
| 73 | static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new(); | 73 | static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new(); |
| 74 | #[cfg(not(eth_v2))] | ||
| 75 | let device = Ethernet::new( | 74 | let device = Ethernet::new( |
| 76 | PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), | 75 | PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), |
| 77 | p.ETH, | 76 | p.ETH, |
| @@ -91,26 +90,6 @@ async fn main(spawner: Spawner) { | |||
| 91 | GenericSMI::new(0), | 90 | GenericSMI::new(0), |
| 92 | mac_addr, | 91 | mac_addr, |
| 93 | ); | 92 | ); |
| 94 | #[cfg(eth_v2)] | ||
| 95 | let device = Ethernet::new_rmii( | ||
| 96 | PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), | ||
| 97 | p.ETH, | ||
| 98 | Irqs, | ||
| 99 | p.PA1, | ||
| 100 | p.PA2, | ||
| 101 | p.PC1, | ||
| 102 | p.PA7, | ||
| 103 | p.PC4, | ||
| 104 | p.PC5, | ||
| 105 | p.PG13, | ||
| 106 | #[cfg(not(feature = "stm32h563zi"))] | ||
| 107 | p.PB13, | ||
| 108 | #[cfg(feature = "stm32h563zi")] | ||
| 109 | p.PB15, | ||
| 110 | p.PG11, | ||
| 111 | GenericSMI::new(0), | ||
| 112 | mac_addr, | ||
| 113 | ); | ||
| 114 | 93 | ||
| 115 | let config = embassy_net::Config::dhcpv4(Default::default()); | 94 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 116 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { | 95 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
