From a9d87e6e8b1b9a469313be04703f51f4c3ba004c Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 25 Feb 2022 20:29:31 -0500 Subject: [PATCH] fix missing pins, speed up --- .../espressif/boards/adafruit_esp32s2_camera/board.c | 12 ++++++------ .../espressif/boards/adafruit_esp32s2_camera/pins.c | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c index e9eef0dcbc..109e9b4b9a 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/board.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -41,13 +41,13 @@ 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 + 0x01, 0 | DELAY, 120, // SWRESET + 0x11, 0 | DELAY, 5, // 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 + 0x21, 0, // _INVON + 0x13, 0, // _NORON + 0x29, 0 | DELAY, 5, // _DISPON }; void board_init(void) { @@ -59,7 +59,7 @@ void board_init(void) { &pin_GPIO39, // TFT_DC Command or data &pin_GPIO40, // TFT_CS Chip select &pin_GPIO41, // TFT_RESET Reset - 5000000, // Baudrate + 40000000, // Baudrate 0, // Polarity 0); // Phase diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index 63e656d4ed..688a555b02 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -21,14 +21,16 @@ STATIC const mp_rom_obj_tuple_t camera_data_tuple = { 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_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, { 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_CARD_POWER), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_IRQ), MP_ROM_PTR(&pin_GPIO3) },