mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
[ethernet] Address additional review feedback
- Remove dead ENC28J60 entry from _IDF6_ETHERNET_COMPONENTS - Simplify get_duplex_mode() — both chips are full-duplex on RP2040 - Add #error guard for unsupported RP2040 SPI Ethernet type
This commit is contained in:
@@ -157,7 +157,6 @@ _IDF6_ETHERNET_COMPONENTS: dict[str, IDFRegistryComponent] = {
|
||||
"KSZ8081RNA": IDFRegistryComponent("espressif/ksz80xx", "1.0.0"),
|
||||
"W5500": IDFRegistryComponent("espressif/w5500", "1.0.1"),
|
||||
"DM9051": IDFRegistryComponent("espressif/dm9051", "1.0.0"),
|
||||
"ENC28J60": IDFRegistryComponent("espressif/enc28j60", "1.0.1"),
|
||||
}
|
||||
|
||||
SPI_ETHERNET_TYPES = ["W5500", "DM9051", "ENC28J60"]
|
||||
|
||||
@@ -27,6 +27,8 @@ extern "C" eth_esp32_emac_config_t eth_esp32_emac_default_config(void);
|
||||
#include <W5500lwIP.h>
|
||||
#elif defined(USE_ETHERNET_ENC28J60)
|
||||
#include <ENC28J60lwIP.h>
|
||||
#else
|
||||
#error "Unsupported RP2040 SPI Ethernet type"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -224,6 +226,8 @@ class EthernetComponent final : public Component {
|
||||
Wiznet5500lwIP *eth_{nullptr};
|
||||
#elif defined(USE_ETHERNET_ENC28J60)
|
||||
ENC28J60lwIP *eth_{nullptr};
|
||||
#else
|
||||
#error "Unsupported RP2040 SPI Ethernet type"
|
||||
#endif
|
||||
uint32_t last_link_check_{0};
|
||||
uint8_t clk_pin_;
|
||||
|
||||
@@ -226,13 +226,8 @@ const char *EthernetComponent::get_eth_mac_address_pretty_into_buffer(
|
||||
}
|
||||
|
||||
eth_duplex_t EthernetComponent::get_duplex_mode() {
|
||||
#ifdef USE_ETHERNET_ENC28J60
|
||||
// ENC28J60 is configured for full-duplex by the arduino-pico driver
|
||||
// Both W5500 and ENC28J60 are full-duplex on RP2040
|
||||
return ETH_DUPLEX_FULL;
|
||||
#else
|
||||
// W5500 is always full duplex
|
||||
return ETH_DUPLEX_FULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
eth_speed_t EthernetComponent::get_link_speed() {
|
||||
|
||||
Reference in New Issue
Block a user