pub enum RmiiClockConfig {
InternalApll {
gpio: ClkGpio,
xtal: XtalFreq,
},
External {
gpio: ClkGpio,
},
}Expand description
RMII reference clock configuration.
The 50 MHz RMII clock can be generated internally (ESP32 APLL) or
supplied externally from a PHY-driven oscillator. Mode selection is
hardware-specific and Emac::init rejects mismatched GPIO choices
with crate::EmacError::InvalidConfig — see each variant’s docs
for which pads are valid.
Variants§
InternalApll
ESP32 APLL generates 50 MHz and drives it out of the chip.
Valid GPIO choices: ClkGpio::Gpio16 (EMAC_CLK_OUT, 0°) or
ClkGpio::Gpio17 (EMAC_CLK_OUT_180, 180° — the LAN8720A
reference design preference). ClkGpio::Gpio0 is invalid
for this mode: GPIO0 function 5 is EMAC_TX_CLK, an input pad.
xtal selects the SDM coefficients for APLL programming and
MUST match the actual on-board crystal — there is no detection
at runtime, getting it wrong silently produces a wrong-frequency
REF_CLK and the link will not come up.
Coexistence note: ESP32 errata CLK-3.22 — the APLL clock signal
emitted on the GPIO pad is corrupted by on-chip RF noise during
WiFi/BT transmission. This mode is unsafe with active radio;
boards needing Ethernet + WiFi should use Self::External.
Fields
External
External 50 MHz clock fed in from a PHY crystal or oscillator.
Valid GPIO choice: ClkGpio::Gpio0 only — that is the only
pad whose function 5 (EMAC_TX_CLK) is an input. Gpio16 /
Gpio17 are invalid here.
Required for Ethernet + WiFi coexistence (immune to the CLK-3.22 errata since the clock never leaves the PHY domain).
Trait Implementations§
Source§impl Clone for RmiiClockConfig
impl Clone for RmiiClockConfig
Source§fn clone(&self) -> RmiiClockConfig
fn clone(&self) -> RmiiClockConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RmiiClockConfig
impl Debug for RmiiClockConfig
Source§impl Format for RmiiClockConfig
impl Format for RmiiClockConfig
Source§impl PartialEq for RmiiClockConfig
impl PartialEq for RmiiClockConfig
Source§fn eq(&self, other: &RmiiClockConfig) -> bool
fn eq(&self, other: &RmiiClockConfig) -> bool
self and other values to be equal, and is used by ==.