@geastack/targets 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +83 -0
- package/package.json +50 -0
- package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
- package/targets/cmake/geatsc_generated_archive.cmake +116 -0
- package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
- package/targets/esp32/app_project.cmake +33 -0
- package/targets/esp32/apps/app_manager.cpp +188 -0
- package/targets/esp32/apps/app_manager.h +10 -0
- package/targets/esp32/chip_bindings/README.md +58 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
- package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
- package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
- package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
- package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
- package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
- package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
- package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
- package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
- package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
- package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
- package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
- package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
- package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
- package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
- package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
- package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
- package/targets/esp32/connectivity/ble_hid.h +8 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
- package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
- package/targets/esp32/connectivity/wifi.cpp +615 -0
- package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
- package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
- package/targets/esp32/display.cpp +6010 -0
- package/targets/esp32/display_headless.cpp +468 -0
- package/targets/esp32/gea/platform_random.h +11 -0
- package/targets/esp32/gea_framework.cmake +382 -0
- package/targets/esp32/gpio.cpp +229 -0
- package/targets/esp32/host_sources.cmake +35 -0
- package/targets/esp32/imu_absent.cpp +36 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
- package/targets/esp32/memory_config.h +64 -0
- package/targets/esp32/power_absent.cpp +22 -0
- package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
- package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
- package/targets/esp32/sdk-patches/README.md +127 -0
- package/targets/esp32/services/app_runner.cpp +248 -0
- package/targets/esp32/services/app_state.cpp +56 -0
- package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
- package/targets/esp32/services/battery_service.cpp +31 -0
- package/targets/esp32/services/device_control.cpp +1896 -0
- package/targets/esp32/services/device_control.h +31 -0
- package/targets/esp32/services/frame_scheduler.cpp +1571 -0
- package/targets/esp32/services/heap.cpp +129 -0
- package/targets/esp32/services/memory.cpp +103 -0
- package/targets/esp32/services/ota.cpp +840 -0
- package/targets/esp32/services/ota_image.cpp +162 -0
- package/targets/esp32/services/ota_image.h +16 -0
- package/targets/esp32/services/storage_service.cpp +159 -0
- package/targets/esp32/touch_absent.cpp +44 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
- package/targets/esp32-m5stack-m5paper/README.md +55 -0
- package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
- package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
- package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
- package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
- package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
- package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
- package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
- package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
- package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
- package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
- package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
- package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
- package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
- package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
- package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
- package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
- package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
- package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
- package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
- package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
- package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
- package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
- package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
- package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
- package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
- package/targets/esp32-s3-devkit-n16r8.json +31 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
- package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
- package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
- package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
- package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
- package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
- package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
- package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
- package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
- package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
- package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
- package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
- package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
- package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
- package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
- package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
- package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
- package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
- package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
- package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
- package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
- package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
- package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
- package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
- package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
- package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
- package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
- package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
- package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
- package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
- package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
- package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
- package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
- package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
- package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
- package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
- package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
- package/targets/rp2350-tufty-2350/README.md +53 -0
- package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
- package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
- package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
- package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
- package/targets.json +154 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// The OTA image writer, separated from the HTTP OTA server in ota.cpp.
|
|
2
|
+
//
|
|
3
|
+
// Staging an image into the next OTA partition has nothing to do with how the
|
|
4
|
+
// bytes arrived: BLE OTA streams them over a GATT characteristic and needs no
|
|
5
|
+
// network stack. ota.cpp pulls in esp_http_server and only builds when the app
|
|
6
|
+
// declares the network capability, so while these methods lived there a
|
|
7
|
+
// BLE-only app -- the default the scaffold generates, and what lesson 3 of the
|
|
8
|
+
// embedded tutorial asks for -- compiled ble_hid.cpp's OTA path and then failed
|
|
9
|
+
// to link it. This file carries the transport-agnostic half and is built
|
|
10
|
+
// whenever OTA is reachable at all, by network or by BLE.
|
|
11
|
+
#include "services/ota.h"
|
|
12
|
+
|
|
13
|
+
#include "services/ota_image.h"
|
|
14
|
+
|
|
15
|
+
#include <cstdint>
|
|
16
|
+
|
|
17
|
+
#include "esp_heap_caps.h"
|
|
18
|
+
#include "esp_log.h"
|
|
19
|
+
#include "esp_ota_ops.h"
|
|
20
|
+
#include "esp_partition.h"
|
|
21
|
+
#include "esp_system.h"
|
|
22
|
+
#include "freertos/FreeRTOS.h"
|
|
23
|
+
#include "freertos/timers.h"
|
|
24
|
+
|
|
25
|
+
namespace gea::framework::services {
|
|
26
|
+
|
|
27
|
+
namespace {
|
|
28
|
+
|
|
29
|
+
constexpr const char *kTag = "gea_esp32_ota";
|
|
30
|
+
|
|
31
|
+
struct OtaImageSession {
|
|
32
|
+
esp_ota_handle_t handle = 0;
|
|
33
|
+
const esp_partition_t *partition = nullptr;
|
|
34
|
+
std::size_t expected = 0;
|
|
35
|
+
std::size_t received = 0;
|
|
36
|
+
bool active = false;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
OtaImageSession g_imageSession;
|
|
40
|
+
|
|
41
|
+
StaticTimer_t g_rebootTimerStorage;
|
|
42
|
+
TimerHandle_t g_rebootTimer = nullptr;
|
|
43
|
+
|
|
44
|
+
void rebootTimerCallback(TimerHandle_t)
|
|
45
|
+
{
|
|
46
|
+
esp_restart();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace
|
|
50
|
+
|
|
51
|
+
OtaServer::Result OtaServer::beginImage(std::size_t imageSize)
|
|
52
|
+
{
|
|
53
|
+
abortImage();
|
|
54
|
+
const esp_partition_t *partition = esp_ota_get_next_update_partition(nullptr);
|
|
55
|
+
if (!partition) return Result::NoPartition;
|
|
56
|
+
if (imageSize == 0 || imageSize > partition->size) return Result::InvalidSize;
|
|
57
|
+
const esp_partition_t *running = esp_ota_get_running_partition();
|
|
58
|
+
if (running && running->address == partition->address) return Result::NoPartition;
|
|
59
|
+
|
|
60
|
+
esp_ota_handle_t handle = 0;
|
|
61
|
+
const esp_err_t err = esp_ota_begin(partition, imageSize, &handle);
|
|
62
|
+
if (err != ESP_OK) {
|
|
63
|
+
ESP_LOGE(kTag, "esp_ota_begin failed: %s", esp_err_to_name(err));
|
|
64
|
+
return Result::BeginFailed;
|
|
65
|
+
}
|
|
66
|
+
g_imageSession = {handle, partition, imageSize, 0, true};
|
|
67
|
+
ESP_LOGI(kTag, "stream OTA started for %s (%u bytes)", partition->label,
|
|
68
|
+
static_cast<unsigned>(imageSize));
|
|
69
|
+
return Result::Ok;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
OtaServer::Result OtaServer::writeImage(const std::uint8_t *data, std::size_t length)
|
|
73
|
+
{
|
|
74
|
+
if (!g_imageSession.active) return Result::NotStarted;
|
|
75
|
+
if (!data || length == 0 || g_imageSession.received + length > g_imageSession.expected) {
|
|
76
|
+
abortImage();
|
|
77
|
+
return Result::InvalidSize;
|
|
78
|
+
}
|
|
79
|
+
const esp_err_t err = esp_ota_write(g_imageSession.handle, data, length);
|
|
80
|
+
if (err != ESP_OK) {
|
|
81
|
+
ESP_LOGE(kTag, "esp_ota_write failed: %s", esp_err_to_name(err));
|
|
82
|
+
abortImage();
|
|
83
|
+
return Result::WriteFailed;
|
|
84
|
+
}
|
|
85
|
+
g_imageSession.received += length;
|
|
86
|
+
return Result::Ok;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
OtaServer::Result OtaServer::finishImage()
|
|
90
|
+
{
|
|
91
|
+
if (!g_imageSession.active) return Result::NotStarted;
|
|
92
|
+
if (g_imageSession.received != g_imageSession.expected) {
|
|
93
|
+
abortImage();
|
|
94
|
+
return Result::SizeMismatch;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const esp_ota_handle_t handle = g_imageSession.handle;
|
|
98
|
+
const esp_partition_t *partition = g_imageSession.partition;
|
|
99
|
+
g_imageSession.active = false;
|
|
100
|
+
if (esp_ota_end(handle) != ESP_OK) {
|
|
101
|
+
g_imageSession = {};
|
|
102
|
+
return Result::ValidationFailed;
|
|
103
|
+
}
|
|
104
|
+
if (esp_ota_set_boot_partition(partition) != ESP_OK) {
|
|
105
|
+
g_imageSession = {};
|
|
106
|
+
return Result::BootSelectionFailed;
|
|
107
|
+
}
|
|
108
|
+
ESP_LOGI(kTag, "stream OTA complete for %s (%u bytes)", partition->label,
|
|
109
|
+
static_cast<unsigned>(g_imageSession.received));
|
|
110
|
+
g_imageSession = {};
|
|
111
|
+
return Result::Ok;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
void OtaServer::abortImage()
|
|
115
|
+
{
|
|
116
|
+
if (g_imageSession.active) esp_ota_abort(g_imageSession.handle);
|
|
117
|
+
g_imageSession = {};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
std::size_t OtaServer::receivedBytes()
|
|
121
|
+
{
|
|
122
|
+
return g_imageSession.received;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
std::size_t OtaServer::expectedBytes()
|
|
126
|
+
{
|
|
127
|
+
return g_imageSession.expected;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
void OtaServer::rebootSoon()
|
|
131
|
+
{
|
|
132
|
+
// Do not allocate a throwaway task after a multi-megabyte OTA. Radio stacks
|
|
133
|
+
// can leave too little contiguous internal heap for xTaskCreate(), and the old
|
|
134
|
+
// unchecked failure left the validated image selected but never rebooted.
|
|
135
|
+
// A static software timer needs no heap and lets the BLE success notification
|
|
136
|
+
// drain before restarting into the selected partition.
|
|
137
|
+
if (!g_rebootTimer) {
|
|
138
|
+
g_rebootTimer = xTimerCreateStatic(
|
|
139
|
+
"ota_reboot", pdMS_TO_TICKS(500), pdFALSE, nullptr,
|
|
140
|
+
&rebootTimerCallback, &g_rebootTimerStorage);
|
|
141
|
+
}
|
|
142
|
+
if (g_rebootTimer && xTimerStart(g_rebootTimer, 0) == pdPASS) return;
|
|
143
|
+
|
|
144
|
+
// The timer command queue can only be unavailable under severe scheduler
|
|
145
|
+
// pressure. Reboot directly rather than report a successful OTA that never
|
|
146
|
+
// activates; the image has already passed esp_ota_end and boot selection.
|
|
147
|
+
esp_restart();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
} // namespace gea::framework::services
|
|
151
|
+
|
|
152
|
+
namespace gea::targets::esp32::ota_debug {
|
|
153
|
+
|
|
154
|
+
std::atomic<int> httpStartError{-1};
|
|
155
|
+
std::atomic<bool> httpStarted{false};
|
|
156
|
+
|
|
157
|
+
int startError() { return httpStartError.load(std::memory_order_relaxed); }
|
|
158
|
+
bool started() { return httpStarted.load(std::memory_order_relaxed); }
|
|
159
|
+
std::uint32_t dmaFree() { return heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA); }
|
|
160
|
+
std::uint32_t dmaLargest() { return heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA); }
|
|
161
|
+
|
|
162
|
+
} // namespace gea::targets::esp32::ota_debug
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <atomic>
|
|
4
|
+
|
|
5
|
+
// Diagnostics the BLE OTA notification reports. They describe the HTTP OTA
|
|
6
|
+
// server, but ble_hid.cpp reads them in every OTA-capable build -- including a
|
|
7
|
+
// BLE-only one, where no HTTP server is compiled at all. The storage therefore
|
|
8
|
+
// lives with the always-compiled image writer (ota_image.cpp) and ota.cpp
|
|
9
|
+
// updates it when the HTTP server is part of the build. Without a server the
|
|
10
|
+
// values keep their "never started" defaults, which is the truth.
|
|
11
|
+
namespace gea::targets::esp32::ota_debug {
|
|
12
|
+
|
|
13
|
+
extern std::atomic<int> httpStartError;
|
|
14
|
+
extern std::atomic<bool> httpStarted;
|
|
15
|
+
|
|
16
|
+
} // namespace gea::targets::esp32::ota_debug
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#include "services/storage_service.h"
|
|
2
|
+
|
|
3
|
+
#include "esp_err.h"
|
|
4
|
+
#include "esp_log.h"
|
|
5
|
+
#include "nvs.h"
|
|
6
|
+
#include "nvs_flash.h"
|
|
7
|
+
|
|
8
|
+
#include <cstddef>
|
|
9
|
+
#include <cstdio>
|
|
10
|
+
#include <string>
|
|
11
|
+
|
|
12
|
+
#if defined(GEA_STORAGE_SPIFFS)
|
|
13
|
+
#include "esp_spiffs.h"
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
namespace gea::framework::services {
|
|
17
|
+
|
|
18
|
+
namespace {
|
|
19
|
+
|
|
20
|
+
constexpr const char *kTag = "gea_esp32_storage";
|
|
21
|
+
constexpr const char *kNamespace = "gea";
|
|
22
|
+
// Single NVS blob holding the whole app-facing localStorage set. A blob (not a
|
|
23
|
+
// str) so values may be arbitrary length and contain NUL. Distinct key from any
|
|
24
|
+
// device-setting string (e.g. "default_app"), so they coexist in one namespace.
|
|
25
|
+
constexpr const char *kLocalStorageKey = "ls_kv";
|
|
26
|
+
|
|
27
|
+
#if defined(GEA_STORAGE_SPIFFS)
|
|
28
|
+
// Persist the whole localStorage blob to a file on a dedicated SPIFFS partition
|
|
29
|
+
// on the main flash. The stock NVS partition is only 24KB (shared with BLE
|
|
30
|
+
// bonds) and fills up, silently dropping saved config/profiles on reboot; a
|
|
31
|
+
// SPIFFS partition on the 32MB flash has real room. Targets without a `storage`
|
|
32
|
+
// partition (or without GEA_STORAGE_SPIFFS) keep using the NVS blob below.
|
|
33
|
+
constexpr const char *kSpiffsBase = "/storage";
|
|
34
|
+
constexpr const char *kSpiffsPartition = "storage";
|
|
35
|
+
constexpr const char *kKvPath = "/storage/ls_kv.blob";
|
|
36
|
+
bool g_spiffs_ok = false;
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
} // namespace
|
|
40
|
+
|
|
41
|
+
bool StorageService::init()
|
|
42
|
+
{
|
|
43
|
+
esp_err_t ret = nvs_flash_init();
|
|
44
|
+
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
|
45
|
+
ESP_ERROR_CHECK(nvs_flash_erase());
|
|
46
|
+
ret = nvs_flash_init();
|
|
47
|
+
}
|
|
48
|
+
if (ret != ESP_OK) {
|
|
49
|
+
ESP_LOGE(kTag, "NVS init failed: %s", esp_err_to_name(ret));
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
#if defined(GEA_STORAGE_SPIFFS)
|
|
53
|
+
esp_vfs_spiffs_conf_t conf = {};
|
|
54
|
+
conf.base_path = kSpiffsBase;
|
|
55
|
+
conf.partition_label = kSpiffsPartition;
|
|
56
|
+
conf.max_files = 4;
|
|
57
|
+
conf.format_if_mount_failed = true;
|
|
58
|
+
const esp_err_t sret = esp_vfs_spiffs_register(&conf);
|
|
59
|
+
g_spiffs_ok = (sret == ESP_OK);
|
|
60
|
+
if (g_spiffs_ok) {
|
|
61
|
+
std::size_t total = 0, used = 0;
|
|
62
|
+
if (esp_spiffs_info(kSpiffsPartition, &total, &used) == ESP_OK)
|
|
63
|
+
ESP_LOGI(kTag, "SPIFFS mounted: %u/%u bytes used", static_cast<unsigned>(used),
|
|
64
|
+
static_cast<unsigned>(total));
|
|
65
|
+
} else {
|
|
66
|
+
ESP_LOGW(kTag, "SPIFFS mount failed: %s (localStorage falls back to NVS)",
|
|
67
|
+
esp_err_to_name(sret));
|
|
68
|
+
}
|
|
69
|
+
#endif
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
bool StorageService::getString(const char *key, char *buf, unsigned capacity)
|
|
74
|
+
{
|
|
75
|
+
if (!key || !buf || capacity == 0) return false;
|
|
76
|
+
nvs_handle_t handle;
|
|
77
|
+
if (nvs_open(kNamespace, NVS_READONLY, &handle) != ESP_OK) return false;
|
|
78
|
+
std::size_t len = capacity;
|
|
79
|
+
const esp_err_t err = nvs_get_str(handle, key, buf, &len);
|
|
80
|
+
nvs_close(handle);
|
|
81
|
+
return err == ESP_OK;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
bool StorageService::setString(const char *key, const char *value)
|
|
85
|
+
{
|
|
86
|
+
if (!key || !value) return false;
|
|
87
|
+
nvs_handle_t handle;
|
|
88
|
+
if (nvs_open(kNamespace, NVS_READWRITE, &handle) != ESP_OK) return false;
|
|
89
|
+
esp_err_t err = nvs_set_str(handle, key, value);
|
|
90
|
+
if (err == ESP_OK) err = nvs_commit(handle);
|
|
91
|
+
nvs_close(handle);
|
|
92
|
+
if (err != ESP_OK) ESP_LOGW(kTag, "setString(%s) failed: %s", key, esp_err_to_name(err));
|
|
93
|
+
return err == ESP_OK;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
bool StorageService::loadKv(std::string &out)
|
|
97
|
+
{
|
|
98
|
+
out.clear();
|
|
99
|
+
#if defined(GEA_STORAGE_SPIFFS)
|
|
100
|
+
if (g_spiffs_ok) {
|
|
101
|
+
FILE *f = std::fopen(kKvPath, "rb");
|
|
102
|
+
if (!f) return true; // no file yet == empty store (not an error)
|
|
103
|
+
std::fseek(f, 0, SEEK_END);
|
|
104
|
+
const long n = std::ftell(f);
|
|
105
|
+
std::fseek(f, 0, SEEK_SET);
|
|
106
|
+
if (n > 0) {
|
|
107
|
+
out.resize(static_cast<std::size_t>(n));
|
|
108
|
+
const std::size_t rd = std::fread(out.data(), 1, static_cast<std::size_t>(n), f);
|
|
109
|
+
if (rd != static_cast<std::size_t>(n)) out.resize(rd);
|
|
110
|
+
}
|
|
111
|
+
std::fclose(f);
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
115
|
+
nvs_handle_t handle;
|
|
116
|
+
if (nvs_open(kNamespace, NVS_READONLY, &handle) != ESP_OK) return false;
|
|
117
|
+
std::size_t len = 0;
|
|
118
|
+
esp_err_t err = nvs_get_blob(handle, kLocalStorageKey, nullptr, &len);
|
|
119
|
+
if (err == ESP_OK && len > 0) {
|
|
120
|
+
out.resize(len);
|
|
121
|
+
err = nvs_get_blob(handle, kLocalStorageKey, out.data(), &len);
|
|
122
|
+
if (err != ESP_OK) out.clear();
|
|
123
|
+
}
|
|
124
|
+
nvs_close(handle);
|
|
125
|
+
return err == ESP_OK;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
void StorageService::saveKv(const std::string &blob)
|
|
129
|
+
{
|
|
130
|
+
#if defined(GEA_STORAGE_SPIFFS)
|
|
131
|
+
if (g_spiffs_ok) {
|
|
132
|
+
if (blob.empty()) {
|
|
133
|
+
std::remove(kKvPath);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
FILE *f = std::fopen(kKvPath, "wb");
|
|
137
|
+
if (!f) {
|
|
138
|
+
ESP_LOGW(kTag, "saveKv: fopen(%s) failed", kKvPath);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const std::size_t wr = std::fwrite(blob.data(), 1, blob.size(), f);
|
|
142
|
+
std::fclose(f);
|
|
143
|
+
if (wr != blob.size()) ESP_LOGW(kTag, "saveKv: short write %u/%u", static_cast<unsigned>(wr),
|
|
144
|
+
static_cast<unsigned>(blob.size()));
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
#endif
|
|
148
|
+
nvs_handle_t handle;
|
|
149
|
+
if (nvs_open(kNamespace, NVS_READWRITE, &handle) != ESP_OK) return;
|
|
150
|
+
esp_err_t err = blob.empty() ? nvs_erase_key(handle, kLocalStorageKey)
|
|
151
|
+
: nvs_set_blob(handle, kLocalStorageKey, blob.data(), blob.size());
|
|
152
|
+
// Erasing a never-written key is fine — still commit so the store is durable.
|
|
153
|
+
if (err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND) err = nvs_commit(handle);
|
|
154
|
+
nvs_close(handle);
|
|
155
|
+
if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND)
|
|
156
|
+
ESP_LOGW(kTag, "saveKv failed: %s", esp_err_to_name(err));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
} // namespace gea::framework::services
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Touchscreen for a board that has no touch panel.
|
|
2
|
+
//
|
|
3
|
+
// The same shape as connectivity/wifi_debug_offline.cpp: the framework and the
|
|
4
|
+
// host facades reference Touchscreen unconditionally, so a board without the
|
|
5
|
+
// hardware still has to provide the symbols. Reporting "nothing is touching"
|
|
6
|
+
// forever is the accurate answer, and it keeps every caller — the runtime's
|
|
7
|
+
// event loop, the host touch facade, the debug FIFO — on its normal path
|
|
8
|
+
// instead of needing a display-less special case.
|
|
9
|
+
//
|
|
10
|
+
// Compiled in place of a controller binding when a composed board selects no
|
|
11
|
+
// `chips.touch`. Input on such a board arrives through buttons (GPIO) or over
|
|
12
|
+
// the wire, both of which go through their own facades.
|
|
13
|
+
|
|
14
|
+
#include "touch.h"
|
|
15
|
+
|
|
16
|
+
namespace gea::platform::touch {
|
|
17
|
+
|
|
18
|
+
void Touchscreen::setObserver(Observer) {}
|
|
19
|
+
void Touchscreen::setPointerObserver(PointerObserver) {}
|
|
20
|
+
|
|
21
|
+
// Reporting success keeps boot on the normal path: there is no hardware to
|
|
22
|
+
// fail, and an init() that returns false reads as a panel that did not answer.
|
|
23
|
+
bool Touchscreen::init() { return true; }
|
|
24
|
+
|
|
25
|
+
int Touchscreen::read(int *x, int *y)
|
|
26
|
+
{
|
|
27
|
+
if (x) *x = 0;
|
|
28
|
+
if (y) *y = 0;
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
int Touchscreen::readCached(int *x, int *y) { return read(x, y); }
|
|
33
|
+
|
|
34
|
+
void Touchscreen::consumeLatestMove(int *x, int *y)
|
|
35
|
+
{
|
|
36
|
+
if (x) *x = 0;
|
|
37
|
+
if (y) *y = 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Injection is how the debug FIFO drives synthetic drags. With no observer and
|
|
41
|
+
// no cache to update there is nothing to deliver it to.
|
|
42
|
+
void Touchscreen::injectEvent(Phase, bool, int, int) {}
|
|
43
|
+
|
|
44
|
+
} // namespace gea::platform::touch
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
|
|
3
|
+
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../esp32/components")
|
|
4
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../esp32/app_project.cmake")
|
|
5
|
+
set(GEA_EMBEDDED_APP "button-tetris" CACHE STRING "Example app to build (must match a package.json gea.id)")
|
|
6
|
+
set(PROJECT_VER "${GEA_EMBEDDED_APP}" CACHE STRING "Firmware app id" FORCE)
|
|
7
|
+
|
|
8
|
+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
9
|
+
idf_build_set_property(MINIMAL_BUILD ON)
|
|
10
|
+
project(gea_embedded)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# M5Stack M5Paper
|
|
2
|
+
|
|
3
|
+
Gea target for the M5Paper v1.1 e-paper tablet. The default app is
|
|
4
|
+
`button-tetris`.
|
|
5
|
+
|
|
6
|
+
## Hardware support
|
|
7
|
+
|
|
8
|
+
- ESP32-D0WDQ6-V3 with 16 MB flash and 8 MB PSRAM
|
|
9
|
+
- 4.7-inch 540x960 ED047TC1 e-paper panel through the IT8951 controller
|
|
10
|
+
- Asynchronous partial refreshes, fast 4-level updates, quality 16-level
|
|
11
|
+
grayscale updates, and periodic full refreshes
|
|
12
|
+
- GT911 two-point capacitive touch
|
|
13
|
+
- Left, center/power, and right rocker buttons
|
|
14
|
+
- Battery voltage and percentage reporting
|
|
15
|
+
- Power latch, e-paper power, and external-accessory power control
|
|
16
|
+
- microSD storage on the display's shared SPI bus
|
|
17
|
+
- ESP32 Wi-Fi and Bluetooth support
|
|
18
|
+
|
|
19
|
+
M5Paper has no onboard speaker or microphone, so the target intentionally uses
|
|
20
|
+
the no-audio backend.
|
|
21
|
+
|
|
22
|
+
## Controls
|
|
23
|
+
|
|
24
|
+
- Left/right rocker: `ArrowLeft` and `ArrowRight`, including key repeat
|
|
25
|
+
- Center rocker: app launcher/back action
|
|
26
|
+
- Hold center for 2.5 seconds: power down; press it again to wake
|
|
27
|
+
- Touch: normal pointer input, with two simultaneous contacts supported
|
|
28
|
+
|
|
29
|
+
## Build and flash
|
|
30
|
+
|
|
31
|
+
Register the connected unit (`npx gea boards add`, or `npx gea boards
|
|
32
|
+
discover` to read its USB serial; the entry shape is in
|
|
33
|
+
`cli/docs/SETUP.md`), then run:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npx gea build --board m5paper --app button-tetris
|
|
37
|
+
npx gea flash --board m5paper --app button-tetris
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The checked-in partition layout provides two 7 MB OTA app slots and a local
|
|
41
|
+
storage partition in the board's 16 MB flash.
|
|
42
|
+
|
|
43
|
+
## Pin map
|
|
44
|
+
|
|
45
|
+
| Function | GPIO |
|
|
46
|
+
| --- | ---: |
|
|
47
|
+
| Power latch | 2 |
|
|
48
|
+
| microSD CS | 4 |
|
|
49
|
+
| External power enable | 5 |
|
|
50
|
+
| IT8951 MOSI/MISO/SCLK | 12 / 13 / 14 |
|
|
51
|
+
| IT8951 CS / BUSY / power | 15 / 27 / 23 |
|
|
52
|
+
| I2C SDA / SCL | 21 / 22 |
|
|
53
|
+
| Battery ADC | 35 |
|
|
54
|
+
| GT911 interrupt | 36 |
|
|
55
|
+
| Left / center / right rocker | 37 / 38 / 39 |
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
dependencies:
|
|
2
|
+
espressif/esp_codec_dev:
|
|
3
|
+
component_hash: df70f10af8d7b922add7b9d07372c9c97ab356e58d72b7a892050227c2d44348
|
|
4
|
+
dependencies:
|
|
5
|
+
- name: idf
|
|
6
|
+
require: private
|
|
7
|
+
version: '>=4.0'
|
|
8
|
+
source:
|
|
9
|
+
registry_url: https://components.espressif.com/
|
|
10
|
+
type: service
|
|
11
|
+
version: 1.5.11
|
|
12
|
+
espressif/esp_lcd_touch:
|
|
13
|
+
component_hash: 3f85a7d95af876f1a6ecca8eb90a81614890d0f03a038390804e5a77e2caf862
|
|
14
|
+
dependencies:
|
|
15
|
+
- name: idf
|
|
16
|
+
require: private
|
|
17
|
+
version: '>=4.4.2'
|
|
18
|
+
source:
|
|
19
|
+
registry_url: https://components.espressif.com
|
|
20
|
+
type: service
|
|
21
|
+
version: 1.2.1
|
|
22
|
+
espressif/esp_lcd_touch_gt911:
|
|
23
|
+
component_hash: 6029febef66eefd0910d527d7f30292779ccbf22a8dedd2bd69466acf0068a7b
|
|
24
|
+
dependencies:
|
|
25
|
+
- name: espressif/esp_lcd_touch
|
|
26
|
+
registry_url: https://components.espressif.com
|
|
27
|
+
require: public
|
|
28
|
+
version: ^1.2.0
|
|
29
|
+
- name: idf
|
|
30
|
+
require: private
|
|
31
|
+
version: '>=5.2'
|
|
32
|
+
source:
|
|
33
|
+
registry_url: https://components.espressif.com/
|
|
34
|
+
type: service
|
|
35
|
+
version: 1.2.0~2
|
|
36
|
+
espressif/esp_libsrtp:
|
|
37
|
+
component_hash: 131560184c73ec09f77d8904a2db709307803f0f9f111898921b6966776eac15
|
|
38
|
+
dependencies: []
|
|
39
|
+
source:
|
|
40
|
+
registry_url: https://components.espressif.com
|
|
41
|
+
type: service
|
|
42
|
+
version: 1.0.0
|
|
43
|
+
espressif/esp_peer:
|
|
44
|
+
component_hash: 9f1f9db81744ed113669390ff6053612bccb7465af12b366c10c99f0dcd2ac61
|
|
45
|
+
dependencies:
|
|
46
|
+
- name: espressif/esp_libsrtp
|
|
47
|
+
registry_url: https://components.espressif.com
|
|
48
|
+
require: private
|
|
49
|
+
version: ^1.0.0
|
|
50
|
+
source:
|
|
51
|
+
registry_url: https://components.espressif.com/
|
|
52
|
+
type: service
|
|
53
|
+
version: 1.5.0
|
|
54
|
+
espressif/esp_websocket_client:
|
|
55
|
+
component_hash: 3fb288702517ef4d75bf933a115f1056ee0c2540d964f9e1d856e0bb67e1dfeb
|
|
56
|
+
dependencies:
|
|
57
|
+
- name: idf
|
|
58
|
+
require: private
|
|
59
|
+
version: '>=5.0'
|
|
60
|
+
source:
|
|
61
|
+
registry_url: https://components.espressif.com/
|
|
62
|
+
type: service
|
|
63
|
+
version: 1.7.0
|
|
64
|
+
idf:
|
|
65
|
+
source:
|
|
66
|
+
type: idf
|
|
67
|
+
version: 6.0.2
|
|
68
|
+
direct_dependencies:
|
|
69
|
+
- espressif/esp_codec_dev
|
|
70
|
+
- espressif/esp_lcd_touch_gt911
|
|
71
|
+
- espressif/esp_peer
|
|
72
|
+
- espressif/esp_websocket_client
|
|
73
|
+
- idf
|
|
74
|
+
manifest_hash: 5746f2ead289a02cfc81f200ef4fb8479ca024e1f184f9830e22ac94cfaaf98b
|
|
75
|
+
target: esp32
|
|
76
|
+
version: 3.0.0
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# The Gea app pipeline is common to the ESP32 e-paper boards. Keep only the
|
|
2
|
+
# M5Paper hardware/profile choices here; the included component definition
|
|
3
|
+
# resolves sources relative to this component directory.
|
|
4
|
+
set(GEA_EMBEDDED_TARGET_MAIN_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
|
5
|
+
set(GEA_EMBEDDED_TARGET_CPP_BOARD "esp32-m5stack-m5paper")
|
|
6
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_WIDTH 540)
|
|
7
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_HEIGHT 960)
|
|
8
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_NATIVE_WIDTH 540)
|
|
9
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_NATIVE_HEIGHT 960)
|
|
10
|
+
set(GEA_EMBEDDED_TARGET_CSS_DEVICE_PIXEL_RATIO "1.0")
|
|
11
|
+
set(GEA_EMBEDDED_TARGET_AUDIO_SOURCE "${CMAKE_CURRENT_LIST_DIR}/audio_stub.cpp")
|
|
12
|
+
set(GEA_EMBEDDED_TARGET_AUDIO_RUNTIME_SOURCE "${CMAKE_CURRENT_LIST_DIR}/../../esp32/services/audio_runtime_stub.cpp")
|
|
13
|
+
set(GEA_EMBEDDED_TARGET_EXTRA_REQUIRES esp_adc bootloader_support spi_flash esp_psram)
|
|
14
|
+
set(GEA_EMBEDDED_TARGET_LDFRAGMENTS "${CMAKE_CURRENT_LIST_DIR}/m5paper_psram.lf")
|
|
15
|
+
set(GEA_EMBEDDED_TARGET_COMPILE_DEFINITIONS
|
|
16
|
+
# M5Paper has no speaker or microphone. Keep Web Audio timing functional,
|
|
17
|
+
# but do not create a PCM render task for oscillator output.
|
|
18
|
+
GEA_EMBEDDED_AUDIO_DISABLED=1
|
|
19
|
+
# Decode large JPEGs (e.g. EPUB covers) with the ESP32 ROM tinyjpeg
|
|
20
|
+
# decompressor: block-streaming, ~a few KB of work RAM, and 1/2–1/8
|
|
21
|
+
# descaling. stb_image needs several large contiguous buffers that the
|
|
22
|
+
# reader's fragmented PSRAM can't satisfy for a full-page cover.
|
|
23
|
+
GEA_EMBEDDED_ROM_TJPGD=1
|
|
24
|
+
# Large images decode to 1-channel grayscale (this is a grayscale e-paper).
|
|
25
|
+
GEA_EMBEDDED_IMAGE_GRAYSCALE_DECODE=1
|
|
26
|
+
# Render straight into the panel's native 16-level, 4-bit packed format
|
|
27
|
+
# (GEA_PIXEL_GRAY4). The Canvas framebuffer IS the IT8951 buffer: no RGB565
|
|
28
|
+
# intermediate, no per-frame luma repack, quarter-size framebuffer — halving
|
|
29
|
+
# both the fill and the flush cost of a full-screen page turn.
|
|
30
|
+
GEA_EMBEDDED_PIXEL_FORMAT=3
|
|
31
|
+
# app_main is only a small pre-scheduler bootstrap. The actual Gea runtime
|
|
32
|
+
# task is allocated after ESP-IDF releases the ROM startup-stack D/IRAM.
|
|
33
|
+
GEA_EMBEDDED_RUNTIME_TASK_STACK_BYTES=32768
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-epaper-1.54/main/CMakeLists.txt")
|
|
37
|
+
|
|
38
|
+
# Generated app archives are linked after ESP-IDF's component archives. Force
|
|
39
|
+
# the hardware RNG implementation out of bootloader_support before that final
|
|
40
|
+
# archive introduces its references (for example, Tetris bag shuffling).
|
|
41
|
+
if(NOT CMAKE_SCRIPT_MODE_FILE)
|
|
42
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
43
|
+
"-u bootloader_random_enable"
|
|
44
|
+
"-u bootloader_random_disable"
|
|
45
|
+
)
|
|
46
|
+
endif()
|