From f20aad38137e50a0edc3bce204e5e8422b6d5497 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 11 Dec 2025 16:10:41 +0100 Subject: [PATCH] add Phy RTL8201 --- interface/src/app/settings/ApplicationSettings.tsx | 1 + src/core/system.cpp | 4 +++- src/core/system.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/src/app/settings/ApplicationSettings.tsx b/interface/src/app/settings/ApplicationSettings.tsx index 549bff4c4..826af46ea 100644 --- a/interface/src/app/settings/ApplicationSettings.tsx +++ b/interface/src/app/settings/ApplicationSettings.tsx @@ -602,6 +602,7 @@ const ApplicationSettings = () => { {LL.DISABLED(1)} LAN8720 TLK110 + RTL8201 diff --git a/src/core/system.cpp b/src/core/system.cpp index 6773cae87..34597123e 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -761,7 +761,9 @@ void System::network_init() { int mdio = 18; // Pin# of the I²C IO signal for the Ethernet PHY - hardcoded uint8_t phy_addr = eth_phy_addr_; // I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110) int8_t power = eth_power_; // Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source) - eth_phy_type_t type = (phy_type_ == PHY_type::PHY_TYPE_LAN8720) ? ETH_PHY_LAN8720 : ETH_PHY_TLK110; // Type of the Ethernet PHY (LAN8720 or TLK110) + eth_phy_type_t type = (phy_type_ == PHY_type::PHY_TYPE_LAN8720) ? ETH_PHY_LAN8720 + : (phy_type_ == PHY_type::PHY_TYPE_TLK110) ? ETH_PHY_TLK110 + : ETH_PHY_RTL8201; // Type of the Ethernet PHY (LAN8720 or TLK110) // clock mode: // ETH_CLOCK_GPIO0_IN = 0 RMII clock input to GPIO0 // ETH_CLOCK_GPIO0_OUT = 1 RMII clock output from GPIO0 diff --git a/src/core/system.h b/src/core/system.h index 6a0ceb4e1..84f6af660 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -60,7 +60,7 @@ using uuid::console::Shell; namespace emsesp { -enum PHY_type : uint8_t { PHY_TYPE_NONE = 0, PHY_TYPE_LAN8720, PHY_TYPE_TLK110 }; +enum PHY_type : uint8_t { PHY_TYPE_NONE = 0, PHY_TYPE_LAN8720, PHY_TYPE_TLK110, PHY_TYPE_RTL8201 }; enum SYSTEM_STATUS : uint8_t { SYSTEM_STATUS_NORMAL = 0,