From c831d62bc30516ed633ce242140eae66a95dc67f Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sun, 20 Jun 2021 00:14:09 +0200 Subject: [PATCH] Added 2 Ethernet boards and split Ethernet configs into separate file --- wled00/const.h | 4 +- wled00/data/settings_wifi.htm | 2 + wled00/html_settings.h | 10 ++-- wled00/wled.cpp | 63 +------------------------ wled00/wled.h | 2 +- wled00/wled_ethernet.h | 86 +++++++++++++++++++++++++++++++++++ 6 files changed, 99 insertions(+), 68 deletions(-) create mode 100644 wled00/wled_ethernet.h diff --git a/wled00/const.h b/wled00/const.h index 85f8c25fb..75e482846 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -166,13 +166,15 @@ #define BTN_TYPE_ANALOG 7 //Ethernet board types -#define WLED_NUM_ETH_TYPES 5 +#define WLED_NUM_ETH_TYPES 7 #define WLED_ETH_NONE 0 #define WLED_ETH_WT32_ETH01 1 #define WLED_ETH_ESP32_POE 2 #define WLED_ETH_WESP32 3 #define WLED_ETH_QUINLED 4 +#define WLED_ETH_TWILIGHTLORD 5 +#define WLED_ETH_ESP32DEUX 6 //Hue error codes #define HUE_ERROR_INACTIVE 0 diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm index 31924526e..58ee5543b 100644 --- a/wled00/data/settings_wifi.htm +++ b/wled00/data/settings_wifi.htm @@ -69,7 +69,9 @@

diff --git a/wled00/html_settings.h b/wled00/html_settings.h index a02d1aea9..f9bf33019 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -64,10 +64,12 @@ Disable WiFi sleep:
Can help with connectivity issues.
Do not enable if WiFi is working correctly, increases power consumption.

Ethernet Type




-)====="; +


+)====="; // Autogenerated from wled00/data/settings_leds.htm, do not edit!! diff --git a/wled00/wled.cpp b/wled00/wled.cpp index ce875e462..2ac5dd00e 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -1,5 +1,6 @@ #define WLED_DEFINE_GLOBAL_VARS //only in one source file, wled.cpp! #include "wled.h" +#include "wled_ethernet.h" #include #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DISABLE_BROWNOUT_DET) @@ -15,68 +16,6 @@ WLED::WLED() { } -#ifdef WLED_USE_ETHERNET -// settings for various ethernet boards -typedef struct EthernetSettings { - uint8_t eth_address; - int eth_power; - int eth_mdc; - int eth_mdio; - eth_phy_type_t eth_type; - eth_clock_mode_t eth_clk_mode; -} ethernet_settings; - -ethernet_settings ethernetBoards[] = { - // None - { - }, - - // WT32-EHT01 - // Please note, from my testing only these pins work for LED outputs: - // IO2, IO4, IO12, IO14, IO15 - // These pins do not appear to work from my testing: - // IO35, IO36, IO39 - { - 1, // eth_address, - 16, // eth_power, - 23, // eth_mdc, - 18, // eth_mdio, - ETH_PHY_LAN8720, // eth_type, - ETH_CLOCK_GPIO0_IN // eth_clk_mode - }, - - // ESP32-POE - { - 0, // eth_address, - 12, // eth_power, - 23, // eth_mdc, - 18, // eth_mdio, - ETH_PHY_LAN8720, // eth_type, - ETH_CLOCK_GPIO17_OUT // eth_clk_mode - }, - - // WESP32 - { - 0, // eth_address, - -1, // eth_power, - 16, // eth_mdc, - 17, // eth_mdio, - ETH_PHY_LAN8720, // eth_type, - ETH_CLOCK_GPIO0_IN // eth_clk_mode - }, - - // QuinLed-ESP32-Ethernet - { - 0, // eth_address, - 5, // eth_power, - 23, // eth_mdc, - 18, // eth_mdio, - ETH_PHY_LAN8720, // eth_type, - ETH_CLOCK_GPIO17_OUT // eth_clk_mode - } -}; -#endif - // turns all LEDs off and restarts ESP void WLED::reset() { diff --git a/wled00/wled.h b/wled00/wled.h index 9a8e2ccf7..a04a9d613 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2106180 +#define VERSION 2106200 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG diff --git a/wled00/wled_ethernet.h b/wled00/wled_ethernet.h new file mode 100644 index 000000000..2b6021cbf --- /dev/null +++ b/wled00/wled_ethernet.h @@ -0,0 +1,86 @@ +#ifndef WLED_ETHERNET_H +#define WLED_ETHERNET_H + +#ifdef WLED_USE_ETHERNET +// settings for various ethernet boards +typedef struct EthernetSettings { + uint8_t eth_address; + int eth_power; + int eth_mdc; + int eth_mdio; + eth_phy_type_t eth_type; + eth_clock_mode_t eth_clk_mode; +} ethernet_settings; + +ethernet_settings ethernetBoards[] = { + // None + { + }, + + // WT32-EHT01 + // Please note, from my testing only these pins work for LED outputs: + // IO2, IO4, IO12, IO14, IO15 + // These pins do not appear to work from my testing: + // IO35, IO36, IO39 + { + 1, // eth_address, + 16, // eth_power, + 23, // eth_mdc, + 18, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO0_IN // eth_clk_mode + }, + + // ESP32-POE + { + 0, // eth_address, + 12, // eth_power, + 23, // eth_mdc, + 18, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO17_OUT // eth_clk_mode + }, + + // WESP32 + { + 0, // eth_address, + -1, // eth_power, + 16, // eth_mdc, + 17, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO0_IN // eth_clk_mode + }, + + // QuinLed-ESP32-Ethernet + { + 0, // eth_address, + 5, // eth_power, + 23, // eth_mdc, + 18, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO17_OUT // eth_clk_mode + }, + + // TwilightLord-ESP32 Ethernet Shield + { + 0, // eth_address, + 5, // eth_power, + 23, // eth_mdc, + 18, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO17_OUT // eth_clk_mode + }, + + // ESP3DEUXQuattro + { + 1, // eth_address, + -1, // eth_power, + 23, // eth_mdc, + 18, // eth_mdio, + ETH_PHY_LAN8720, // eth_type, + ETH_CLOCK_GPIO17_OUT // eth_clk_mode + } +}; +#endif + +#endif \ No newline at end of file