diff options
| author | Petr KracĂk <petrkr@petrkr.net> | 2019-02-17 11:46:23 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2019-02-21 23:28:17 +1100 |
| commit | 7d8c71c222ed7793c99792eb15966504e039dae4 (patch) | |
| tree | 1bb4f0d565d3389d96360d9721473c680c0f8495 /ports/esp32/modnetwork.c | |
| parent | be41d6d6f95a7dc5874e2c6e13443bcc39d5dea8 (diff) | |
esp32/network_lan: Add arg to constructor to set clock mode for ETH PHY.
This optional parameter for network.LAN clock_mode can be used for cases
where the clock source is different from the default GPIO0. Fixes #4502.
Diffstat (limited to 'ports/esp32/modnetwork.c')
| -rw-r--r-- | ports/esp32/modnetwork.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ports/esp32/modnetwork.c b/ports/esp32/modnetwork.c index 6342f336b..1048a487f 100644 --- a/ports/esp32/modnetwork.c +++ b/ports/esp32/modnetwork.c @@ -41,6 +41,7 @@ #include "py/mphal.h" #include "py/mperrno.h" #include "netutils.h" +#include "esp_eth.h" #include "esp_wifi.h" #include "esp_wifi_types.h" #include "esp_log.h" @@ -697,6 +698,14 @@ STATIC const mp_rom_map_elem_t mp_module_network_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PHY_LAN8720), MP_ROM_INT(PHY_LAN8720) }, { MP_ROM_QSTR(MP_QSTR_PHY_TLK110), MP_ROM_INT(PHY_TLK110) }, + // ETH Clock modes from ESP-IDF + { MP_ROM_QSTR(MP_QSTR_ETH_CLOCK_GPIO0_IN), MP_ROM_INT(ETH_CLOCK_GPIO0_IN) }, + // Disabled at Aug 22nd 2018, reenabled Jan 28th 2019 in ESP-IDF + // Because we use older SDK, it's currently disabled + //{ MP_ROM_QSTR(MP_QSTR_ETH_CLOCK_GPIO0_OUT), MP_ROM_INT(ETH_CLOCK_GPIO0_OUT) }, + { MP_ROM_QSTR(MP_QSTR_ETH_CLOCK_GPIO16_OUT), MP_ROM_INT(ETH_CLOCK_GPIO16_OUT) }, + { MP_ROM_QSTR(MP_QSTR_ETH_CLOCK_GPIO17_OUT), MP_ROM_INT(ETH_CLOCK_GPIO17_OUT) }, + { MP_ROM_QSTR(MP_QSTR_STAT_IDLE), MP_ROM_INT(STAT_IDLE)}, { MP_ROM_QSTR(MP_QSTR_STAT_CONNECTING), MP_ROM_INT(STAT_CONNECTING)}, { MP_ROM_QSTR(MP_QSTR_STAT_GOT_IP), MP_ROM_INT(STAT_GOT_IP)}, |
