Page 1 of 1

Reading PHY register

Posted: Wed Jul 08, 2020 1:39 pm
by PeterR
I need to dump the Ethernet's PHY registers (LAN8710) for diagnostics & debug.

esp_eth_driver_t contains the element esp_eth_mediator_t mediator which has member phy_reg_read
Unfortunately the esp_eth_driver_t type is private. We get the void * cast esp_eth_handle_t.

How do I gain access to the PHY interface? I could expose esp_eth_driver_t but would rather not edit the IDF for obvious reasons.

Re: Reading PHY register

Posted: Thu Jul 09, 2020 6:30 am
by ESP_morris
PeterR wrote:
Wed Jul 08, 2020 1:39 pm
I need to dump the Ethernet's PHY registers (LAN8710) for diagnostics & debug.

esp_eth_driver_t contains the element esp_eth_mediator_t mediator which has member phy_reg_read
Unfortunately the esp_eth_driver_t type is private. We get the void * cast esp_eth_handle_t.

How do I gain access to the PHY interface? I could expose esp_eth_driver_t but would rather not edit the IDF for obvious reasons.
After you create the MAC instance by esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&mac_config);

then you can read PHY register just by mac->read_phy_reg