The MDIO module includes a user access register (MDIO_USERACCESS0/1) to directly access a specified PHY device. To read a PHY register, perform the following:
- Check to ensure that the GO bit in the MDIO user access register (MDIO_USERACCESSn) is cleared.
- Write to the GO, REGADR, and PHYADR bits in MDIO_USERACCESS0/1 corresponding to the PHY and PHY register you want to read.
- The read data value is available in the DATA bits in MDIO_USERACCESS0/1 after the module completes the read operation on the serial bus. Completion of the read operation can be determined by polling the GO and ACK bits in MDIO_USERACCESS0/1. After the GO bit has cleared, the ACK bit is set on a successful read.
- Completion of the operation sets the corresponding USERINTRAW bit (0 or 1) in the MDIO user command complete interrupt register (MDIO_USERINTRAW) corresponding to MDIO_USERACCESS0/1 used. If interrupts have been enabled on this bit using the MDIO user command complete interrupt mask set register (MDIO_USERINTMASKSET), then the bit is also set in the MDIO user command complete interrupt register (MDIO_USERINTMASKED) and an interrupt is triggered on the host processor.