mirror of
https://github.com/esphome/esphome.git
synced 2025-11-19 08:15:49 +00:00
Update esp32 arduino and platform versions (#3564)
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
|
||||
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/components/network/ip_address.h"
|
||||
|
||||
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
|
||||
|
||||
#include "esp_eth.h"
|
||||
#include <esp_wifi.h>
|
||||
#include <WiFiType.h>
|
||||
#include <WiFi.h>
|
||||
#include "esp_eth_mac.h"
|
||||
#include "esp_netif.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ethernet {
|
||||
|
||||
enum EthernetType {
|
||||
ETHERNET_TYPE_LAN8720 = 0,
|
||||
ETHERNET_TYPE_TLK110,
|
||||
ETHERNET_TYPE_RTL8201,
|
||||
ETHERNET_TYPE_DP83848,
|
||||
ETHERNET_TYPE_IP101,
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ class EthernetComponent : public Component {
|
||||
void set_mdc_pin(uint8_t mdc_pin);
|
||||
void set_mdio_pin(uint8_t mdio_pin);
|
||||
void set_type(EthernetType type);
|
||||
void set_clk_mode(eth_clock_mode_t clk_mode);
|
||||
void set_clk_mode(emac_rmii_clock_gpio_t clk_mode);
|
||||
void set_manual_ip(const ManualIP &manual_ip);
|
||||
|
||||
network::IPAddress get_ip_address();
|
||||
@@ -57,12 +57,13 @@ class EthernetComponent : public Component {
|
||||
void set_use_address(const std::string &use_address);
|
||||
|
||||
protected:
|
||||
void on_wifi_event_(system_event_id_t event, system_event_info_t info);
|
||||
static void eth_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
|
||||
static void got_ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
|
||||
|
||||
void start_connect_();
|
||||
void dump_connect_params_();
|
||||
|
||||
static void eth_phy_config_gpio();
|
||||
static void eth_phy_power_enable(bool enable);
|
||||
static esp_err_t eth_phy_power_control(esp_eth_phy_t *phy, bool enable);
|
||||
|
||||
std::string use_address_;
|
||||
uint8_t phy_addr_{0};
|
||||
@@ -70,15 +71,17 @@ class EthernetComponent : public Component {
|
||||
uint8_t mdc_pin_{23};
|
||||
uint8_t mdio_pin_{18};
|
||||
EthernetType type_{ETHERNET_TYPE_LAN8720};
|
||||
eth_clock_mode_t clk_mode_{ETH_CLOCK_GPIO0_IN};
|
||||
emac_rmii_clock_gpio_t clk_mode_{EMAC_CLK_IN_GPIO};
|
||||
optional<ManualIP> manual_ip_{};
|
||||
|
||||
bool started_{false};
|
||||
bool connected_{false};
|
||||
EthernetComponentState state_{EthernetComponentState::STOPPED};
|
||||
uint32_t connect_begin_;
|
||||
eth_config_t eth_config_;
|
||||
eth_phy_power_enable_func orig_power_enable_fun_;
|
||||
esp_netif_t *eth_netif_{nullptr};
|
||||
esp_eth_handle_t eth_handle_;
|
||||
|
||||
std::function<esp_err_t(esp_eth_phy_t *, bool)> orig_power_control_fun_;
|
||||
};
|
||||
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
Reference in New Issue
Block a user