1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

Remove manual handling of ethernet power pin (#4062)

This commit is contained in:
Jesse Hills
2022-11-23 09:43:43 +13:00
committed by GitHub
parent 7258a82875
commit 0f9c956c04
3 changed files with 9 additions and 26 deletions

View File

@@ -45,7 +45,7 @@ class EthernetComponent : public Component {
bool is_connected();
void set_phy_addr(uint8_t phy_addr);
void set_power_pin(GPIOPin *power_pin);
void set_power_pin(int power_pin);
void set_mdc_pin(uint8_t mdc_pin);
void set_mdio_pin(uint8_t mdio_pin);
void set_type(EthernetType type);
@@ -63,11 +63,9 @@ class EthernetComponent : public Component {
void start_connect_();
void dump_connect_params_();
static esp_err_t eth_phy_power_control(esp_eth_phy_t *phy, bool enable);
std::string use_address_;
uint8_t phy_addr_{0};
GPIOPin *power_pin_{nullptr};
int power_pin_{-1};
uint8_t mdc_pin_{23};
uint8_t mdio_pin_{18};
EthernetType type_{ETHERNET_TYPE_LAN8720};
@@ -80,8 +78,6 @@ class EthernetComponent : public Component {
uint32_t connect_begin_;
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)