Skip to content

Commit 8466e3e

Browse files
committed
fix(eth): Fix Ethernet examples
1 parent 0394c4b commit 8466e3e

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

Diff for: libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55

66
// Important to be defined BEFORE including ETH.h for ETH.begin() to work.
77
// Example RMII LAN8720 (Olimex, etc.)
8-
#ifndef ETH_PHY_TYPE
8+
#ifndef ETH_PHY_MDC
99
#define ETH_PHY_TYPE ETH_PHY_LAN8720
10+
#if CONFIG_IDF_TARGET_ESP32
1011
#define ETH_PHY_ADDR 0
1112
#define ETH_PHY_MDC 23
1213
#define ETH_PHY_MDIO 18
1314
#define ETH_PHY_POWER -1
1415
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN
16+
#elif CONFIG_IDF_TARGET_ESP32P4
17+
#define ETH_PHY_ADDR 0
18+
#define ETH_PHY_MDC 31
19+
#define ETH_PHY_MDIO 52
20+
#define ETH_PHY_POWER 51
21+
#define ETH_CLK_MODE EMAC_CLK_EXT_IN
22+
#endif
1523
#endif
1624

1725
#include <ETH.h>

Diff for: libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <ETH.h>
77

8-
#ifndef ETH_PHY_TYPE
8+
#ifndef ETH_PHY_MDC
99
#define ETH_PHY_TYPE ETH_PHY_TLK110
1010
#if CONFIG_IDF_TARGET_ESP32
1111
#define ETH_PHY_ADDR 31

Diff for: libraries/Ethernet/examples/ETH_W5500_Arduino_SPI/ETH_W5500_Arduino_SPI.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Set this to 1 to enable dual Ethernet support
1010
#define USE_TWO_ETH_PORTS 0
1111

12-
#ifndef ETH_PHY_TYPE
12+
#ifndef ETH_PHY_CS
1313
#define ETH_PHY_TYPE ETH_PHY_W5500
1414
#define ETH_PHY_ADDR 1
1515
#define ETH_PHY_CS 15
@@ -24,7 +24,7 @@
2424

2525
#if USE_TWO_ETH_PORTS
2626
// Second port on shared SPI bus
27-
#ifndef ETH1_PHY_TYPE
27+
#ifndef ETH1_PHY_CS
2828
#define ETH1_PHY_TYPE ETH_PHY_W5500
2929
#define ETH1_PHY_ADDR 1
3030
#define ETH1_PHY_CS 32

Diff for: libraries/Ethernet/examples/ETH_W5500_IDF_SPI/ETH_W5500_IDF_SPI.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Set this to 1 to enable dual Ethernet support
99
#define USE_TWO_ETH_PORTS 0
1010

11-
#ifndef ETH_PHY_TYPE
11+
#ifndef ETH_PHY_CS
1212
#define ETH_PHY_TYPE ETH_PHY_W5500
1313
#define ETH_PHY_ADDR 1
1414
#define ETH_PHY_CS 15
@@ -22,7 +22,7 @@
2222

2323
#if USE_TWO_ETH_PORTS
2424
// Second port on shared SPI bus
25-
#ifndef ETH1_PHY_TYPE
25+
#ifndef ETH1_PHY_CS
2626
#define ETH1_PHY_TYPE ETH_PHY_W5500
2727
#define ETH1_PHY_ADDR 1
2828
#define ETH1_PHY_CS 32

0 commit comments

Comments
 (0)