Reading PHY register

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Reading PHY register

Postby PeterR » 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.
& I also believe that IDF CAN should be fixed.

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: Reading PHY register

Postby ESP_morris » Thu Jul 09, 2020 6:30 am

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

Who is online

Users browsing this forum: No registered users and 80 guests