Skip to content

Commit 48a0aa1

Browse files
Updated pins_arduino.h for ESP32 POE, POE-ISO and Gateway
Due to the latest changes in the ethernet library/examples (#9242) full package of definitions of the ethernet macros is for each board that has non-default values. For POE and POE-ISO is added a preprocessor condition #if defined BOARD_HAS_PSRAM due to our specific hardware because GPIO 16 and 17 are in use when PSRAM is enabled.
1 parent 77b0955 commit 48a0aa1

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

variants/esp32-gateway/pins_arduino.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
#include <stdint.h>
55

66
#if defined (ARDUINO_ESP32_GATEWAY_E) || defined (ARDUINO_ESP32_GATEWAY_F)
7-
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
8-
#define ETH_PHY_POWER 5
7+
#define ETH_PHY_TYPE ETH_PHY_LAN8720
8+
#define ETH_PHY_ADDR 0
9+
#define ETH_PHY_MDC 23
10+
#define ETH_PHY_MDIO 18
11+
#define ETH_PHY_POWER 5
12+
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
913
#endif
1014

1115
static const uint8_t LED_BUILTIN = 33;

variants/esp32-poe-iso/pins_arduino.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33

44
#include <stdint.h>
55

6-
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
7-
#define ETH_PHY_POWER 12
6+
#define ETH_PHY_TYPE ETH_PHY_LAN8720
7+
#define ETH_PHY_ADDR 0
8+
#define ETH_PHY_MDC 23
9+
#define ETH_PHY_MDIO 18
10+
#define ETH_PHY_POWER 12
11+
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
12+
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
13+
#else
14+
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
15+
#endif
16+
817

918
static const uint8_t KEY_BUILTIN = 34;
1019

@@ -18,7 +27,11 @@ static const uint8_t RX = 3;
1827
#define RX2 35 // ext2 pin 3
1928

2029
static const uint8_t SDA = 13;
30+
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
31+
static const uint8_t SCL = 33;
32+
#else
2133
static const uint8_t SCL = 16;
34+
#endif
2235

2336
static const uint8_t SS = 5;
2437
static const uint8_t MOSI = 2;

variants/esp32-poe/pins_arduino.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33

44
#include <stdint.h>
55

6-
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
7-
#define ETH_PHY_POWER 12
6+
#define ETH_PHY_TYPE ETH_PHY_LAN8720
7+
#define ETH_PHY_ADDR 0
8+
#define ETH_PHY_MDC 23
9+
#define ETH_PHY_MDIO 18
10+
#define ETH_PHY_POWER 12
11+
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
12+
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
13+
#else
14+
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
15+
#endif
16+
817

918
static const uint8_t KEY_BUILTIN = 34;
1019

@@ -18,7 +27,11 @@ static const uint8_t RX = 3;
1827
#define RX2 35 // ext2 pin 3
1928

2029
static const uint8_t SDA = 13;
30+
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
31+
static const uint8_t SCL = 33;
32+
#else
2133
static const uint8_t SCL = 16;
34+
#endif
2235

2336
static const uint8_t SS = 5;
2437
static const uint8_t MOSI = 2;

0 commit comments

Comments
 (0)