@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,102 @@
|
|
|
1
|
+
#include "power.h"
|
|
2
|
+
|
|
3
|
+
#include "board.h"
|
|
4
|
+
|
|
5
|
+
#include "esp_adc/adc_cali.h"
|
|
6
|
+
#include "esp_adc/adc_cali_scheme.h"
|
|
7
|
+
#include "esp_adc/adc_oneshot.h"
|
|
8
|
+
#include "esp_log.h"
|
|
9
|
+
|
|
10
|
+
// M5PaperS3 battery gauge. The 1800 mAh cell is divided by a matched resistor
|
|
11
|
+
// pair into GPIO3 = ADC1_CH2:
|
|
12
|
+
//
|
|
13
|
+
// Battery+ ── R1 ── GPIO3 ── R2 ── GND (R1 == R2, so the pin sees Vbat/2)
|
|
14
|
+
//
|
|
15
|
+
// ADC_ATTEN_DB_12 gives ~2.5 V full scale, so the ½x divider covers 0–5 V —
|
|
16
|
+
// comfortably past a full 4.2 V LiPo. Divider ratio and channel are taken from
|
|
17
|
+
// upstream PaperBoy's battery.c running on this board.
|
|
18
|
+
//
|
|
19
|
+
// Unlike the LilyGo T5 (whose divider lands on ADC2 and therefore fights the
|
|
20
|
+
// Wi-Fi radio for the ADC), this is ADC1 and stays readable with the radio up.
|
|
21
|
+
|
|
22
|
+
namespace gea::platform::power {
|
|
23
|
+
|
|
24
|
+
namespace {
|
|
25
|
+
|
|
26
|
+
constexpr char kTag[] = "papers3_power";
|
|
27
|
+
|
|
28
|
+
constexpr adc_unit_t kAdcUnit = ADC_UNIT_1;
|
|
29
|
+
constexpr adc_channel_t kAdcChannel = ADC_CHANNEL_2; // GPIO3
|
|
30
|
+
constexpr adc_atten_t kAdcAtten = ADC_ATTEN_DB_12;
|
|
31
|
+
constexpr int kDividerRatio = 2;
|
|
32
|
+
|
|
33
|
+
// LiPo discharge endpoints. The curve is not linear, but for a battery glyph a
|
|
34
|
+
// linear map between "charged" and "cut-off" is the usual, honest-enough
|
|
35
|
+
// approximation.
|
|
36
|
+
constexpr int kFullMv = 4200;
|
|
37
|
+
constexpr int kEmptyMv = 3300;
|
|
38
|
+
|
|
39
|
+
bool initialized = false;
|
|
40
|
+
bool usable = false;
|
|
41
|
+
adc_oneshot_unit_handle_t adc = nullptr;
|
|
42
|
+
adc_cali_handle_t cali = nullptr;
|
|
43
|
+
|
|
44
|
+
} // namespace
|
|
45
|
+
|
|
46
|
+
bool Power::init()
|
|
47
|
+
{
|
|
48
|
+
if (initialized) return usable;
|
|
49
|
+
initialized = true;
|
|
50
|
+
|
|
51
|
+
adc_oneshot_unit_init_cfg_t unit = {};
|
|
52
|
+
unit.unit_id = kAdcUnit;
|
|
53
|
+
if (adc_oneshot_new_unit(&unit, &adc) != ESP_OK) {
|
|
54
|
+
ESP_LOGW(kTag, "ADC1 unavailable; battery reported unknown");
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
adc_oneshot_chan_cfg_t chan = {};
|
|
59
|
+
chan.atten = kAdcAtten;
|
|
60
|
+
chan.bitwidth = ADC_BITWIDTH_DEFAULT;
|
|
61
|
+
if (adc_oneshot_config_channel(adc, kAdcChannel, &chan) != ESP_OK) {
|
|
62
|
+
ESP_LOGW(kTag, "ADC1 channel config failed; battery reported unknown");
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Curve-fitting calibration turns a raw count into millivolts using the
|
|
67
|
+
// chip's factory eFuse data. Without it the reading is only a raw ratio, so
|
|
68
|
+
// treat the gauge as unusable rather than reporting a made-up percentage.
|
|
69
|
+
adc_cali_curve_fitting_config_t caliCfg = {};
|
|
70
|
+
caliCfg.unit_id = kAdcUnit;
|
|
71
|
+
caliCfg.chan = kAdcChannel;
|
|
72
|
+
caliCfg.atten = kAdcAtten;
|
|
73
|
+
caliCfg.bitwidth = ADC_BITWIDTH_DEFAULT;
|
|
74
|
+
if (adc_cali_create_scheme_curve_fitting(&caliCfg, &cali) != ESP_OK) {
|
|
75
|
+
ESP_LOGW(kTag, "ADC calibration unavailable; battery reported unknown");
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
usable = true;
|
|
80
|
+
ESP_LOGI(kTag, "battery gauge ready on GPIO%d (ADC1_CH2, 1/%dx divider)",
|
|
81
|
+
static_cast<int>(gea::platform::board::power.batteryAdc), kDividerRatio);
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
int Power::batteryPercent()
|
|
86
|
+
{
|
|
87
|
+
if (!init()) return -1;
|
|
88
|
+
|
|
89
|
+
int raw = 0;
|
|
90
|
+
if (adc_oneshot_read(adc, kAdcChannel, &raw) != ESP_OK) return -1;
|
|
91
|
+
|
|
92
|
+
int mv = 0;
|
|
93
|
+
if (adc_cali_raw_to_voltage(cali, raw, &mv) != ESP_OK) return -1;
|
|
94
|
+
|
|
95
|
+
const int batteryMv = mv * kDividerRatio;
|
|
96
|
+
int percent = ((batteryMv - kEmptyMv) * 100) / (kFullMv - kEmptyMv);
|
|
97
|
+
if (percent < 0) percent = 0;
|
|
98
|
+
if (percent > 100) percent = 100;
|
|
99
|
+
return percent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
} // namespace gea::platform::power
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#include "platform/file_cache.h"
|
|
2
|
+
|
|
3
|
+
#include "board.h"
|
|
4
|
+
|
|
5
|
+
#include <sys/stat.h>
|
|
6
|
+
|
|
7
|
+
#include "driver/sdspi_host.h"
|
|
8
|
+
#include "driver/spi_master.h"
|
|
9
|
+
#include "esp_err.h"
|
|
10
|
+
#include "esp_log.h"
|
|
11
|
+
#include "esp_vfs_fat.h"
|
|
12
|
+
#include "sdmmc_cmd.h"
|
|
13
|
+
|
|
14
|
+
namespace gea::platform::storage {
|
|
15
|
+
|
|
16
|
+
namespace {
|
|
17
|
+
|
|
18
|
+
constexpr char kTag[] = "papers3_sd";
|
|
19
|
+
bool mounted = false;
|
|
20
|
+
sdmmc_card_t *card = nullptr;
|
|
21
|
+
|
|
22
|
+
bool ensureSpiBus()
|
|
23
|
+
{
|
|
24
|
+
spi_bus_config_t config = {};
|
|
25
|
+
config.mosi_io_num = gea::platform::board::storage.mosi;
|
|
26
|
+
config.miso_io_num = gea::platform::board::storage.miso;
|
|
27
|
+
config.sclk_io_num = gea::platform::board::storage.sclk;
|
|
28
|
+
config.quadwp_io_num = -1;
|
|
29
|
+
config.quadhd_io_num = -1;
|
|
30
|
+
config.max_transfer_sz = 4096;
|
|
31
|
+
const esp_err_t err = spi_bus_initialize(gea::platform::board::storage.spiHost, &config, SPI_DMA_CH_AUTO);
|
|
32
|
+
return err == ESP_OK || err == ESP_ERR_INVALID_STATE;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
bool mountCard()
|
|
36
|
+
{
|
|
37
|
+
// SD is REAL on this board: SCLK 39 / MOSI 38 / MISO 40 / CS 47 (see
|
|
38
|
+
// board.h), none of which collide with the panel's parallel bus. The LilyGo
|
|
39
|
+
// early-out this file came from existed because that board's SD pins landed
|
|
40
|
+
// on e-paper data lines; here the bus is verified working (upstream PaperBoy
|
|
41
|
+
// mounts a card on these exact pins).
|
|
42
|
+
struct stat st = {};
|
|
43
|
+
if (stat("/sdcard", &st) == 0) return true;
|
|
44
|
+
if (!ensureSpiBus()) return false;
|
|
45
|
+
|
|
46
|
+
sdmmc_host_t host = SDSPI_HOST_DEFAULT();
|
|
47
|
+
host.slot = gea::platform::board::storage.spiHost;
|
|
48
|
+
host.max_freq_khz = 20000;
|
|
49
|
+
|
|
50
|
+
sdspi_device_config_t device = SDSPI_DEVICE_CONFIG_DEFAULT();
|
|
51
|
+
device.host_id = gea::platform::board::storage.spiHost;
|
|
52
|
+
device.gpio_cs = gea::platform::board::storage.cs;
|
|
53
|
+
device.gpio_cd = SDSPI_SLOT_NO_CD;
|
|
54
|
+
device.gpio_wp = SDSPI_SLOT_NO_WP;
|
|
55
|
+
device.gpio_int = SDSPI_SLOT_NO_INT;
|
|
56
|
+
|
|
57
|
+
esp_vfs_fat_mount_config_t mount = {};
|
|
58
|
+
mount.format_if_mount_failed = false;
|
|
59
|
+
mount.max_files = 8;
|
|
60
|
+
mount.allocation_unit_size = 16 * 1024;
|
|
61
|
+
const esp_err_t err = esp_vfs_fat_sdspi_mount("/sdcard", &host, &device, &mount, &card);
|
|
62
|
+
if (err != ESP_OK) {
|
|
63
|
+
ESP_LOGW(kTag, "microSD mount failed: %s", esp_err_to_name(err));
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
ESP_LOGI(kTag, "microSD mounted on its own SPI2 bus CS=%d", static_cast<int>(device.gpio_cs));
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
bool ensureStorageMounted()
|
|
71
|
+
{
|
|
72
|
+
// A missing card or a card inserted too late is recoverable. Keep a
|
|
73
|
+
// successful mount idempotent, but retry failures when the caller explicitly
|
|
74
|
+
// asks for storage again (for example, the e-reader's RESCAN action).
|
|
75
|
+
// mountCard() also accepts an already-initialized SPI bus, so the retry does
|
|
76
|
+
// not require a reboot or tear down the board's dedicated SPI2 bus.
|
|
77
|
+
if (!mounted) mounted = mountCard();
|
|
78
|
+
return mounted;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
} // namespace
|
|
82
|
+
|
|
83
|
+
void installSdCardFileCache()
|
|
84
|
+
{
|
|
85
|
+
setMountProvider(&ensureStorageMounted);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
} // namespace gea::platform::storage
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
#include "touch.h"
|
|
2
|
+
|
|
3
|
+
#include "board.h"
|
|
4
|
+
#include "buttons.h"
|
|
5
|
+
#include "host/display_orientation.h"
|
|
6
|
+
#include "i2c.h"
|
|
7
|
+
|
|
8
|
+
#include <atomic>
|
|
9
|
+
#include <cstdint>
|
|
10
|
+
|
|
11
|
+
#include "driver/i2c_master.h"
|
|
12
|
+
#include "esp_err.h"
|
|
13
|
+
#include "esp_lcd_panel_io.h"
|
|
14
|
+
#include "esp_lcd_touch.h"
|
|
15
|
+
#include "esp_lcd_touch_gt911.h"
|
|
16
|
+
#include "esp_log.h"
|
|
17
|
+
#include "freertos/FreeRTOS.h"
|
|
18
|
+
#include "freertos/semphr.h"
|
|
19
|
+
#include "freertos/task.h"
|
|
20
|
+
|
|
21
|
+
namespace {
|
|
22
|
+
|
|
23
|
+
constexpr char kTag[] = "papers3_touch";
|
|
24
|
+
constexpr int kPollIntervalMs = 10;
|
|
25
|
+
// Dedicated touch-sampling task cadence. The GT911 reports only the CURRENT
|
|
26
|
+
// finger state, not a buffered history, so a tap that goes down-and-up between
|
|
27
|
+
// two samples is lost entirely. On this board a page turn (SD read + paginate +
|
|
28
|
+
// ~200 ms e-paper flush) blocks the runtime frame loop far longer than a frame,
|
|
29
|
+
// and touch polling used to ride that same loop — so every tap during a draw
|
|
30
|
+
// vanished (the "rapid taps only skip 2 pages" bug). Sampling on its own task
|
|
31
|
+
// at 6 ms keeps catching down/up edges through the whole draw; the events queue
|
|
32
|
+
// and the runtime coalesces them into one multi-page skip when it comes back.
|
|
33
|
+
constexpr int kTouchTaskIntervalMs = 6;
|
|
34
|
+
constexpr int kMaxFingers = 2;
|
|
35
|
+
|
|
36
|
+
struct TouchSample {
|
|
37
|
+
bool touching = false;
|
|
38
|
+
int x = 0;
|
|
39
|
+
int y = 0;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
struct MultiSample {
|
|
43
|
+
int count = 0;
|
|
44
|
+
int x[kMaxFingers] = {0, 0};
|
|
45
|
+
int y[kMaxFingers] = {0, 0};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
class Gt911TouchController {
|
|
49
|
+
public:
|
|
50
|
+
static Gt911TouchController &instance()
|
|
51
|
+
{
|
|
52
|
+
static Gt911TouchController controller;
|
|
53
|
+
return controller;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
void setObserver(gea::platform::touch::Touchscreen::Observer observer) { observer_ = observer; }
|
|
57
|
+
void setPointerObserver(gea::platform::touch::Touchscreen::PointerObserver observer) { pointerObserver_ = observer; }
|
|
58
|
+
|
|
59
|
+
bool begin()
|
|
60
|
+
{
|
|
61
|
+
if (initialized_) return true;
|
|
62
|
+
// Touch is REAL on this board: the GT911 sits on I2C SDA 41 / SCL 42 and
|
|
63
|
+
// answers at 0x5D — confirmed by upstream PaperBoy running on this exact
|
|
64
|
+
// unit ("GT911 found at I2C 0x5D"). The LilyGo target this file came from
|
|
65
|
+
// deferred touch because its bus was unknown; that does not apply here,
|
|
66
|
+
// and on a device with no user button touch is the only input.
|
|
67
|
+
auto bus = gea::platform::i2c::Bus::primary();
|
|
68
|
+
// Fail honestly, as the M5Paper target does. This board has no user
|
|
69
|
+
// button, so touch is the ONLY input — reporting success without it
|
|
70
|
+
// would leave a device that renders but can never be driven.
|
|
71
|
+
if (!bus.available()) return false;
|
|
72
|
+
i2cBus_ = static_cast<i2c_master_bus_handle_t>(bus.nativeHandle());
|
|
73
|
+
|
|
74
|
+
esp_err_t err = attach(ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP);
|
|
75
|
+
if (err != ESP_OK) err = attach(ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS);
|
|
76
|
+
if (err != ESP_OK) {
|
|
77
|
+
ESP_LOGE(kTag, "GT911 not found at 0x14 or 0x5d");
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
initialized_ = true;
|
|
82
|
+
hwMutex_ = xSemaphoreCreateMutex();
|
|
83
|
+
// Sample the GT911 on a dedicated high-priority task so touch keeps being
|
|
84
|
+
// read even while the runtime frame task is blocked mid-page-draw. Pinned
|
|
85
|
+
// to PRO_CPU (core 0) at a priority above the runtime task (5) and the
|
|
86
|
+
// e-paper refresh task (6); if a CPU-bound page derive is running on the
|
|
87
|
+
// same core it is preempted every 6 ms, and if it's on the other core the
|
|
88
|
+
// sampling runs fully parallel. The task only READS the panel and QUEUES
|
|
89
|
+
// events (thread-safe via the FrameScheduler queue); event dispatch and
|
|
90
|
+
// rendering stay on the runtime task.
|
|
91
|
+
xTaskCreatePinnedToCore(touchTaskEntry, "papers3_touch", 3072, this, 7, &touchTask_, 0);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void poll(int nowMs)
|
|
96
|
+
{
|
|
97
|
+
gea::platform::papers3::buttons::poll(nowMs);
|
|
98
|
+
if (!initialized_) return;
|
|
99
|
+
// The dedicated task owns GT911 sampling; the frame-loop poll only drives
|
|
100
|
+
// the hardware buttons. Fall back to sampling here if the task never
|
|
101
|
+
// started (allocation failure), so touch still works degraded.
|
|
102
|
+
if (touchTask_ != nullptr) return;
|
|
103
|
+
const auto now = static_cast<std::uint32_t>(nowMs);
|
|
104
|
+
if (nextPollMs_ != 0 && static_cast<std::int32_t>(now - nextPollMs_) < 0) return;
|
|
105
|
+
nextPollMs_ = now + kPollIntervalMs;
|
|
106
|
+
pollOnce();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static void touchTaskEntry(void *arg)
|
|
110
|
+
{
|
|
111
|
+
auto *self = static_cast<Gt911TouchController *>(arg);
|
|
112
|
+
for (;;) {
|
|
113
|
+
self->pollOnce();
|
|
114
|
+
vTaskDelay(pdMS_TO_TICKS(kTouchTaskIntervalMs));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
int read(int *x, int *y)
|
|
119
|
+
{
|
|
120
|
+
current_ = readHardware();
|
|
121
|
+
if (x) *x = current_.x;
|
|
122
|
+
if (y) *y = current_.y;
|
|
123
|
+
return current_.touching ? 1 : 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
int readCached(int *x, int *y) const
|
|
127
|
+
{
|
|
128
|
+
if (x) *x = current_.x;
|
|
129
|
+
if (y) *y = current_.y;
|
|
130
|
+
return current_.touching ? 1 : 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void consumeLatestMove(int *x, int *y)
|
|
134
|
+
{
|
|
135
|
+
latestMoveQueued_.store(false, std::memory_order_release);
|
|
136
|
+
if (x) *x = latestMove_.x;
|
|
137
|
+
if (y) *y = latestMove_.y;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
void injectEvent(gea::platform::touch::Phase phase, bool touching, int x, int y)
|
|
141
|
+
{
|
|
142
|
+
current_ = TouchSample{touching, x, y};
|
|
143
|
+
latestMove_ = current_;
|
|
144
|
+
latestMoveQueued_.store(phase == gea::platform::touch::Phase::Move, std::memory_order_release);
|
|
145
|
+
notify(phase, touching, x, y, 0);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private:
|
|
149
|
+
esp_err_t attach(std::uint8_t address)
|
|
150
|
+
{
|
|
151
|
+
esp_lcd_panel_io_i2c_config_t ioConfig = {};
|
|
152
|
+
ioConfig.dev_addr = address;
|
|
153
|
+
ioConfig.scl_speed_hz = 100000; // shared SHT30 bus is specified at 100 kHz
|
|
154
|
+
ioConfig.control_phase_bytes = 1;
|
|
155
|
+
ioConfig.dc_bit_offset = 0;
|
|
156
|
+
ioConfig.lcd_cmd_bits = 16;
|
|
157
|
+
ioConfig.flags.disable_control_phase = 1;
|
|
158
|
+
|
|
159
|
+
esp_lcd_panel_io_handle_t io = nullptr;
|
|
160
|
+
esp_err_t err = esp_lcd_new_panel_io_i2c(i2cBus_, &ioConfig, &io);
|
|
161
|
+
if (err != ESP_OK) return err;
|
|
162
|
+
|
|
163
|
+
esp_lcd_touch_config_t config = {};
|
|
164
|
+
config.x_max = gea::platform::display::kNativeWidth;
|
|
165
|
+
config.y_max = gea::platform::display::kNativeHeight;
|
|
166
|
+
config.rst_gpio_num = gea::platform::board::touch.reset;
|
|
167
|
+
config.int_gpio_num = gea::platform::board::touch.interrupt;
|
|
168
|
+
config.levels.reset = 0;
|
|
169
|
+
config.levels.interrupt = 0;
|
|
170
|
+
config.flags.swap_xy = false;
|
|
171
|
+
config.flags.mirror_x = false;
|
|
172
|
+
config.flags.mirror_y = false;
|
|
173
|
+
|
|
174
|
+
err = esp_lcd_touch_new_i2c_gt911(io, &config, &touch_);
|
|
175
|
+
if (err != ESP_OK) {
|
|
176
|
+
esp_lcd_panel_io_del(io);
|
|
177
|
+
return err;
|
|
178
|
+
}
|
|
179
|
+
touchIo_ = io;
|
|
180
|
+
ESP_LOGI(kTag, "GT911 ready address=0x%02x INT=%d", address, static_cast<int>(config.int_gpio_num));
|
|
181
|
+
return ESP_OK;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
MultiSample readMulti()
|
|
185
|
+
{
|
|
186
|
+
MultiSample result;
|
|
187
|
+
if (!touch_) return result;
|
|
188
|
+
// read_data fills the touch handle's internal buffer and get_coordinates
|
|
189
|
+
// drains it — a two-step, non-atomic sequence on shared state. Now that a
|
|
190
|
+
// dedicated task samples continuously, an app-driven read() on the runtime
|
|
191
|
+
// task could interleave and mix the two callers' data (or glitch the
|
|
192
|
+
// driver's point state). Serialize the pair (mutex created in begin();
|
|
193
|
+
// a null mutex just skips locking — degraded, not broken).
|
|
194
|
+
if (hwMutex_) xSemaphoreTake(hwMutex_, portMAX_DELAY);
|
|
195
|
+
esp_lcd_touch_read_data(touch_);
|
|
196
|
+
std::uint16_t xs[kMaxFingers] = {};
|
|
197
|
+
std::uint16_t ys[kMaxFingers] = {};
|
|
198
|
+
std::uint16_t strengths[kMaxFingers] = {};
|
|
199
|
+
std::uint8_t count = 0;
|
|
200
|
+
const bool ok = esp_lcd_touch_get_coordinates(touch_, xs, ys, strengths, &count, kMaxFingers);
|
|
201
|
+
if (hwMutex_) xSemaphoreGive(hwMutex_);
|
|
202
|
+
if (!ok || count == 0) return result;
|
|
203
|
+
result.count = count > kMaxFingers ? kMaxFingers : static_cast<int>(count);
|
|
204
|
+
for (int i = 0; i < result.count; ++i) {
|
|
205
|
+
int x = xs[i];
|
|
206
|
+
int y = ys[i];
|
|
207
|
+
gea::framework::display::detail::DisplayOrientationState::mapPanelToViewport(&x, &y);
|
|
208
|
+
result.x[i] = x;
|
|
209
|
+
result.y[i] = y;
|
|
210
|
+
}
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
TouchSample readHardware()
|
|
215
|
+
{
|
|
216
|
+
const MultiSample sample = readMulti();
|
|
217
|
+
if (sample.count == 0) return TouchSample{false, current_.x, current_.y};
|
|
218
|
+
return TouchSample{true, sample.x[0], sample.y[0]};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
void notify(gea::platform::touch::Phase phase, bool touching, int x, int y, int pointerId)
|
|
222
|
+
{
|
|
223
|
+
if (pointerObserver_) pointerObserver_(phase, touching, x, y, pointerId);
|
|
224
|
+
else if (observer_ && pointerId == 0) observer_(phase, touching, x, y);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
void pollOnce()
|
|
228
|
+
{
|
|
229
|
+
const MultiSample sample = readMulti();
|
|
230
|
+
if (sample.count > 0) current_ = TouchSample{true, sample.x[0], sample.y[0]};
|
|
231
|
+
else current_.touching = false;
|
|
232
|
+
|
|
233
|
+
for (int slot = 0; slot < kMaxFingers; ++slot) {
|
|
234
|
+
const bool nowActive = slot < sample.count;
|
|
235
|
+
const int x = nowActive ? sample.x[slot] : oldX_[slot];
|
|
236
|
+
const int y = nowActive ? sample.y[slot] : oldY_[slot];
|
|
237
|
+
if (nowActive && !active_[slot]) {
|
|
238
|
+
notify(gea::platform::touch::Phase::Down, true, x, y, slot);
|
|
239
|
+
} else if (nowActive && active_[slot] && (x != oldX_[slot] || y != oldY_[slot])) {
|
|
240
|
+
if (slot == 0) {
|
|
241
|
+
latestMove_ = TouchSample{true, x, y};
|
|
242
|
+
if (!latestMoveQueued_.exchange(true, std::memory_order_acq_rel))
|
|
243
|
+
notify(gea::platform::touch::Phase::Move, true, x, y, slot);
|
|
244
|
+
} else {
|
|
245
|
+
notify(gea::platform::touch::Phase::Move, true, x, y, slot);
|
|
246
|
+
}
|
|
247
|
+
} else if (!nowActive && active_[slot]) {
|
|
248
|
+
notify(gea::platform::touch::Phase::Up, false, x, y, slot);
|
|
249
|
+
}
|
|
250
|
+
if (nowActive) {
|
|
251
|
+
oldX_[slot] = x;
|
|
252
|
+
oldY_[slot] = y;
|
|
253
|
+
}
|
|
254
|
+
active_[slot] = nowActive;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
gea::platform::touch::Touchscreen::Observer observer_ = nullptr;
|
|
259
|
+
gea::platform::touch::Touchscreen::PointerObserver pointerObserver_ = nullptr;
|
|
260
|
+
i2c_master_bus_handle_t i2cBus_ = nullptr;
|
|
261
|
+
esp_lcd_touch_handle_t touch_ = nullptr;
|
|
262
|
+
esp_lcd_panel_io_handle_t touchIo_ = nullptr;
|
|
263
|
+
TouchSample current_ = {};
|
|
264
|
+
TouchSample latestMove_ = {};
|
|
265
|
+
std::atomic<bool> latestMoveQueued_{false};
|
|
266
|
+
bool active_[kMaxFingers] = {};
|
|
267
|
+
int oldX_[kMaxFingers] = {};
|
|
268
|
+
int oldY_[kMaxFingers] = {};
|
|
269
|
+
std::uint32_t nextPollMs_ = 0;
|
|
270
|
+
bool initialized_ = false;
|
|
271
|
+
TaskHandle_t touchTask_ = nullptr;
|
|
272
|
+
SemaphoreHandle_t hwMutex_ = nullptr;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
} // namespace
|
|
276
|
+
|
|
277
|
+
void gea::platform::touch::Touchscreen::setObserver(Observer observer) { Gt911TouchController::instance().setObserver(observer); }
|
|
278
|
+
void gea::platform::touch::Touchscreen::setPointerObserver(PointerObserver observer) { Gt911TouchController::instance().setPointerObserver(observer); }
|
|
279
|
+
bool gea::platform::touch::Touchscreen::init() { return Gt911TouchController::instance().begin(); }
|
|
280
|
+
void gea::platform::touch::Touchscreen::poll(int nowMs) { Gt911TouchController::instance().poll(nowMs); }
|
|
281
|
+
int gea::platform::touch::Touchscreen::read(int *x, int *y) { return Gt911TouchController::instance().read(x, y); }
|
|
282
|
+
int gea::platform::touch::Touchscreen::readCached(int *x, int *y) { return Gt911TouchController::instance().readCached(x, y); }
|
|
283
|
+
void gea::platform::touch::Touchscreen::consumeLatestMove(int *x, int *y) { Gt911TouchController::instance().consumeLatestMove(x, y); }
|
|
284
|
+
void gea::platform::touch::Touchscreen::injectEvent(Phase phase, bool touching, int x, int y)
|
|
285
|
+
{
|
|
286
|
+
Gt911TouchController::instance().injectEvent(phase, touching, x, y);
|
|
287
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# M5Stack PaperS3, 16 MB flash. Two 7 MB OTA slots leave 1.875 MB for
|
|
2
|
+
# the local file cache while keeping every app partition 64 KiB aligned.
|
|
3
|
+
# Name, Type, SubType, Offset, Size
|
|
4
|
+
nvs, data, nvs, 0x9000, 0x6000
|
|
5
|
+
otadata, data, ota, 0xf000, 0x2000
|
|
6
|
+
phy_init, data, phy, 0x11000, 0x1000
|
|
7
|
+
ota_0, app, ota_0, 0x20000, 0x700000
|
|
8
|
+
ota_1, app, ota_1, 0x720000, 0x700000
|
|
9
|
+
storage, data, spiffs, 0xe20000, 0x1e0000
|