EmbeddedEthernet Class Reference

Ethernet provider using ESP32 embedded MAC. Requires an external PHY. More...

#include <EmbeddedEthernet.h>

Inheritance diagram for EmbeddedEthernet:
Collaboration diagram for EmbeddedEthernet:

Classes

struct  Config
 

Public Member Functions

bool begin (const Config &config)
 Configure and start the ethernet service. More...
 
- Public Member Functions inherited from Ethernet::IdfService
 IdfService (PhyFactory &phyFactory)
 
void end () override
 Tear down the ethernet connection. More...
 
MacAddress getMacAddress () const override
 Get MAC address. More...
 
bool setMacAddress (const MacAddress &addr) override
 Set MAC address. More...
 
bool setSpeed (Ethernet::Speed speed) override
 Set speed of MAC. More...
 
bool setFullDuplex (bool enable) override
 Set duplex mode of MAC. More...
 
bool setLinkState (bool up) override
 Set link status of MAC. More...
 
bool setPromiscuous (bool enable) override
 Set MAC promiscuous mode. More...
 
void setHostname (const String &hostname) override
 Set DHCP hostname. More...
 
String getHostname () const override
 Get DHCP hostname. More...
 
IpAddress getIP () const override
 Get current IP address. More...
 
bool setIP (IpAddress address, IpAddress netmask, IpAddress gateway) override
 Set static IP address. More...
 
bool isEnabledDHCP () const override
 Determine if DHCP is active for this interface. More...
 
bool enableDHCP (bool enable) override
 Enable/disable DHCP on this interface. More...
 
- Public Member Functions inherited from Ethernet::Service
void onEvent (EventDelegate callback)
 Set callback for ethernet events. More...
 
void onGotIp (GotIpDelegate callback)
 Set callback for 'station connected with IP address' event. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ethernet::IdfService
void enableEventCallback (bool enable)
 
void enableGotIpCallback (bool enable)
 
- Protected Attributes inherited from Ethernet::IdfService
PhyFactoryphyFactory
 
void * handle {nullptr}
 
esp_netif_obj * netif {nullptr}
 
void * netif_glue {nullptr}
 
esp_eth_mac_s * mac {nullptr}
 
esp_eth_phy_s * phy {nullptr}
 
Event state {Event::Disconnected}
 
- Protected Attributes inherited from Ethernet::Service
EventDelegate eventCallback
 
GotIpDelegate gotIpCallback
 

Detailed Description

Ethernet provider using ESP32 embedded MAC. Requires an external PHY.

See https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-reference/network/esp_eth.html.

These are the reduced (RMII) PHY connections. Note that the high-speed signals may not be re-allocated.

    Signal    GPIO  Direction
    ------    ----  ---------
    TXD0      19    OUT
    TXD1      22    OUT
    TX_EN     21    OUT
    RXD0      25    IN
    RXD1      26    IN
    CRS_DV    27    IN
   Receive Data Valid
    MDC       23    OUT: configurable
    MDIO      18    OUT: configurable
    CLK_MII   0     IN:  No other pins supported
                 OUT: alternate pins: 16, 17
   50MHz clock provided either by the PHY or the MAC. Default is PHY.

Note: Configuring clock options must be done via SDK (make sdk-menuconfig). ESP-IDF v4.4 will add the ability to override these in software.

The following connections are optional:

    PHY_RESET -     OUT (set via PhyConfig)

Member Function Documentation

◆ begin()

bool EmbeddedEthernet::begin ( const Config config)

Configure and start the ethernet service.

Parameters
configConfiguration options

Applications should expect to receive Start and Connected events following this call.


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