feat(esp_eth): added new generic PHY driver
This commit is contained in:
@@ -17,6 +17,15 @@ menu "Example Ethernet Configuration"
|
||||
help
|
||||
Select the Ethernet PHY device to use in the example.
|
||||
|
||||
config EXAMPLE_ETH_PHY_GENERIC
|
||||
bool "Generic 802.3 PHY"
|
||||
help
|
||||
Any Ethernet PHY chip compliant with IEEE 802.3 can be used. However, while
|
||||
basic functionality should always work, some specific features might be limited,
|
||||
even if the PHY meets IEEE 802.3 standard. A typical example is loopback
|
||||
functionality, where certain PHYs may require setting a specific speed mode to
|
||||
operate correctly.
|
||||
|
||||
config EXAMPLE_ETH_PHY_IP101
|
||||
bool "IP101"
|
||||
help
|
||||
|
||||
@@ -83,7 +83,9 @@ static esp_eth_handle_t eth_init_internal(esp_eth_mac_t **mac_out, esp_eth_phy_t
|
||||
// Create new ESP32 Ethernet MAC instance
|
||||
esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
|
||||
// Create new PHY instance based on board configuration
|
||||
#if CONFIG_EXAMPLE_ETH_PHY_IP101
|
||||
#if CONFIG_EXAMPLE_ETH_PHY_GENERIC
|
||||
esp_eth_phy_t *phy = esp_eth_phy_new_generic(&phy_config);
|
||||
#elif CONFIG_EXAMPLE_ETH_PHY_IP101
|
||||
esp_eth_phy_t *phy = esp_eth_phy_new_ip101(&phy_config);
|
||||
#elif CONFIG_EXAMPLE_ETH_PHY_RTL8201
|
||||
esp_eth_phy_t *phy = esp_eth_phy_new_rtl8201(&phy_config);
|
||||
|
||||
@@ -10,6 +10,7 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.parametrize('config', [
|
||||
pytest.param('default_ip101', marks=[pytest.mark.ethernet_router]),
|
||||
pytest.param('default_generic', marks=[pytest.mark.ethernet_router]),
|
||||
pytest.param('default_dm9051', marks=[pytest.mark.eth_dm9051]),
|
||||
], indirect=True)
|
||||
def test_esp_eth_basic(
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
|
||||
CONFIG_EXAMPLE_ETH_PHY_GENERIC=y
|
||||
CONFIG_EXAMPLE_ETH_MDC_GPIO=23
|
||||
CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
|
||||
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
|
||||
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
|
||||
|
||||
CONFIG_ETH_ENABLED=y
|
||||
CONFIG_ETH_USE_ESP32_EMAC=y
|
||||
CONFIG_ETH_PHY_INTERFACE_RMII=y
|
||||
CONFIG_ETH_RMII_CLK_INPUT=y
|
||||
Reference in New Issue
Block a user