diff options
| author | xoviat <[email protected]> | 2023-07-15 12:02:08 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-15 12:02:08 -0500 |
| commit | 17d5e1c47046ea69ef7ac6041ae3cf3be587221b (patch) | |
| tree | 610cd8ab4cc4fa068124115c04c3f06361512945 /embassy-stm32/src/eth | |
| parent | 975a780efe73b20d3ba63a116792b28f9a6edada (diff) | |
stm32/eth: add set_poll_interval
Diffstat (limited to 'embassy-stm32/src/eth')
| -rw-r--r-- | embassy-stm32/src/eth/generic_smi.rs | 10 |
1 files changed, 8 insertions, 2 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 |
