Chapter 2. API Reference
esp_err_t (*get_link)(esp_eth_phy_t *phy)
Get Ethernet PHY link status.
Return
• ESP_OK: get Ethernet PHY link status successfully
• ESP_FAIL: get Ethernet PHY link status failed because some error occurred
Parameters
• [in] phy: Ethernet PHY instance
esp_err_t (*pwrctl)(esp_eth_phy_t *phy, bool enable)
Power control of Ethernet PHY.
Return
• ESP_OK: control Ethernet PHY power successfully
• ESP_FAIL: control Ethernet PHY power failed because some error occurred
Parameters
• [in] phy: Ethernet PHY instance
• [in] enable: set true to power on Ethernet PHY; ser false to power off Ethernet PHY
esp_err_t (*set_addr)(esp_eth_phy_t *phy, uint32_t addr)
Set PHY chip address.
Return
• ESP_OK: set Ethernet PHY address successfully
• ESP_FAIL: set Ethernet PHY address failed because some error occurred
Parameters
• [in] phy: Ethernet PHY instance
• [in] addr: PHY chip address
esp_err_t (*get_addr)(esp_eth_phy_t *phy, uint32_t *addr)
Get PHY chip address.
Return
• ESP_OK: get Ethernet PHY address successfully
• ESP_ERR_INVALID_ARG: get Ethernet PHY address failed because of invalid argument
Parameters
• [in] phy: Ethernet PHY instance
• [out] addr: PHY chip address
esp_err_t (*advertise_pause_ability)(esp_eth_phy_t *phy, uint32_t ability)
Advertise pause function supported by MAC layer.
Return
• ESP_OK: Advertise pause ability successfully
• ESP_ERR_INVALID_ARG: Advertise pause ability failed because of invalid argument
Parameters
• [in] phy: Ethernet PHY instance
• [out] addr: Pause ability
esp_err_t (*loopback)(esp_eth_phy_t *phy, bool enable)
Return
• ESP_OK: configures PHY instance loopback function successfully
• ESP_FAIL: PHY instance loopback configuration failed because some error occurred
Parameters
• [in] phy: Ethernet PHY instance
• [in] enable: enables or disables PHY loopback
esp_err_t (*del)(esp_eth_phy_t *phy)
Free memory of Ethernet PHY instance.
Return
• ESP_OK: free PHY instance successfully
• ESP_FAIL: free PHY instance failed because some error occurred
Parameters
Espressif Systems 190
Submit Document Feedback
Release v4.4