DEKI/ENGINE 文档
手册 API 参考
deki-esp32-integration 0.40.1
Deki 包参考
deki-esp32-integration

ESP32 平台 HAL:通过 ESP-IDF SDMMC 使用 SD 卡、FATFS 文件系统、串口命令,以及内存和文件系统的设置。

仓库:github.com/dekiengine/deki-esp32-integration · 最新版本:0.40.0 · 需要引擎 0.40.0 或更高版本 · 依赖:deki-wifi, deki-ble, deki-http, deki-i2s, deki-uart, deki-i2c, deki-gpio, deki-sdcard, deki-rendering

使用 DekiEditor --packages-add deki-esp32-integration <project> 或通过包管理器安装。引擎自身的组件和 C++ API 见 Deki 文档。

在编辑器中显示为 **ESP32 Integration**。

组件

组件 类别 说明
ESP32QemuDisplaySetup ESP32 HAL 打开 Espressif QEMU 的屏幕,无需开发板即可运行固件构建。
ESP32SerialSetup ESP32 HAL 通过 ESP32 的串口响应编辑器的命令。

功能开关

可以从构建中去掉的部分。带有 define 的功能通过该 define 开关,其余的随其组件一起被剥离。

功能 define 默认值
Memory DEKI_FEATURE_ESP32_MEMORY_SETUP 开
File System DEKI_FEATURE_ESP32_FILE_SYSTEM_SETUP 开
Serial Commands DEKI_FEATURE_ESP32_SERIAL_SETUP 开
SD Card (ESP-IDF) DEKI_FEATURE_ESP32_SD 开
GPIO (ESP-IDF) DEKI_FEATURE_ESP32_GPIO 开
I²C (ESP-IDF) DEKI_FEATURE_ESP32_I2C 开
SPI (ESP-IDF) DEKI_FEATURE_ESP32_SPI 开
Display present worker and parallel bus (ESP-IDF) DEKI_FEATURE_ESP32_DISPLAY_WORKER 开
UART (ESP-IDF) DEKI_FEATURE_ESP32_UART 开
I²S (ESP-IDF) DEKI_FEATURE_ESP32_I2S 开
S3 SIMD Blit Kernels DEKI_FEATURE_ESP32_BLIT_SIMD 开
WiFi STA + scan (ESP-IDF) DEKI_FEATURE_ESP32_WIFI 开
BLE (NimBLE) DEKI_FEATURE_ESP32_BLE 开
QEMU Display DEKI_FEATURE_ESP32_QEMU_DISPLAY 开
HTTPS client (ESP-IDF) DEKI_FEATURE_ESP32_HTTP 开

组件参考

ESP32QemuDisplaySetup

打开 Espressif QEMU 的屏幕,无需开发板即可运行固件构建。

检视器中的名称:ESP32 QEMU 显示屏设置 · 类别:ESP32 HAL · 类型:DekiEsp32::ESP32QemuDisplaySetup

属性 类型 默认值 约束 说明
width int32 320 1 到 4096 屏幕的宽度,单位为像素。
height int32 240 1 到 4096 屏幕的高度,单位为像素。
format enum "RGB565" RGB565, ARGB8888 屏幕的像素格式。游戏以此格式渲染。

ESP32SerialSetup

通过 ESP32 的串口响应编辑器的命令。

检视器中的名称:ESP32 串口设置 · 类别:ESP32 HAL · 类型:DekiEsp32::ESP32SerialSetup

属性 类型 默认值 约束 说明
baudRate int32 115200 9600 到 921600 串口波特率

更新日志

更新日志为英文。

0.40.0

Added

  • DEKI:PROFILE also reports each object in the scene, most expensive first: a DEKI:PROFILE:OBJECT line with its path, type, sorting order, its share of finding what changed, of making and drawing its pixels, how many times it was drawn and why (new, changed, still, overPin), per frame; the first 64, then DEKI:PROFILE:OBJECTS with how many there were.

Changed

  • minEngine 0.40.0: built against engine 0.40.0. A build of this package from before does not load and is rebuilt.
  • Builds keep the WiFi driver's code in flash (CONFIG_ESP_WIFI_IRAM_OPT=n, CONFIG_ESP_WIFI_RX_IRAM_OPT=n): 18.5 KB more internal RAM for the game, the display and the radio's own buffers, whether WiFi is on or not. Measured on a T-Deck Plus: 1 MB downloads over a phone hotspot averaged 140 KB/s against 149 KB/s (the ranges overlap), and frames cost the same while WiFi was busy. A board that wants the driver's code in internal RAM again sets both to y in its platform's sdkconfig list, which comes last. Existing projects get it on their next build: the builder regenerates a stale sdkconfig when its defaults change.
  • Builds also keep the radio's PHY code and libc's locks in flash (CONFIG_ESP_PHY_IRAM_OPT=n, CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=n): 1 KB more internal RAM. Frames on a T-Deck Plus cost the same (19.7 ms against 19.6 on a farm map, 32.9 against 32.9 with 16 sprites walking). The heap's functions stay in internal RAM: in flash they cost about 5.5 ms a frame.
  • ESP32-S3 builds have a 32 KB instruction cache (CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y; ESP-IDF's default is 16 KB). A frame runs more code than 16 KB holds, and how often it missed depended on where a build placed the code: the same scene moved by a millisecond between unrelated builds. Measured on a T-Deck Plus with a scrolling farm: 19.0 to 16.9 ms a frame, 21.9 to 18.5 ms with 4 sprites walking, 30.6 to 26.0 ms with 16, and builds within 0.2 ms of each other. It takes 16 KB of internal RAM; a board that needs it back sets CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y in its sdkconfig list.
  • Boards with PSRAM keep the static data ESP-IDF's libraries allow there in PSRAM (CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y): 14.4 KB of WiFi, lwIP and network tables in a T-Deck build, which only WiFi touches.
  • Allocations through operator new, std::vector and std::string go to PSRAM once DMA-capable internal RAM, not all internal RAM, is down to 16 KB. An ESP32-S3's RTC fast memory (about 8 KB) is internal but no driver's DMA reaches it, so the old count let a scene's objects leave drivers almost nothing. With these three changes, a T-Deck Plus running the farm in whole frames keeps 14.9 KB of DMA-capable RAM free (largest block 13.8 KB), room for an SD card and audio started mid-game.

Fixed

  • Choosing ESP-IDF in the New Platform dialog no longer crashes the panel: the package now takes the editor's ImGui context.

0.30.0

Changed

  • minEngine 0.30.0: built against engine 0.30.0. A build of this package from before does not load and is rebuilt.

Fixed

  • A firmware build from the editor runs ESP-IDF. On a machine whose PATH holds an entry with a stray quote (a Windows Kits installer leaves one), the build ran nothing and reported success: the variables it sets were set lines in one cmd line, and the quote, expanded from PATH%, closed one early and turned the rest of the line, export.bat and idf.py included, into a value. They are the build's environment now, not part of its command, and such an entry's quote is left out of the build's PATH, which the build says, naming the entry (otherwise cmd finds nothing after it, and export.bat reports git missing).
  • A build is a success only when it leaves the firmware (build/DekiGame.bin): one that exits 0 without it fails, saying so. A build with nothing to rebuild says the firmware was already up to date. The build output names the firmware file.
  • ESP-IDF runs with PYTHONUTF8=1, as idf.py asks for on a console that is not UTF-8.

更早的版本:CHANGELOG.md


由包的反射数据生成(引擎 0.40.1)。属性名就是场景文件中使用的键。重命名后会保留别名(兼容性)。