From a3070f6c2a6057182a8972d3980cd47eb95df669 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Tue, 12 Apr 2022 20:05:41 -0700 Subject: [PATCH] Changes to Pin Mappings --- ports/espressif/boards/lolin_c3_mini/board.c | 4 +-- .../boards/lolin_c3_mini/mpconfigboard.h | 4 +++ .../boards/lolin_c3_mini/mpconfigboard.mk | 4 +-- ports/espressif/boards/lolin_c3_mini/pins.c | 26 ++++++++++++++----- .../espressif/boards/lolin_c3_mini/sdkconfig | 3 +-- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/board.c b/ports/espressif/boards/lolin_c3_mini/board.c index 0432485111..d77b968d3e 100644 --- a/ports/espressif/boards/lolin_c3_mini/board.c +++ b/ports/espressif/boards/lolin_c3_mini/board.c @@ -31,8 +31,8 @@ void board_init(void) { // Debug UART #ifdef DEBUG - common_hal_never_reset_pin(&pin_GPIO43); - common_hal_never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO21); #endif /* DEBUG */ } diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index 5c253a4d33..3956d2c5b0 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -42,3 +42,7 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO20) #define DEFAULT_UART_BUS_TX (&pin_GPIO21) + +// // Serial over UART +#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index b745b2d29e..60c8639232 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x303A USB_PID = 0x80F5 -USB_PRODUCT = "C3 Mini" -USB_MANUFACTURER = "Lolin" +USB_PRODUCT = "Lolin C3 Mini" +USB_MANUFACTURER = "Wemos" IDF_TARGET = esp32c3 diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index fcbb97232c..230ed31b9f 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -7,25 +7,32 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // From Wemos C3 Mini Schematic // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf // Starting on Left side going counterclockwise - // And MP Config + // MP Config // https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI + // C3 Data Sheet + // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf // 1: LAN_IN // 2: VDD3P3 // 3: VDD3P3 + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },// Reset Button { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, // 4: GPIO0/32K_P/A0 { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, // 5: GPIO1/32K_N/A1 { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, // 6: GPIO2/A2/FSPIQ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO2) }, // mpboardconfig.h + // 7: CHIP_EN + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, // 8: GPIO3/A3 { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // 9: GPIO4/A4/FSPIHD/MTMS { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // 10: GPIO5/A2_0/FSPIWP/MTDI { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, // Board screen has A5, Schematic has A2_0 (huh?) - // 11: VDD3P3_RTC + + // 11: VDD3P3_RTC: Input power supply for RTC + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // 12: GPIO6/FSPICLK/MTCK { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // 13: GPIO7/FSPID/MTD0 @@ -34,24 +41,29 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // 15: GPIO9 { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, // 16: GPIO10/FSPICS0 { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO10) }, // mpboardconfig.h - // 17: VDD3P3_CPJ + + // 17: VDD3P3_CPU: Input power supply for CPU IO // 18: VDD_SPI + + // Ports of embedded flash for ESP32-C3FH4 // 19: SPIHD // 20: SPIWP // 21: SPICSO // 22: SPICLK // 23: SPID // 24: SPIQ - // Used for USB 25: GPIO18/D- - // Used for USB 26: GPIO19/D+ + + // 25: GPIO18/D-: Used for USB + // 26: GPIO19/D+: Used for USB + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, // 27: GPIO20/U0RXD - { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, // 28: GPIO21/U0TXD - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + // 29: XTAL_N // 30: XTAL_P // 31: VDDA // 32: VDDA + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },// board singleton implicit from schematic/shield standard }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index b96cda80a6..833f8368fa 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,6 +1,5 @@ -# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set # # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="LC3Mini" +CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" # end of LWIP