control-mdio¶
CLI reference¶
glasgow run control-mdio¶
Configure Ethernet PHYs and query their status via the standard two-wire MDC/MDIO management interface. Both Clause 22 and Clause 45 operations are supported.
usage: glasgow run control-mdio [-h] [-V VOLTS] [--mdc PIN] [--mdio PIN]
[-f FREQ]
- -h, --help¶
show this help message and exit
- -V <volts>, --voltage <volts>¶
bus power (range: 1.8..5 V, or ‘S<port>’ to follow the voltage sensed on a port; default: unchanged)
- --mdc <pin>¶
bind management data clock to PIN (default: ‘A0’, required)
- --mdio <pin>¶
bind management data input/output to PIN (default: ‘A1’, required)
- -f <freq>, --frequency <freq>¶
set MDC frequency to FREQ kHz (default: 1000)
API reference¶
- class glasgow.applet.control.mdio.ControlMDIOPorts(*, supply: glasgow.abstract.GlasgowSupply, mdc: amaranth.lib.io.PortLike, mdio: amaranth.lib.io.PortLike)¶
- supply: GlasgowSupply¶
bus power
- mdc: PortLike¶
management data clock
- mdio: PortLike¶
management data input/output
- class glasgow.applet.control.mdio.ControlMDIOInterface(logger: Logger, assembly: AbstractAssembly, ports: ControlMDIOPorts)¶
MDIO controller.
portsis aControlMDIOPorts. Themdiopin should have a pull-down.- property clock: ClockDivisor¶
MDC clock divisor.
- async c22_write(phy: int, reg: int, value: int)¶
Write
valueto Clause 22 (MIIM) registerregof PHYphy.
- async c45_read(phy: int, dev: int, reg: int) int¶
Read Clause 45 (MDIO) register
regof MMDdevof PHYphy.