diff --git a/clion/CMakeLists.txt b/clion/CMakeLists.txt index 60ad55d..a2cb9b9 100644 --- a/clion/CMakeLists.txt +++ b/clion/CMakeLists.txt @@ -56,6 +56,7 @@ set(SRCFILES ../src/NukiPublisher.cpp ../src/EspMillis.h ../src/enums/NukiPinState.h + ../src/networkDevices/Tlk110Definitions.h ) file(GLOB_RECURSE SRCFILESREC diff --git a/src/Config.h b/src/Config.h index 3317061..a8595b8 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.09" #define NUKI_HUB_VERSION_INT (uint32_t)909 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-02-20" +#define NUKI_HUB_DATE "2025-03-02" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json" diff --git a/src/networkDevices/Tlk110Definitions.h b/src/networkDevices/Tlk110Definitions.h new file mode 100644 index 0000000..df645c2 --- /dev/null +++ b/src/networkDevices/Tlk110Definitions.h @@ -0,0 +1,8 @@ +#pragma once + +#define ETH_CLK_MODE_M5_TYPE ETH_PHY_TLK110 +#define ETH_CLK_MODE_M5_POESP32 ETH_CLOCK_GPIO0_IN +#define ETH_PHY_ADDR_M5_POESP32 1 +#define ETH_PHY_MDC_M5_POESP32 23 +#define ETH_PHY_MDIO_M5_POESP32 18 +#define ETH_PHY_POWER_M5_POESP32 5 diff --git a/src/networkDevices/W5500Definitions.h b/src/networkDevices/W5500Definitions.h index 7a0d5c9..577a5c5 100644 --- a/src/networkDevices/W5500Definitions.h +++ b/src/networkDevices/W5500Definitions.h @@ -10,16 +10,19 @@ #define ETH_PHY_SPI_SCK_M5_W5500 22 #define ETH_PHY_SPI_MISO_M5_W5500 23 #define ETH_PHY_SPI_MOSI_M5_W5500 33 + #define ETH_PHY_CS_M5_W5500_S3 6 #define ETH_PHY_SPI_SCK_M5_W5500_S3 5 #define ETH_PHY_SPI_MISO_M5_W5500_S3 7 #define ETH_PHY_SPI_MOSI_M5_W5500_S3 8 + #define ETH_PHY_IRQ_ELITE_W5500 14 #define ETH_PHY_RST_ELITE_W5500 -1 #define ETH_PHY_CS_ELITE_W5500 45 #define ETH_PHY_SPI_SCK_ELITE_W5500 48 #define ETH_PHY_SPI_MISO_ELITE_W5500 47 #define ETH_PHY_SPI_MOSI_ELITE_W5500 21 + #define ETH_PHY_IRQ_GENERIC_W5500 3 #define ETH_PHY_RST_GENERIC_W5500 4 #define ETH_PHY_CS_GENERIC_W5500 5 diff --git a/src/util/NetworkDeviceInstantiator.cpp b/src/util/NetworkDeviceInstantiator.cpp index 9bc841d..31a40c0 100644 --- a/src/util/NetworkDeviceInstantiator.cpp +++ b/src/util/NetworkDeviceInstantiator.cpp @@ -6,6 +6,7 @@ #include "../PreferencesKeys.h" #include "NetworkUtil.h" #include "../networkDevices/LAN8720Definitions.h" +#include "../networkDevices/Tlk110Definitions.h" NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDeviceType, String hostname, Preferences *preferences, IPConfiguration *ipConfiguration) { @@ -57,17 +58,6 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice ETH_PHY_SPI_MOSI_ETH01EVO, ETH_PHY_TYPE_DM9051); break; - case NetworkDeviceType::M5STACK_PoESP32_Unit: - device = new EthernetDevice(hostname, preferences, ipConfiguration, "M5STACK PoESP32 Unit", - ETH_PHY_ADDR_W5500, - ETH_PHY_CS_M5_W5500, - ETH_PHY_IRQ_M5_W5500, - ETH_PHY_RST_M5_W5500, - ETH_PHY_SPI_SCK_M5_W5500, - ETH_PHY_SPI_MISO_M5_W5500, - ETH_PHY_SPI_MOSI_M5_W5500, - ETH_PHY_W5500); - break; case NetworkDeviceType::LilyGO_T_ETH_ELite: device = new EthernetDevice(hostname, preferences, ipConfiguration, "LilyGO T-ETH ELite", ETH_PHY_ADDR_W5500, @@ -139,6 +129,15 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice } break; #if defined(CONFIG_IDF_TARGET_ESP32) + case NetworkDeviceType::M5STACK_PoESP32_Unit: + device = new EthernetDevice(hostname, preferences, ipConfiguration, "M5STACK PoESP32 Unit", + ETH_PHY_ADDR_M5_POESP32, + ETH_PHY_POWER_M5_POESP32, + ETH_PHY_MDC_M5_POESP32, + ETH_PHY_MDIO_M5_POESP32, + ETH_CLK_MODE_M5_TYPE, + ETH_CLK_MODE_M5_POESP32); + break; case NetworkDeviceType::Olimex_LAN8720: device = new EthernetDevice(hostname, preferences, ipConfiguration, "Olimex (LAN8720)", ETH_PHY_ADDR_LAN8720, 12, ETH_PHY_MDC_LAN8720, ETH_PHY_MDIO_LAN8720, ETH_PHY_TYPE_LAN8720, ETH_CLOCK_GPIO17_OUT); break;