ESPHome  2022.11.3
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
esphome::ethernet::EthernetComponent Class Reference

#include <ethernet_component.h>

Inheritance diagram for esphome::ethernet::EthernetComponent:

Public Member Functions

 EthernetComponent ()
void setup () override
void loop () override
void dump_config () override
float get_setup_priority () const override
bool can_proceed () override
bool is_connected ()
void set_phy_addr (uint8_t phy_addr)
void set_power_pin (GPIOPin *power_pin)
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_manual_ip (const ManualIP &manual_ip)
network::IPAddress get_ip_address ()
std::string get_use_address () const
void set_use_address (const std::string &use_address)
- Public Member Functions inherited from esphome::Component
float get_actual_setup_priority () const
void set_setup_priority (float priority)
virtual float get_loop_priority () const
 priority of loop(). More...
void call ()
virtual void on_shutdown ()
virtual void on_safe_shutdown ()
uint32_t get_component_state () const
virtual void mark_failed ()
 Mark this component as failed. More...
bool is_failed ()
bool status_has_warning ()
bool status_has_error ()
void status_set_warning ()
void status_set_error ()
void status_clear_warning ()
void status_clear_error ()
void status_momentary_warning (const std::string &name, uint32_t length=5000)
void status_momentary_error (const std::string &name, uint32_t length=5000)
bool has_overridden_loop () const
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...

Protected Member Functions

void on_wifi_event_ (system_event_id_t event, system_event_info_t info)
void start_connect_ ()
void dump_connect_params_ ()
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
virtual void call_setup ()
virtual void call_dump_config ()
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
void set_interval (uint32_t interval, std::function< void()> &&f)
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
void set_timeout (uint32_t timeout, std::function< void()> &&f)
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...

Static Protected Member Functions

static void eth_phy_config_gpio ()
static void eth_phy_power_enable (bool enable)

Protected Attributes

std::string use_address_
uint8_t phy_addr_ {0}
GPIOPinpower_pin_ {nullptr}
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}
optional< ManualIPmanual_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_
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
float setup_priority_override_ {NAN}
const char * component_source_ {nullptr}

Detailed Description

Definition at line 37 of file ethernet_component.h.

Constructor & Destructor Documentation

◆ EthernetComponent()

esphome::ethernet::EthernetComponent::EthernetComponent ( )

Definition at line 36 of file ethernet_component.cpp.

Member Function Documentation

◆ can_proceed()

bool esphome::ethernet::EthernetComponent::can_proceed ( )

Reimplemented from esphome::Component.

Definition at line 156 of file ethernet_component.cpp.

◆ dump_config()

void esphome::ethernet::EthernetComponent::dump_config ( )

Reimplemented from esphome::Component.

Definition at line 126 of file ethernet_component.cpp.

◆ dump_connect_params_()

void esphome::ethernet::EthernetComponent::dump_connect_params_ ( )

Definition at line 261 of file ethernet_component.cpp.

◆ eth_phy_config_gpio()

void esphome::ethernet::EthernetComponent::eth_phy_config_gpio ( )

Definition at line 247 of file ethernet_component.cpp.

◆ eth_phy_power_enable()

void esphome::ethernet::EthernetComponent::eth_phy_power_enable ( bool  enable)

Definition at line 252 of file ethernet_component.cpp.

◆ get_ip_address()

network::IPAddress esphome::ethernet::EthernetComponent::get_ip_address ( )

Definition at line 158 of file ethernet_component.cpp.

◆ get_setup_priority()

float esphome::ethernet::EthernetComponent::get_setup_priority ( ) const

Reimplemented from esphome::Component.

Definition at line 154 of file ethernet_component.cpp.

◆ get_use_address()

std::string esphome::ethernet::EthernetComponent::get_use_address ( ) const

Definition at line 296 of file ethernet_component.cpp.

◆ is_connected()

bool esphome::ethernet::EthernetComponent::is_connected ( )

Definition at line 259 of file ethernet_component.cpp.

◆ loop()

void esphome::ethernet::EthernetComponent::loop ( )

Reimplemented from esphome::Component.

Definition at line 86 of file ethernet_component.cpp.

◆ on_wifi_event_()

