Skip to content

Commit 3ff586b

Browse files
authored
feat(eth): Add support for generic IEEE 802.3 driver (#10859)
1 parent 323ead5 commit 3ff586b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libraries/Ethernet/src/ETH.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
283283

284284
esp_eth_phy_t *phy = NULL;
285285
switch (type) {
286+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
287+
case ETH_PHY_GENERIC: phy = esp_eth_phy_new_generic(&phy_config); break;
288+
#endif
286289
case ETH_PHY_LAN8720: phy = esp_eth_phy_new_lan87xx(&phy_config); break;
287290
case ETH_PHY_TLK110: phy = esp_eth_phy_new_ip101(&phy_config); break;
288291
case ETH_PHY_RTL8201: phy = esp_eth_phy_new_rtl8201(&phy_config); break;

libraries/Ethernet/src/ETH.h

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#ifndef _ETH_H_
2525
#define _ETH_H_
26+
#include "esp_idf_version.h"
2627

2728
//
2829
// Example configurations for pins_arduino.h to allow starting with ETH.begin();
@@ -127,6 +128,10 @@ typedef emac_rmii_clock_mode_t eth_clock_mode_t;
127128

128129
typedef enum {
129130
#if CONFIG_ETH_USE_ESP32_EMAC
131+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
132+
ETH_PHY_GENERIC,
133+
#define ETH_PHY_JL1101 ETH_PHY_GENERIC
134+
#endif
130135
ETH_PHY_LAN8720,
131136
ETH_PHY_TLK110,
132137
ETH_PHY_RTL8201,

0 commit comments

Comments
 (0)