Skip to content

Commit 6ff63fd

Browse files
committed
Add support for the Microchip LAN8742 Ethernet PHY chip.
1 parent b94bfc2 commit 6ff63fd

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "eth_phy/phy.h"
3737
#include "eth_phy/phy_tlk110.h"
3838
#include "eth_phy/phy_lan8720.h"
39+
#include "eth_phy/phy_lan8742.h"
3940
#endif
4041
#include "lwip/err.h"
4142
#include "lwip/dns.h"
@@ -273,6 +274,9 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
273274
case ETH_PHY_LAN8720:
274275
eth_phy = esp_eth_phy_new_lan8720(&phy_config);
275276
break;
277+
case ETH_PHY_LAN8742:
278+
eth_phy = esp_eth_phy_new_lan8742(&phy_config);
279+
break;
276280
case ETH_PHY_TLK110:
277281
eth_phy = esp_eth_phy_new_ip101(&phy_config);
278282
break;
@@ -334,6 +338,9 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
334338
if(type == ETH_PHY_LAN8720){
335339
eth_config_t config = phy_lan8720_default_ethernet_config;
336340
memcpy(&eth_config, &config, sizeof(eth_config_t));
341+
} else if(type == ETH_PHY_LAN8742){
342+
eth_config_t config = phy_lan8742_default_ethernet_config;
343+
memcpy(&eth_config, &config, sizeof(eth_config_t));
337344
} else if(type == ETH_PHY_TLK110){
338345
eth_config_t config = phy_tlk110_default_ethernet_config;
339346
memcpy(&eth_config, &config, sizeof(eth_config_t));

Diff for: libraries/WiFi/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_LAN8742, ETH_PHY_TLK110, ETH_PHY_RTL8201, ETH_PHY_DP83848, ETH_PHY_DM9051, ETH_PHY_KSZ8081, ETH_PHY_MAX } eth_phy_type_t;
5757
#define ETH_PHY_IP101 ETH_PHY_TLK110
5858

5959
class ETHClass {

Diff for: tools/sdk/esp32/include/esp_eth/include/esp_eth_phy.h

+11
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,17 @@ esp_eth_phy_t *esp_eth_phy_new_rtl8201(const eth_phy_config_t *config);
242242
*/
243243
esp_eth_phy_t *esp_eth_phy_new_lan8720(const eth_phy_config_t *config);
244244

245+
/**
246+
* @brief Create a PHY instance of LAN8742
247+
*
248+
* @param[in] config: configuration of PHY
249+
*
250+
* @return
251+
* - instance: create PHY instance successfully
252+
* - NULL: create PHY instance failed because some error occurred
253+
*/
254+
esp_eth_phy_t *esp_eth_phy_new_lan8742(const eth_phy_config_t *config);
255+
245256
/**
246257
* @brief Create a PHY instance of DP83848
247258
*

Diff for: tools/sdk/esp32/lib/libesp_eth.a

-522 KB
Binary file not shown.

0 commit comments

Comments
 (0)