Skip to content

ports/esp32:Add modesp32s3(special lcd_cam for esp32s3) #11880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ports/esp32/boards/GENERIC_S3_GRAM_OCT/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"deploy": [
"../deploy_s3.md"
],
"docs": "",
"features": [
"BLE",
"WiFi"
],
"images": [
"generic_s3.jpg"
],
"mcu": "esp32s3",
"product": "Generic ESP32-S3 (SPIRAM Octal)",
"thumbnail": "",
"url": "https://www.espressif.com/en/products/modules",
"vendor": "Espressif"
}
10 changes: 10 additions & 0 deletions ports/esp32/boards/GENERIC_S3_GRAM_OCT/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(IDF_TARGET esp32s3)

set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/sdkconfig.usb
boards/sdkconfig.ble
boards/sdkconfig.240mhz
boards/sdkconfig.gram_oct
boards/GENERIC_S3_SPIRAM_OCT/sdkconfig.board
)
10 changes: 10 additions & 0 deletions ports/esp32/boards/GENERIC_S3_GRAM_OCT/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define MICROPY_HW_BOARD_NAME "ESP32S3 module (gram octal)"
#define MICROPY_HW_MCU_NAME "ESP32S3"

#define MICROPY_PY_MACHINE_DAC (0)

// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
#define MICROPY_HW_ENABLE_UART_REPL (1)

#define MICROPY_HW_I2C0_SCL (9)
#define MICROPY_HW_I2C0_SDA (8)
9 changes: 9 additions & 0 deletions ports/esp32/boards/GENERIC_S3_GRAM_OCT/sdkconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y

CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=Y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"
2 changes: 2 additions & 0 deletions ports/esp32/boards/GENERIC_S3_SPIRAM_OCT/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
#define MICROPY_HW_ENABLE_UART_REPL (1)

#define MICROPY_ESP_ENABLE_PSRAM_OCT (1)

#define MICROPY_HW_I2C0_SCL (9)
#define MICROPY_HW_I2C0_SDA (8)
15 changes: 15 additions & 0 deletions ports/esp32/boards/sdkconfig.gram_oct
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# MicroPython on ESP32-S2 and ESP32-PAD1_subscript_3, ESP IDF configuration with SPIRAM support in Octal mode
CONFIG_SPIRAM_MODE_QUAD=y
CONFIG_SPIRAM_TYPE_AUTO=y
CONFIG_SPIRAM_CLK_IO=30
CONFIG_SPIRAM_CS_IO=26
# In espidf5.1 the speed can be up to 120M(improve the display effect), TODO.
# TODO, make other CONFIG which also improve the display effect.
# But in the 120M speed, espidf say that temperature safety cannot be ensured.
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_SPIRAM_USE_CAPS_ALLOC=y
CONFIG_SPIRAM_MODE_QUAD=
CONFIG_SPIRAM_MODE_OCT=y
10 changes: 10 additions & 0 deletions ports/esp32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "esp_event.h"
#include "esp_log.h"
#include "esp_psram.h"
#include "esp_heap_caps.h"

#include "py/stackctrl.h"
#include "py/nlr.h"
Expand All @@ -64,6 +65,10 @@
#include "modespnow.h"
#endif

#if MICROPY_ESP32S3_LCDCAM
#include "modesp32s3.h"
#endif

// MicroPython runs as a task under FreeRTOS
#define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1)
#define MP_TASK_STACK_SIZE (16 * 1024)
Expand Down Expand Up @@ -160,6 +165,11 @@ void mp_task(void *pvParameter) {
MP_STATE_PORT(espnow_singleton) = NULL;
#endif

#if MICROPY_ESP32S3_LCDCAM
mp_esp32s3_lcd_cam_global_deinit();
MP_STATE_PORT(esp32s3_lcd_cam_singleton) = NULL;
#endif

machine_timer_deinit_all();

#if MICROPY_PY_THREAD
Expand Down
8 changes: 8 additions & 0 deletions ports/esp32/main_esp32s3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ if(NOT MICROPY_PORT_DIR)
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
endif()

list(APPEND MICROPY_SOURCE_PORT
modesp32s3.c
)

list(APPEND IDF_COMPONENTS
esp_lcd
)

include(${MICROPY_PORT_DIR}/esp32_common.cmake)
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy