Skip to content

esp32/network_lan: Default EMAC LAN() arguments per board. #19037

@sfe-SparkFro

Description

@sfe-SparkFro

Description

Comparing the networking options for ESP32, WLAN() is nice since it doesn't require any arguments, whereas EMAC-based LAN() requires 4 arguments (mdc, mdio, phy_type, and phy_addr) that can force the user to dive into board schematics and PHY datasheets to determine correct values for those arguments.

I propose enabling mpconfigboard.h to define default values for these 4 arguments so the user can simply call LAN() with no parameters to construct a valid object for their board. This would also apply to the changes in #19036. The GENERIC boards can default to those used by Espressif's dev boards.

I'm not sure whether it would be feasible to do the same for SPI-based LAN(). The phy_type and phy_addr could have defaults in mpconfigboard.h, but I don't know how the SPI arguments could be specified.

Code Size

This would have minimal impact on code size, if at all.

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationsport-esp32

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions