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 SPEC] [--mdc PIN] [--mdio PIN]
[-f FREQ]
- -h, --help¶
show this help message and exit
- -V <spec>, --voltage <spec>¶
configure I/O port voltage to SPEC (e.g.: ‘3.3’, ‘A=5.0,B=3.3’, ‘A=SA’)
- --mdc <pin>¶
bind the applet I/O line ‘mdc’ to PIN (default: ‘A0’, required)
- --mdio <pin>¶
bind the applet I/O line ‘mdio’ to PIN (default: ‘A1’, required)
- -f <freq>, --frequency <freq>¶
set MDC frequency to FREQ kHz (default: 1000)
API reference¶
- class glasgow.applet.control.mdio.ControlMDIOInterface(logger: Logger, assembly: AbstractAssembly, *, mdc: GlasgowPin, mdio: GlasgowPin)¶
- 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.