From e6ba8c7ac9c55fda98253c9aa4fdc1aba9caa44e Mon Sep 17 00:00:00 2001 From: rtrbt <9214823+rtrbt@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:43:29 +0200 Subject: [PATCH] Add KSZ8081 support. (#5061) This adds support for the KSZ8081 ethernet phy. Only the IDF 4+ specific code is modified, as the phy support was only added recently: espressif/esp-idf@aecfbf96 --- libraries/WiFi/src/ETH.cpp | 2 ++ libraries/WiFi/src/ETH.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/WiFi/src/ETH.cpp b/libraries/WiFi/src/ETH.cpp index 0288045b..143733ef 100644 --- a/libraries/WiFi/src/ETH.cpp +++ b/libraries/WiFi/src/ETH.cpp @@ -170,6 +170,8 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ eth_phy = esp_eth_phy_new_dm9051(&phy_config); break; #endif + case ETH_PHY_KSZ8081: + eth_phy = esp_eth_phy_new_ksz8081(&phy_config); default: break; } diff --git a/libraries/WiFi/src/ETH.h b/libraries/WiFi/src/ETH.h index 9a944401..b8b78c17 100644 --- a/libraries/WiFi/src/ETH.h +++ b/libraries/WiFi/src/ETH.h @@ -51,7 +51,7 @@ #endif #endif -typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_MAX } eth_phy_type_t; +typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_KSZ8081, ETH_PHY_MAX } eth_phy_type_t; class ETHClass { private: