Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethernet: Config by code instead KConfig (IDFGH-4761) #6564

Closed
petrkr opened this issue Feb 18, 2021 · 1 comment
Closed

Ethernet: Config by code instead KConfig (IDFGH-4761) #6564

petrkr opened this issue Feb 18, 2021 · 1 comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@petrkr
Copy link

petrkr commented Feb 18, 2021

Is possible initialize ethernet from code instead from KConfig how that was in IDF 3.x by some easy way than rewrite https://github.com/espressif/esp-idf/blob/v4.2/components/esp_eth/src/esp_eth_mac_esp32.c#L287 from scratch? Namely we need be able choose PHY, MDIO, MDC and CLOCK TYPE from code. It is not possible to maintain more binaries with hard-coded matrix. It's needed for micropython micropython/micropython#5265 (comment)

@petrkr petrkr added the Type: Feature Request Feature request for IDF label Feb 18, 2021
@github-actions github-actions bot changed the title Ethernet: Config by code instead KConfig Ethernet: Config by code instead KConfig (IDFGH-4761) Feb 18, 2021
@igrr
Copy link
Member

igrr commented Feb 18, 2021

@petrkr The MDIO and MDC can be passed in eth_mac_config_t structure to esp_eth_mac_new_esp32:

mac_config.smi_mdc_gpio_num = CONFIG_EXAMPLE_ETH_MDC_GPIO;
mac_config.smi_mdio_gpio_num = CONFIG_EXAMPLE_ETH_MDIO_GPIO;

PHY can also be chosen by calling one of esp_eth_phy_new_* functions:

esp_eth_phy_t *phy = esp_eth_phy_new_ip101(&phy_config);
.

The choice between clock modes is indeed compile-only at the moment. Agree that it makes sense to have it run-time configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

3 participants