void esphome::ethernet::EthernetComponent::on_wifi_event_ ( system_event_id_t  event,
system_event_info_t  info 

Definition at line 164 of file ethernet_component.cpp.

◆ set_clk_mode()

void esphome::ethernet::EthernetComponent::set_clk_mode ( eth_clock_mode_t  clk_mode)

Definition at line 293 of file ethernet_component.cpp.

◆ set_manual_ip()

void esphome::ethernet::EthernetComponent::set_manual_ip ( const ManualIP manual_ip)

Definition at line 294 of file ethernet_component.cpp.

◆ set_mdc_pin()

void esphome::ethernet::EthernetComponent::set_mdc_pin ( uint8_t  mdc_pin)

Definition at line 290 of file ethernet_component.cpp.

◆ set_mdio_pin()

void esphome::ethernet::EthernetComponent::set_mdio_pin ( uint8_t  mdio_pin)

Definition at line 291 of file ethernet_component.cpp.

◆ set_phy_addr()

void esphome::ethernet::EthernetComponent::set_phy_addr ( uint8_t  phy_addr)

Definition at line 288 of file ethernet_component.cpp.

◆ set_power_pin()

void esphome::ethernet::EthernetComponent::set_power_pin ( GPIOPin power_pin)

Definition at line 289 of file ethernet_component.cpp.

◆ set_type()

void esphome::ethernet::EthernetComponent::set_type ( EthernetType  type)

Definition at line 292 of file ethernet_component.cpp.

◆ set_use_address()

void esphome::ethernet::EthernetComponent::set_use_address ( const std::string &  use_address)

Definition at line 303 of file ethernet_component.cpp.

◆ setup()

void esphome::ethernet::EthernetComponent::setup ( )

Reimplemented from esphome::Component.

Definition at line 38 of file ethernet_component.cpp.

◆ start_connect_()

void esphome::ethernet::EthernetComponent::start_connect_ ( )

Definition at line 195 of file ethernet_component.cpp.

Field Documentation

◆ clk_mode_

eth_clock_mode_t esphome::ethernet::EthernetComponent::clk_mode_ {ETH_CLOCK_GPIO0_IN}

Definition at line 73 of file ethernet_component.h.

◆ connect_begin_

uint32_t esphome::ethernet::EthernetComponent::connect_begin_

Definition at line 79 of file ethernet_component.h.

◆ connected_

bool esphome::ethernet::EthernetComponent::connected_ {false}

Definition at line 77 of file ethernet_component.h.

◆ eth_config_

eth_config_t esphome::ethernet::EthernetComponent::eth_config_

Definition at line 80 of file ethernet_component.h.

◆ manual_ip_

optional<ManualIP> esphome::ethernet::EthernetComponent::manual_ip_ {}

Definition at line 74 of file ethernet_component.h.

◆ mdc_pin_

uint8_t esphome::ethernet::EthernetComponent::mdc_pin_ {23}

Definition at line 70 of file ethernet_component.h.

◆ mdio_pin_

uint8_t esphome::ethernet::EthernetComponent::mdio_pin_ {18}

Definition at line 71 of file ethernet_component.h.

◆ orig_power_enable_fun_

eth_phy_power_enable_func esphome::ethernet::EthernetComponent::orig_power_enable_fun_

Definition at line 81 of file ethernet_component.h.

◆ phy_addr_

uint8_t esphome::ethernet::EthernetComponent::phy_addr_ {0}

Definition at line 68 of file ethernet_component.h.

◆ power_pin_

GPIOPin* esphome::ethernet::EthernetComponent::power_pin_ {nullptr}

Definition at line 69 of file ethernet_component.h.

◆ started_

bool esphome::ethernet::EthernetComponent::started_ {false}

Definition at line 76 of file ethernet_component.h.

◆ state_

EthernetComponentState esphome::ethernet::EthernetComponent::state_ {EthernetComponentState::STOPPED}

Definition at line 78 of file ethernet_component.h.

◆ type_

EthernetType esphome::ethernet::EthernetComponent::type_ {ETHERNET_TYPE_LAN8720}

Definition at line 72 of file ethernet_component.h.

◆ use_address_

std::string esphome::ethernet::EthernetComponent::use_address_

Definition at line 67 of file ethernet_component.h.

The documentation for this class was generated from the following files: