11 #include "esp_eth_mac.h" 12 #include "esp_netif.h" 46 void setup()
override;
48 void dump_config()
override;
49 float get_setup_priority()
const override;
50 bool can_proceed()
override;
54 #ifdef USE_ETHERNET_SPI 55 void set_clk_pin(uint8_t clk_pin);
56 void set_miso_pin(uint8_t miso_pin);
57 void set_mosi_pin(uint8_t mosi_pin);
58 void set_cs_pin(uint8_t cs_pin);
59 void set_interrupt_pin(uint8_t interrupt_pin);
60 void set_reset_pin(uint8_t reset_pin);
61 void set_clock_speed(
int clock_speed);
63 void set_phy_addr(uint8_t phy_addr);
64 void set_power_pin(
int power_pin);
65 void set_mdc_pin(uint8_t mdc_pin);
66 void set_mdio_pin(uint8_t mdio_pin);
67 void set_clk_mode(emac_rmii_clock_mode_t clk_mode, emac_rmii_clock_gpio_t clk_gpio);
70 void set_manual_ip(
const ManualIP &manual_ip);
74 void set_use_address(
const std::string &use_address);
78 static void eth_event_handler(
void *arg, esp_event_base_t event_base, int32_t
event_id,
void *event_data);
79 static void got_ip_event_handler(
void *arg, esp_event_base_t event_base, int32_t event_id,
void *event_data);
81 static void got_ip6_event_handler(
void *arg, esp_event_base_t event_base, int32_t event_id,
void *event_data);
84 void start_connect_();
85 void dump_connect_params_();
87 void ksz8081_set_clock_reference_(esp_eth_mac_t *mac);
90 #ifdef USE_ETHERNET_SPI 97 int phy_addr_spi_{-1};
100 uint8_t phy_addr_{0};
102 uint8_t mdc_pin_{23};
103 uint8_t mdio_pin_{18};
104 emac_rmii_clock_mode_t clk_mode_{EMAC_CLK_EXT_IN};
105 emac_rmii_clock_gpio_t clk_gpio_{EMAC_CLK_IN_GPIO};
110 bool started_{
false};
111 bool connected_{
false};
112 bool got_ipv4_address_{
false};
114 uint8_t ipv6_count_{0};
118 esp_netif_t *eth_netif_{
nullptr};
120 esp_eth_phy_t *phy_{
nullptr};
network::IPAddress dns1
The first DNS server. 0.0.0.0 for default.
esp_eth_phy_t * esp_eth_phy_new_jl1101(const eth_phy_config_t *config)
network::IPAddress gateway
std::string get_use_address()
Get the active network hostname.
network::IPAddress subnet
bool is_connected()
Return whether the node is connected to the network (through wifi, eth, ...)
EthernetComponent * global_eth_component
network::IPAddresses get_ip_addresses()
network::IPAddress dns2
The second DNS server. 0.0.0.0 for default.
network::IPAddress static_ip
std::array< IPAddress, 5 > IPAddresses
void on_shutdown() override
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
esp_eth_handle_t eth_handle_