diff options
| -rw-r--r-- | embassy-stm32/src/eth/generic_smi.rs | 10 | ||||
| -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 | 2 |
6 files changed, 13 insertions, 7 deletions
diff --git a/embassy-stm32/src/eth/generic_smi.rs b/embassy-stm32/src/eth/generic_smi.rs index 22631c2d1..90631b175 100644 --- a/embassy-stm32/src/eth/generic_smi.rs +++ b/embassy-stm32/src/eth/generic_smi.rs | |||
| @@ -49,8 +49,10 @@ pub struct GenericSMI { | |||
| 49 | 49 | ||
| 50 | impl GenericSMI { | 50 | impl GenericSMI { |
| 51 | #[cfg(feature = "time")] | 51 | #[cfg(feature = "time")] |
| 52 | pub fn new(poll_interval: Duration) -> Self { | 52 | pub fn new() -> Self { |
| 53 | Self { poll_interval } | 53 | Self { |
| 54 | poll_interval: Duration::from_millis(500), | ||
| 55 | } | ||
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | #[cfg(not(feature = "time"))] | 58 | #[cfg(not(feature = "time"))] |
| @@ -100,6 +102,10 @@ unsafe impl PHY for GenericSMI { | |||
| 100 | 102 | ||
| 101 | /// Public functions for the PHY | 103 | /// Public functions for the PHY |
| 102 | impl GenericSMI { | 104 | impl GenericSMI { |
| 105 | pub fn set_poll_interval(&mut self, poll_interval: Duration) { | ||
| 106 | self.poll_interval = poll_interval | ||
| 107 | } | ||
| 108 | |||
| 103 | // Writes a value to an extended PHY register in MMD address space | 109 | // Writes a value to an extended PHY register in MMD address space |
| 104 | fn smi_write_ext<S: StationManagement>(&mut self, sm: &mut S, reg_addr: u16, reg_data: u16) { | 110 | fn smi_write_ext<S: StationManagement>(&mut self, sm: &mut S, reg_addr: u16, reg_data: u16) { |
| 105 | sm.smi_write(PHY_REG_CTL, 0x0003); // set address | 111 | sm.smi_write(PHY_REG_CTL, 0x0003); // set address |
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index 15390592a..d0b164393 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs | |||
| @@ -56,7 +56,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 56 | p.PG13, | 56 | p.PG13, |
| 57 | p.PB13, | 57 | p.PB13, |
| 58 | p.PG11, | 58 | p.PG11, |
| 59 | GenericSMI::new(Duration::from_millis(500)), | 59 | GenericSMI::new(), |
| 60 | mac_addr, | 60 | mac_addr, |
| 61 | 0, | 61 | 0, |
| 62 | ); | 62 | ); |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index c1baa5848..c6b2ba45c 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -57,7 +57,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 57 | p.PG13, | 57 | p.PG13, |
| 58 | p.PB13, | 58 | p.PB13, |
| 59 | p.PG11, | 59 | p.PG11, |
| 60 | GenericSMI::new(Duration::from_millis(500)), | 60 | GenericSMI::new(), |
| 61 | mac_addr, | 61 | mac_addr, |
| 62 | 0, | 62 | 0, |
| 63 | ); | 63 | ); |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 3b33265ac..0bff85ed8 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -76,7 +76,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 76 | p.PG13, | 76 | p.PG13, |
| 77 | p.PB15, | 77 | p.PB15, |
| 78 | p.PG11, | 78 | p.PG11, |
| 79 | GenericSMI::new(Duration::from_millis(500)), | 79 | GenericSMI::new(), |
| 80 | mac_addr, | 80 | mac_addr, |
| 81 | 0, | 81 | 0, |
| 82 | ); | 82 | ); |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 9203708ad..cfafcaed1 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -58,7 +58,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 58 | p.PG13, | 58 | p.PG13, |
| 59 | p.PB13, | 59 | p.PB13, |
| 60 | p.PG11, | 60 | p.PG11, |
| 61 | GenericSMI::new(Duration::from_millis(500)), | 61 | GenericSMI::new(), |
| 62 | mac_addr, | 62 | mac_addr, |
| 63 | 0, | 63 | 0, |
| 64 | ); | 64 | ); |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 8abc41095..4ed737578 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -59,7 +59,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 59 | p.PG13, | 59 | p.PG13, |
| 60 | p.PB13, | 60 | p.PB13, |
| 61 | p.PG11, | 61 | p.PG11, |
| 62 | GenericSMI::new(Duration::from_millis(500)), | 62 | GenericSMI::new(), |
| 63 | mac_addr, | 63 | mac_addr, |
| 64 | 0, | 64 | 0, |
| 65 | ); | 65 | ); |
