[ethernet] Restructure for multi-platform support

Restructure the ethernet component from ESP32-only to multi-platform,
following the same pattern as the wifi component (FILTER_SOURCE_FILES
with platform-specific .cpp files).

- Split ethernet_component.cpp into common code + ethernet_component_esp32.cpp
- Remove DEPENDENCIES = ["esp32"], add platform validators per type
- Add FILTER_SOURCE_FILES to select platform-specific .cpp
- Move ESP32 imports inside platform-conditional functions
- Update ethernet_info guards from USE_ESP32 to USE_ETHERNET
- Add USE_ETHERNET_SPI/OPENETH/SPI_POLLING_SUPPORT to defines.h
- Guard ethernet_helpers.c with USE_ESP32

No behavioral changes for ESP32 — this is a pure restructuring to
enable adding non-ESP32 platform support.
This commit is contained in:
J. Nick Koston
2026-03-14 14:37:34 -10:00
parent ea1b1913d9
commit d7f4f2b4c5
2 changed files with 1 additions and 4 deletions
@@ -408,7 +408,7 @@ void EthernetComponent::dump_config() {
this->clk_pin_, this->miso_pin_, this->mosi_pin_, this->cs_pin_);
#ifdef USE_ETHERNET_SPI_POLLING_SUPPORT
if (this->polling_interval_ != 0) {
ESP_LOGCONFIG(TAG, " Polling Interval: %" PRIu32 " ms", this->polling_interval_);
ESP_LOGCONFIG(TAG, " Polling Interval: %lu ms", this->polling_interval_);
} else
#endif
{
-3
View File
@@ -281,9 +281,6 @@
#define USE_ETHERNET_SPI
#define USE_ETHERNET_SPI_POLLING_SUPPORT
#define USE_ETHERNET_OPENETH
#define CONFIG_ETH_SPI_ETHERNET_W5500 1
#define CONFIG_ETH_SPI_ETHERNET_DM9051 1
#define CONFIG_ETH_USE_ESP32_EMAC 1
#define USE_ETHERNET_MANUAL_IP
#define USE_ETHERNET_IP_STATE_LISTENERS
#define USE_ETHERNET_CONNECT_TRIGGER