Skip to content

Commit

Permalink
Updated pins_arduino.h for ESP32 POE, POE-ISO and Gateway
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Stanimir-Petev committed Feb 19, 2024
1 parent 77b0955 commit 48a0aa1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
8 changes: 6 additions & 2 deletions variants/esp32-gateway/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
#include <stdint.h>

#if defined (ARDUINO_ESP32_GATEWAY_E) || defined (ARDUINO_ESP32_GATEWAY_F)
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 5
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER 5
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#endif

static const uint8_t LED_BUILTIN = 33;
Expand Down
17 changes: 15 additions & 2 deletions variants/esp32-poe-iso/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@

#include <stdint.h>

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER 12
#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
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
#else
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#endif


static const uint8_t KEY_BUILTIN = 34;

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

static const uint8_t SDA = 13;
#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
static const uint8_t SCL = 33;
#else
static const uint8_t SCL = 16;
#endif

static const uint8_t SS = 5;
static const uint8_t MOSI = 2;
Expand Down
17 changes: 15 additions & 2 deletions variants/esp32-poe/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@

#include <stdint.h>

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER 12
#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
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
#else
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#endif


static const uint8_t KEY_BUILTIN = 34;

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

static const uint8_t SDA = 13;
#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
static const uint8_t SCL = 33;
#else
static const uint8_t SCL = 16;
#endif

static const uint8_t SS = 5;
static const uint8_t MOSI = 2;
Expand Down

0 comments on commit 48a0aa1

Please sign in to comment.