Skip to content

Commit

Permalink
feat(eth_init): added Generic 802.3 PHY as supported device
Browse files Browse the repository at this point in the history
  • Loading branch information
kostaond committed Oct 30, 2024
1 parent 047629a commit 31293b5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ethernet_init/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ menu "Ethernet Configuration"
help
Select the Ethernet PHY device to use.

config ETHERNET_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 ETHERNET_PHY_IP101
bool "IP101"
help
Expand Down
3 changes: 3 additions & 0 deletions ethernet_init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This component makes it easier to set up and control Ethernet connections in Esp
It also allows users to select from various supported Ethernet chips, making development faster.

Supported devices are:
* Generic 802.3 PHY (any Ethernet PHY chip compliant with IEEE 802.3)
* IP101
* RTL8201/SR8201
* LAN87xx
Expand All @@ -16,6 +17,8 @@ Supported devices are:
* ENC28J60 Module
* CH390 Module

> ⚠️ **Warning**: When selecting `Generic 802.3 PHY`, basic functionality should always work for PHY compliant with IEEE 802.3. However, some specific features might be limited. A typical example is loopback functionality, where certain PHYs may require setting a specific speed mode to operate correctly.
## API

### Steps to use the component in an example code:
Expand Down
4 changes: 3 additions & 1 deletion ethernet_init/ethernet_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ static esp_eth_handle_t eth_init_internal(eth_device *dev_out)
phy_config.reset_gpio_num = CONFIG_ETHERNET_PHY_RST_GPIO;

// Create new PHY instance based on board configuration
#if CONFIG_ETHERNET_PHY_IP101
#if CONFIG_ETHERNET_PHY_GENERIC
dev_out->phy = esp_eth_phy_new_generic(&phy_config);
#elif CONFIG_ETHERNET_PHY_IP101
dev_out->phy = esp_eth_phy_new_ip101(&phy_config);
sprintf(dev_out->dev_info.name, "IP101");
#elif CONFIG_ETHERNET_PHY_RTL8201
Expand Down
2 changes: 1 addition & 1 deletion ethernet_init/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ examples:
- path: ../common_examples/
description: This component initializes Ethernet driver based on Espressif IoT Development Framework Configuration.
url: https://github.com/espressif/esp-eth-drivers/tree/master/ethernet_init
version: 0.3.2
version: 0.3.3

0 comments on commit 31293b5

Please sign in to comment.