Skip to content

Commit 1ac3aef

Browse files
authored
Add KSZ8041 support (#6087)
1 parent e84e9c1 commit 1ac3aef

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: libraries/Ethernet/src/ETH.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
281281
eth_phy = esp_eth_phy_new_dm9051(&phy_config);
282282
break;
283283
#endif
284+
case ETH_PHY_KSZ8041:
285+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4,4,0)
286+
eth_phy = esp_eth_phy_new_ksz8041(&phy_config);
287+
#else
288+
log_e("unsupported ethernet type 'ETH_PHY_KSZ8041'");
289+
#endif
290+
break;
284291
case ETH_PHY_KSZ8081:
285292
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4,4,0)
286293
eth_phy = esp_eth_phy_new_ksz8081(&phy_config);

Diff for: libraries/Ethernet/src/ETH.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
typedef enum { ETH_CLOCK_GPIO0_IN, ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT } eth_clock_mode_t;
5454
#endif
5555

56-
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;
56+
typedef enum { ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_KSZ8041, ETH_PHY_KSZ8081, ETH_PHY_MAX } eth_phy_type_t;
5757
#define ETH_PHY_IP101 ETH_PHY_TLK110
5858

5959
class ETHClass {

0 commit comments

Comments
 (0)