From 9c933558b554a564e68673f9ecab5f3fe2fd44fa Mon Sep 17 00:00:00 2001 From: lady ada Date: Thu, 23 Dec 2021 18:19:34 -0500 Subject: [PATCH 01/15] enable I2C by default --- ports/espressif/boards/adafruit_feather_esp32s2/board.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/board.c b/ports/espressif/boards/adafruit_feather_esp32s2/board.c index 93aff5067d12..71c7663fdc2c 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/board.c @@ -33,6 +33,10 @@ void board_init(void) { // USB common_hal_never_reset_pin(&pin_GPIO19); common_hal_never_reset_pin(&pin_GPIO20); + + // Turn on I2C + gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(7, false); } bool board_requests_safe_mode(void) { From 647b894e7b015accae6c1ea7e3e4d0bd52b099c1 Mon Sep 17 00:00:00 2001 From: lady ada Date: Thu, 23 Dec 2021 18:57:33 -0500 Subject: [PATCH 02/15] ?? some include needed --- ports/espressif/boards/adafruit_feather_esp32s2/board.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/board.c b/ports/espressif/boards/adafruit_feather_esp32s2/board.c index 71c7663fdc2c..13f2a751c3ec 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/board.c @@ -28,6 +28,8 @@ #include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" #include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" void board_init(void) { // USB From 8b26f594c9d4a7f108d3bd9a6bf70df13e7096cf Mon Sep 17 00:00:00 2001 From: lady ada Date: Thu, 23 Dec 2021 19:40:46 -0500 Subject: [PATCH 03/15] try not resetting i2c power --- ports/espressif/boards/adafruit_feather_esp32s2/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/board.c b/ports/espressif/boards/adafruit_feather_esp32s2/board.c index 13f2a751c3ec..be678c23ab4c 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/board.c @@ -37,6 +37,7 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO20); // Turn on I2C + common_hal_never_reset_pin(&pin_GPIO7); gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT); gpio_set_level(7, false); } From 4400124efefa7d48dc5a940ee5c74f113d326693 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 25 Dec 2021 02:16:25 -0500 Subject: [PATCH 04/15] snappysnap --- .../boards/adafruit_esp32s2_camera/board.c | 117 ++++++++++++++++++ .../adafruit_esp32s2_camera/mpconfigboard.h | 46 +++++++ .../adafruit_esp32s2_camera/mpconfigboard.mk | 19 +++ .../boards/adafruit_esp32s2_camera/pins.c | 49 ++++++++ .../boards/adafruit_esp32s2_camera/sdkconfig | 33 +++++ 5 files changed, 264 insertions(+) create mode 100644 ports/espressif/boards/adafruit_esp32s2_camera/board.c create mode 100644 ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h create mode 100644 ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk create mode 100644 ports/espressif/boards/adafruit_esp32s2_camera/pins.c create mode 100644 ports/espressif/boards/adafruit_esp32s2_camera/sdkconfig diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c new file mode 100644 index 000000000000..1686f531e2e8 --- /dev/null +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -0,0 +1,117 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +#include "esp_log.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0x01, 0 | DELAY, 150, // SWRESET + 0x11, 0 | DELAY, 255, // SLPOUT + 0x36, 1, 0b10100000, // _MADCTL for rotation 0 + 0x3a, 1, 0x55, // COLMOD - 16bit color + 0x21, 0 | DELAY, 10, // _INVON + 0x13, 0 | DELAY, 10, // _NORON + 0x29, 0 | DELAY, 255, // _DISPON +}; + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_GPIO39, // TFT_DC Command or data + &pin_GPIO40, // TFT_CS Chip select + &pin_GPIO41, // TFT_RESET Reset + 5000000, // Baudrate + 0, // Polarity + 0); // Phase + + // workaround as board_init() is called before reset_port() in main.c + pwmout_reset(); + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct( + display, + bus, + 240, // Width (after rotation) + 240, // Height (after rotation) + 80, // column start + 0, // row start + 270, // rotation + 16, // Color depth + false, // Grayscale + false, // Pixels in a byte share a row. Only used for depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO38, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false); // not SH1107 +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { + common_hal_displayio_release_displays(); +} diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h new file mode 100644 index 000000000000..dc9051098131 --- /dev/null +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Adafruit Camera" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO21) +#define MICROPY_HW_NEOPIXEL_COUNT (6) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO33) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO34) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk new file mode 100644 index 000000000000..d99a43159929 --- /dev/null +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x239A +USB_PID = 0x8118 +USB_PRODUCT = "Camera" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c new file mode 100644 index 000000000000..aef4bc5685fb --- /dev/null +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_CARD_CS), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IRQ), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_HSYNC), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA8), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA7), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA6), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA2), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA5), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA4), MP_ROM_PTR(&pin_GPIO16) }, + + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/sdkconfig b/ports/espressif/boards/adafruit_esp32s2_camera/sdkconfig new file mode 100644 index 000000000000..9d8bbde967de --- /dev/null +++ b/ports/espressif/boards/adafruit_esp32s2_camera/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From e9f0c1796ea02ac56078dab79e9fd25398101660 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 11 Jan 2022 01:11:09 -0500 Subject: [PATCH 05/15] oof fix i2c lines! --- .../boards/adafruit_esp32s2_camera/mpconfigboard.h | 6 +++--- ports/espressif/boards/adafruit_esp32s2_camera/pins.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h index dc9051098131..25b2f2aa549d 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h @@ -38,9 +38,9 @@ #define AUTORESET_DELAY_MS 500 -#define DEFAULT_I2C_BUS_SCL (&pin_GPIO33) -#define DEFAULT_I2C_BUS_SDA (&pin_GPIO34) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index aef4bc5685fb..958ed2dcd5e1 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -25,8 +25,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_HSYNC), MP_ROM_PTR(&pin_GPIO6) }, @@ -41,7 +41,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA3), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA4), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, From 13b319c43074feacffd588a291dda9b72f88f17a Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 11 Jan 2022 01:35:54 -0500 Subject: [PATCH 06/15] try rotation 0 --- ports/espressif/boards/adafruit_esp32s2_camera/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c index 1686f531e2e8..d056d6f629c2 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/board.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -81,7 +81,7 @@ void board_init(void) { 240, // Height (after rotation) 80, // column start 0, // row start - 270, // rotation + 0, // rotation 16, // Color depth false, // Grayscale false, // Pixels in a byte share a row. Only used for depth < 8 From 3381ac149e9c256ad123c65a0a008af11d49eb9e Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 12 Jan 2022 23:08:10 -0500 Subject: [PATCH 07/15] fix camera display io to use default spi bus --- ports/espressif/boards/adafruit_esp32s2_camera/board.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c index d056d6f629c2..15f573ea96e8 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/board.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -32,6 +32,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/board/__init__.h" #include "esp_log.h" @@ -54,10 +55,7 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO19); common_hal_never_reset_pin(&pin_GPIO20); - busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL); - common_hal_busio_spi_never_reset(spi); - + busio_spi_obj_t *spi = common_hal_board_create_spi(); displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; bus->base.type = &displayio_fourwire_type; common_hal_displayio_fourwire_construct(bus, From 1d44bf1c0cc2f337fc3498b73dc09cd91cd19427 Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 12 Jan 2022 23:14:41 -0500 Subject: [PATCH 08/15] add camera data port --- .../boards/adafruit_esp32s2_camera/pins.c | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index 958ed2dcd5e1..7b5581e3141b 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -1,7 +1,22 @@ #include "shared-bindings/board/__init__.h" - #include "shared-module/displayio/__init__.h" +STATIC const mp_rom_obj_tuple_t camera_data_tuple = { + {&mp_type_tuple}, + 8, + { + MP_ROM_PTR(&pin_GPIO13), + MP_ROM_PTR(&pin_GPIO15), + MP_ROM_PTR(&pin_GPIO16), + MP_ROM_PTR(&pin_GPIO14), + MP_ROM_PTR(&pin_GPIO12), + MP_ROM_PTR(&pin_GPIO10), + MP_ROM_PTR(&pin_GPIO9), + MP_ROM_PTR(&pin_GPIO7), + } +}; + + STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS @@ -28,8 +43,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA), MP_ROM_PTR(&camera_data_tuple) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_CAMERA_HSYNC), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA9), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA8), MP_ROM_PTR(&pin_GPIO9) }, From c1cee63c5a13fab613fcf1c14130cee559c17c4b Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 17 Jan 2022 00:11:55 -0500 Subject: [PATCH 09/15] fix tuplecompile --- ports/espressif/boards/adafruit_esp32s2_camera/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index 7b5581e3141b..0c899840f450 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -1,3 +1,4 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" From d4dab792340364b8125c350aa10833ee3fb2132f Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 17 Jan 2022 00:31:19 -0500 Subject: [PATCH 10/15] add buttonpin --- ports/espressif/boards/adafruit_esp32s2_camera/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index 0c899840f450..63e656d4ed02 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -36,6 +36,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, From 71c792d6084cd0fb7624bc947f81c6f8a6b77a01 Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 17 Jan 2022 22:18:40 -0500 Subject: [PATCH 11/15] try initial esp32s3 qtpy def --- .../adafruit_qtpy_esp32s3_nopsram/board.c | 61 +++++++++++++++++++ .../mpconfigboard.h | 50 +++++++++++++++ .../mpconfigboard.mk | 18 ++++++ .../adafruit_qtpy_esp32s3_nopsram/pins.c | 59 ++++++++++++++++++ .../adafruit_qtpy_esp32s3_nopsram/sdkconfig | 8 +++ 5 files changed, 196 insertions(+) create mode 100644 ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c create mode 100644 ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h create mode 100644 ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk create mode 100644 ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c create mode 100644 ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c new file mode 100644 index 000000000000..dd24db581b4c --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif + + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h new file mode 100644 index 000000000000..0d6438615e2d --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py ESP32-S3 no psram" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO38) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO37) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO6) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO7) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO34) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO36) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO16) +#define DEFAULT_UART_BUS_TX (&pin_GPIO5) + diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk new file mode 100644 index 000000000000..273032d51679 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x239A +USB_PID = 0x811A + +USB_PRODUCT = "QT Py ESP32S3 no psram" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=8MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c new file mode 100644 index 000000000000..56cf4a24e85d --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig new file mode 100644 index 000000000000..a162344cfb16 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig @@ -0,0 +1,8 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=n + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + From de45a20b086a6f4088edf0ffb6577a01b59fb059 Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 17 Jan 2022 22:20:38 -0500 Subject: [PATCH 12/15] EOF --- .../boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h index 0d6438615e2d..90d65ea71e4b 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h @@ -47,4 +47,3 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO16) #define DEFAULT_UART_BUS_TX (&pin_GPIO5) - From 09cf95a51cf6cca0afd84b8e28e5fdb2e5d81c7f Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 18 Jan 2022 01:47:21 -0500 Subject: [PATCH 13/15] no psram :( --- .../boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk index 273032d51679..e46768f1cba5 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -16,3 +16,8 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=8MB + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register \ No newline at end of file From 6d7472357d956a9046bf18ded29f376c8146092f Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 18 Jan 2022 20:46:09 -0500 Subject: [PATCH 14/15] newline --- .../boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk index e46768f1cba5..1156b1b91553 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -20,4 +20,4 @@ CIRCUITPY_ESP_FLASH_SIZE=8MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register From f13ea93fe6a642984e154cad40e7c314ae0f4a1f Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 19 Jan 2022 14:22:01 -0500 Subject: [PATCH 15/15] fix A5 pin name --- ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c index 56cf4a24e85d..be7fb21a3eb9 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c @@ -23,7 +23,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO5) },