@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,299 @@
|
|
|
1
|
+
#include "board.h"
|
|
2
|
+
#include "i2c.h"
|
|
3
|
+
#include "touch.h"
|
|
4
|
+
|
|
5
|
+
#include <atomic>
|
|
6
|
+
#include <cstddef>
|
|
7
|
+
#include <cstdint>
|
|
8
|
+
|
|
9
|
+
#include "driver/gpio.h"
|
|
10
|
+
#include "driver/i2c_master.h"
|
|
11
|
+
#include "esp_attr.h"
|
|
12
|
+
#include "esp_check.h"
|
|
13
|
+
#include "esp_err.h"
|
|
14
|
+
#include "esp_log.h"
|
|
15
|
+
#include "freertos/FreeRTOS.h"
|
|
16
|
+
#include "freertos/task.h"
|
|
17
|
+
|
|
18
|
+
namespace {
|
|
19
|
+
|
|
20
|
+
using Phase = gea::platform::touch::Phase;
|
|
21
|
+
using Touchscreen = gea::platform::touch::Touchscreen;
|
|
22
|
+
|
|
23
|
+
constexpr char kTag[] = "t-display-touch";
|
|
24
|
+
constexpr std::uint8_t kCst3530Address = 0x58;
|
|
25
|
+
constexpr std::uint8_t kAxs15231Address = 0x3b;
|
|
26
|
+
constexpr int kNativeWidth = 180;
|
|
27
|
+
constexpr int kNativeHeight = 640;
|
|
28
|
+
constexpr int kPollIntervalMs = 10;
|
|
29
|
+
constexpr int kTaskPriority = 4;
|
|
30
|
+
constexpr std::uint32_t kTaskStackWords = 3072;
|
|
31
|
+
|
|
32
|
+
enum class Controller : std::uint8_t {
|
|
33
|
+
None,
|
|
34
|
+
Cst3530,
|
|
35
|
+
Axs15231,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
struct TouchSample {
|
|
39
|
+
bool touching = false;
|
|
40
|
+
int x = 0;
|
|
41
|
+
int y = 0;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
struct HardwareSample {
|
|
45
|
+
bool valid = false;
|
|
46
|
+
TouchSample touch{};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
Touchscreen::Observer gObserver = nullptr;
|
|
50
|
+
Touchscreen::PointerObserver gPointerObserver = nullptr;
|
|
51
|
+
i2c_master_dev_handle_t gDevice = nullptr;
|
|
52
|
+
Controller gController = Controller::None;
|
|
53
|
+
TouchSample gCurrent{};
|
|
54
|
+
TouchSample gLatestMove{};
|
|
55
|
+
std::atomic<bool> gLatestMoveQueued{false};
|
|
56
|
+
TaskHandle_t gTask = nullptr;
|
|
57
|
+
StaticTask_t gTaskControlBlock{};
|
|
58
|
+
StackType_t gTaskStack[kTaskStackWords]{};
|
|
59
|
+
|
|
60
|
+
void notify(Phase phase, const TouchSample &sample)
|
|
61
|
+
{
|
|
62
|
+
if (gPointerObserver) {
|
|
63
|
+
gPointerObserver(phase, sample.touching, sample.x, sample.y, 0);
|
|
64
|
+
} else if (gObserver) {
|
|
65
|
+
gObserver(phase, sample.touching, sample.x, sample.y);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void notifyMove(const TouchSample &sample)
|
|
70
|
+
{
|
|
71
|
+
gLatestMove = sample;
|
|
72
|
+
if (gLatestMoveQueued.exchange(true, std::memory_order_acq_rel)) return;
|
|
73
|
+
notify(Phase::Move, sample);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
esp_err_t transmit(const std::uint8_t *bytes, std::size_t size)
|
|
77
|
+
{
|
|
78
|
+
return i2c_master_transmit(gDevice, bytes, size, 100);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
HardwareSample readHardware()
|
|
82
|
+
{
|
|
83
|
+
std::uint8_t report[11]{};
|
|
84
|
+
const std::uint8_t *command = nullptr;
|
|
85
|
+
std::size_t commandSize = 0;
|
|
86
|
+
std::size_t reportSize = 0;
|
|
87
|
+
static constexpr std::uint8_t cstCommand[] = {0xd0, 0x07, 0x00, 0x00};
|
|
88
|
+
static constexpr std::uint8_t axsCommand[] = {
|
|
89
|
+
0xb5, 0xab, 0xa5, 0x5a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (gController == Controller::Cst3530) {
|
|
93
|
+
command = cstCommand;
|
|
94
|
+
commandSize = sizeof(cstCommand);
|
|
95
|
+
reportSize = 9;
|
|
96
|
+
} else if (gController == Controller::Axs15231) {
|
|
97
|
+
command = axsCommand;
|
|
98
|
+
commandSize = sizeof(axsCommand);
|
|
99
|
+
reportSize = 8;
|
|
100
|
+
} else {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
esp_err_t status = ESP_FAIL;
|
|
105
|
+
for (int attempt = 0; attempt < 2; ++attempt) {
|
|
106
|
+
status = i2c_master_transmit(gDevice, command, commandSize, 20);
|
|
107
|
+
if (status == ESP_OK) status = i2c_master_receive(gDevice, report, reportSize, 20);
|
|
108
|
+
if (status == ESP_OK) break;
|
|
109
|
+
}
|
|
110
|
+
if (status != ESP_OK) return {};
|
|
111
|
+
|
|
112
|
+
HardwareSample sample{.valid = true};
|
|
113
|
+
if (gController == Controller::Cst3530) {
|
|
114
|
+
const std::uint16_t checksum = static_cast<std::uint16_t>(
|
|
115
|
+
0x55U + report[4] + report[5] + report[6] + report[7] + report[8]);
|
|
116
|
+
const std::uint16_t expected = static_cast<std::uint16_t>(report[0] | (report[1] << 8U));
|
|
117
|
+
const std::uint8_t ack[] = {0xd0, 0x00, 0x02, 0xab};
|
|
118
|
+
(void)transmit(ack, sizeof(ack));
|
|
119
|
+
const std::uint8_t fingerCount = report[3] & 0x0fU;
|
|
120
|
+
if (report[2] != 0xffU || fingerCount > 1U) return {};
|
|
121
|
+
if (fingerCount == 0U || (report[8] >> 4U) == 0U) return sample;
|
|
122
|
+
if (checksum != expected) return {};
|
|
123
|
+
sample.touch.touching = true;
|
|
124
|
+
sample.touch.x = report[4] | ((report[7] & 0x0f) << 8);
|
|
125
|
+
sample.touch.y = report[5] | ((report[7] & 0xf0) << 4);
|
|
126
|
+
} else {
|
|
127
|
+
const std::uint8_t fingerCount = report[1];
|
|
128
|
+
const std::uint8_t touchEvent = report[2] >> 4U;
|
|
129
|
+
if (fingerCount != 1U || touchEvent != 0x08U) return sample;
|
|
130
|
+
sample.touch.touching = true;
|
|
131
|
+
sample.touch.x = ((report[4] & 0x0f) << 8) | report[5];
|
|
132
|
+
sample.touch.y = kNativeHeight - (((report[2] & 0x0f) << 8) | report[3]);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (sample.touch.x < 0 || sample.touch.x >= kNativeWidth ||
|
|
136
|
+
sample.touch.y < 0 || sample.touch.y >= kNativeHeight) {
|
|
137
|
+
return {};
|
|
138
|
+
}
|
|
139
|
+
return sample;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
void pollLoop()
|
|
143
|
+
{
|
|
144
|
+
bool active = false;
|
|
145
|
+
while (true) {
|
|
146
|
+
const TickType_t wait = active ? pdMS_TO_TICKS(kPollIntervalMs) : portMAX_DELAY;
|
|
147
|
+
(void)ulTaskNotifyTake(pdTRUE, wait);
|
|
148
|
+
const HardwareSample result = readHardware();
|
|
149
|
+
if (!result.valid) continue;
|
|
150
|
+
|
|
151
|
+
const TouchSample next = result.touch.touching
|
|
152
|
+
? result.touch
|
|
153
|
+
: TouchSample{false, gCurrent.x, gCurrent.y};
|
|
154
|
+
if (next.touching && !active) {
|
|
155
|
+
gLatestMove = next;
|
|
156
|
+
notify(Phase::Down, next);
|
|
157
|
+
} else if (next.touching && active &&
|
|
158
|
+
(next.x != gCurrent.x || next.y != gCurrent.y)) {
|
|
159
|
+
notifyMove(next);
|
|
160
|
+
} else if (!next.touching && active) {
|
|
161
|
+
notify(Phase::Up, next);
|
|
162
|
+
}
|
|
163
|
+
gCurrent = next;
|
|
164
|
+
active = next.touching;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
void taskEntry(void *)
|
|
169
|
+
{
|
|
170
|
+
pollLoop();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
void IRAM_ATTR interruptEntry(void *)
|
|
174
|
+
{
|
|
175
|
+
BaseType_t wake = pdFALSE;
|
|
176
|
+
if (gTask) vTaskNotifyGiveFromISR(gTask, &wake);
|
|
177
|
+
portYIELD_FROM_ISR(wake);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
esp_err_t resetController()
|
|
181
|
+
{
|
|
182
|
+
constexpr gpio_num_t reset = gea::platform::board::touch.reset;
|
|
183
|
+
gpio_config_t config{};
|
|
184
|
+
config.pin_bit_mask = 1ULL << static_cast<unsigned>(reset);
|
|
185
|
+
config.mode = GPIO_MODE_OUTPUT;
|
|
186
|
+
ESP_RETURN_ON_ERROR(gpio_config(&config), kTag, "touch reset GPIO");
|
|
187
|
+
gpio_set_level(reset, 0);
|
|
188
|
+
vTaskDelay(pdMS_TO_TICKS(8));
|
|
189
|
+
gpio_set_level(reset, 1);
|
|
190
|
+
vTaskDelay(pdMS_TO_TICKS(50));
|
|
191
|
+
return ESP_OK;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
esp_err_t attachDevice(i2c_master_bus_handle_t bus)
|
|
195
|
+
{
|
|
196
|
+
std::uint8_t address = 0;
|
|
197
|
+
if (i2c_master_probe(bus, kCst3530Address, 100) == ESP_OK) {
|
|
198
|
+
gController = Controller::Cst3530;
|
|
199
|
+
address = kCst3530Address;
|
|
200
|
+
} else if (i2c_master_probe(bus, kAxs15231Address, 100) == ESP_OK) {
|
|
201
|
+
gController = Controller::Axs15231;
|
|
202
|
+
address = kAxs15231Address;
|
|
203
|
+
} else {
|
|
204
|
+
return ESP_ERR_NOT_FOUND;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
i2c_device_config_t config{};
|
|
208
|
+
config.dev_addr_length = I2C_ADDR_BIT_LEN_7;
|
|
209
|
+
config.device_address = address;
|
|
210
|
+
config.scl_speed_hz = 200000;
|
|
211
|
+
ESP_RETURN_ON_ERROR(i2c_master_bus_add_device(bus, &config, &gDevice), kTag, "touch device");
|
|
212
|
+
|
|
213
|
+
if (gController == Controller::Cst3530) {
|
|
214
|
+
static constexpr std::uint8_t commands[][4] = {
|
|
215
|
+
{0xd0, 0x00, 0x04, 0x00}, {0xd0, 0x00, 0x04, 0x00},
|
|
216
|
+
{0xd0, 0x00, 0x00, 0x00}, {0xd0, 0x00, 0x0c, 0x00},
|
|
217
|
+
{0xd0, 0x00, 0x01, 0x00},
|
|
218
|
+
};
|
|
219
|
+
for (const auto &command : commands) {
|
|
220
|
+
(void)transmit(command, sizeof(command));
|
|
221
|
+
vTaskDelay(pdMS_TO_TICKS(1));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
ESP_LOGI(kTag, "Detected %s touch controller at 0x%02x",
|
|
225
|
+
gController == Controller::Cst3530 ? "CST3530" : "AXS15231", address);
|
|
226
|
+
return ESP_OK;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
esp_err_t startTaskAndInterrupt()
|
|
230
|
+
{
|
|
231
|
+
gTask = xTaskCreateStaticPinnedToCore(taskEntry, "t-display-touch", kTaskStackWords,
|
|
232
|
+
nullptr, kTaskPriority, gTaskStack,
|
|
233
|
+
&gTaskControlBlock, 1);
|
|
234
|
+
if (!gTask) return ESP_ERR_NO_MEM;
|
|
235
|
+
|
|
236
|
+
constexpr gpio_num_t interrupt = gea::platform::board::touch.interrupt;
|
|
237
|
+
gpio_config_t config{};
|
|
238
|
+
config.pin_bit_mask = 1ULL << static_cast<unsigned>(interrupt);
|
|
239
|
+
config.mode = GPIO_MODE_INPUT;
|
|
240
|
+
config.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
241
|
+
config.intr_type = GPIO_INTR_NEGEDGE;
|
|
242
|
+
ESP_RETURN_ON_ERROR(gpio_config(&config), kTag, "touch interrupt GPIO");
|
|
243
|
+
esp_err_t status = gpio_install_isr_service(0);
|
|
244
|
+
if (status != ESP_OK && status != ESP_ERR_INVALID_STATE) return status;
|
|
245
|
+
ESP_RETURN_ON_ERROR(gpio_isr_handler_add(interrupt, interruptEntry, nullptr),
|
|
246
|
+
kTag, "touch interrupt handler");
|
|
247
|
+
if (gpio_get_level(interrupt) == 0) xTaskNotifyGive(gTask);
|
|
248
|
+
return ESP_OK;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
} // namespace
|
|
252
|
+
|
|
253
|
+
void gea::platform::touch::Touchscreen::setObserver(Observer observer)
|
|
254
|
+
{
|
|
255
|
+
gObserver = observer;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
void gea::platform::touch::Touchscreen::setPointerObserver(PointerObserver observer)
|
|
259
|
+
{
|
|
260
|
+
gPointerObserver = observer;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
bool gea::platform::touch::Touchscreen::init()
|
|
264
|
+
{
|
|
265
|
+
auto bus = gea::platform::i2c::Bus::primary();
|
|
266
|
+
if (!bus.available()) return false;
|
|
267
|
+
if (resetController() != ESP_OK) return false;
|
|
268
|
+
if (attachDevice(static_cast<i2c_master_bus_handle_t>(bus.nativeHandle())) != ESP_OK) return false;
|
|
269
|
+
if (startTaskAndInterrupt() != ESP_OK) return false;
|
|
270
|
+
ESP_LOGI(kTag, "Physical touch ready (interrupt-driven)");
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
int gea::platform::touch::Touchscreen::read(int *x, int *y)
|
|
275
|
+
{
|
|
276
|
+
if (x) *x = gCurrent.x;
|
|
277
|
+
if (y) *y = gCurrent.y;
|
|
278
|
+
return gCurrent.touching ? 1 : 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
int gea::platform::touch::Touchscreen::readCached(int *x, int *y)
|
|
282
|
+
{
|
|
283
|
+
return read(x, y);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
void gea::platform::touch::Touchscreen::consumeLatestMove(int *x, int *y)
|
|
287
|
+
{
|
|
288
|
+
gLatestMoveQueued.store(false, std::memory_order_release);
|
|
289
|
+
if (x) *x = gLatestMove.x;
|
|
290
|
+
if (y) *y = gLatestMove.y;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
void gea::platform::touch::Touchscreen::injectEvent(Phase phase, bool touching, int x, int y)
|
|
294
|
+
{
|
|
295
|
+
const TouchSample sample{touching, x, y};
|
|
296
|
+
gCurrent = sample;
|
|
297
|
+
if (phase == Phase::Move) notifyMove(sample);
|
|
298
|
+
else notify(phase, sample);
|
|
299
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
CONFIG_IDF_TARGET="esp32s3"
|
|
2
|
+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
|
3
|
+
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
|
|
4
|
+
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
|
|
5
|
+
CONFIG_FREERTOS_HZ=1000
|
|
6
|
+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
|
7
|
+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
|
|
8
|
+
CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768
|
|
9
|
+
CONFIG_ESP_IPC_TASK_STACK_SIZE=16384
|
|
10
|
+
CONFIG_PARTITION_TABLE_CUSTOM=y
|
|
11
|
+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|
12
|
+
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
|
|
13
|
+
|
|
14
|
+
# ESP32-S3R8: 8 MB octal PSRAM.
|
|
15
|
+
CONFIG_SPIRAM=y
|
|
16
|
+
CONFIG_SPIRAM_MODE_OCT=y
|
|
17
|
+
CONFIG_SPIRAM_SPEED_80M=y
|
|
18
|
+
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
|
|
19
|
+
CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y
|
|
20
|
+
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
|
21
|
+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
|
|
22
|
+
|
|
23
|
+
# The shared ESP32 bootstrap registers the BLE HID seam regardless of the
|
|
24
|
+
# active app's feature set, matching the established AMOLED targets.
|
|
25
|
+
# CONFIG_BT_ENABLED is not set
|
|
26
|
+
|
|
27
|
+
# esp_peer is part of the shared target surface even when an individual app
|
|
28
|
+
# does not use networking, so its DTLS-SRTP translation units must remain
|
|
29
|
+
# buildable in the minimal component graph.
|
|
30
|
+
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
|
|
31
|
+
CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
|
|
32
|
+
CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
|
|
33
|
+
CONFIG_MBEDTLS_X509_CREATE_C=y
|
|
34
|
+
CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
|
|
35
|
+
CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
|
|
36
|
+
|
|
37
|
+
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
|
38
|
+
# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
|
|
39
|
+
# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
|
|
40
|
+
# Keep production assertions, but omit assertion strings so OTA images remain
|
|
41
|
+
# compatible with displays provisioned with the original 2 MiB app slots.
|
|
42
|
+
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set
|
|
43
|
+
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
|
44
|
+
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
|
45
|
+
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
|
46
|
+
CONFIG_LOG_DEFAULT_LEVEL=3
|
|
47
|
+
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
|
48
|
+
CONFIG_LOG_MAXIMUM_LEVEL=3
|
|
49
|
+
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
|
50
|
+
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
|
|
3
|
+
set(EXTRA_COMPONENT_DIRS
|
|
4
|
+
"${CMAKE_CURRENT_LIST_DIR}/../esp32/components"
|
|
5
|
+
"${CMAKE_CURRENT_LIST_DIR}/components")
|
|
6
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../esp32/app_project.cmake")
|
|
7
|
+
set(GEA_EMBEDDED_APP "tic-tac-toe" CACHE STRING "Example app to build (must match a package.json gea.id)")
|
|
8
|
+
set(PROJECT_VER "${GEA_EMBEDDED_APP}" CACHE STRING "Firmware app id" FORCE)
|
|
9
|
+
|
|
10
|
+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
11
|
+
idf_build_set_property(MINIMAL_BUILD ON)
|
|
12
|
+
project(gea_embedded)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ED047TC1 driver for the LilyGo T5 4.7" E-Paper S3. Our own esp_lcd i80
|
|
2
|
+
# implementation (gea_epd.c) of the epd_driver.h API, replacing the vendored
|
|
3
|
+
# LilyGo legacy I2S-in-LCD path (epd_driver.c / i2s_data_bus.c / ed047tc1.c /
|
|
4
|
+
# rmt_pulse.c), which does not port to the S3 / IDF 6. Those files are kept in
|
|
5
|
+
# the tree for reference but are NOT compiled; only their headers (epd_driver.h
|
|
6
|
+
# for the API + types, ed047tc1.h for the S3 pin map) are used.
|
|
7
|
+
idf_component_register(
|
|
8
|
+
SRCS "gea_epd.c"
|
|
9
|
+
INCLUDE_DIRS "."
|
|
10
|
+
REQUIRES driver esp_lcd esp_driver_gpio esp_driver_i2c esp_timer
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# epd_driver.h declares the draw entrypoints IRAM_ATTR; with -ffunction-sections
|
|
14
|
+
# GCC reports the declaration's .iram1.N section as "conflicting" with the
|
|
15
|
+
# definition's and, benignly, ignores the second (the function still lands in
|
|
16
|
+
# IRAM). -Werror turns that into a build stop, so relax just this warning.
|
|
17
|
+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-error=attributes)
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
|
|
2
|
+
/******************************************************************************/
|
|
3
|
+
/*** include files ***/
|
|
4
|
+
/******************************************************************************/
|
|
5
|
+
|
|
6
|
+
#include "ed047tc1.h"
|
|
7
|
+
#include "i2s_data_bus.h"
|
|
8
|
+
#include "rmt_pulse.h"
|
|
9
|
+
|
|
10
|
+
#if ESP_IDF_VERSION_MAJOR >= 5
|
|
11
|
+
#include <soc/gpio_struct.h> // GPIO.out_w1ts / GPIO.out_w1tc — required in IDF 5.x
|
|
12
|
+
#else
|
|
13
|
+
#include <hal/gpio_ll.h>
|
|
14
|
+
#endif
|
|
15
|
+
#include <xtensa/core-macros.h>
|
|
16
|
+
|
|
17
|
+
#include <string.h>
|
|
18
|
+
|
|
19
|
+
/******************************************************************************/
|
|
20
|
+
/*** macro definitions ***/
|
|
21
|
+
/******************************************************************************/
|
|
22
|
+
|
|
23
|
+
/******************************************************************************/
|
|
24
|
+
/*** type definitions ***/
|
|
25
|
+
/******************************************************************************/
|
|
26
|
+
|
|
27
|
+
typedef struct
|
|
28
|
+
{
|
|
29
|
+
bool ep_latch_enable : 1;
|
|
30
|
+
bool power_disable : 1;
|
|
31
|
+
bool pos_power_enable : 1;
|
|
32
|
+
bool neg_power_enable : 1;
|
|
33
|
+
bool ep_stv : 1;
|
|
34
|
+
bool ep_scan_direction : 1;
|
|
35
|
+
bool ep_mode : 1;
|
|
36
|
+
bool ep_output_enable : 1;
|
|
37
|
+
} epd_config_register_t;
|
|
38
|
+
|
|
39
|
+
/******************************************************************************/
|
|
40
|
+
/*** local function prototypes ***/
|
|
41
|
+
/******************************************************************************/
|
|
42
|
+
|
|
43
|
+
/******************************************************************************/
|
|
44
|
+
/*** exported variables ***/
|
|
45
|
+
/******************************************************************************/
|
|
46
|
+
|
|
47
|
+
/******************************************************************************/
|
|
48
|
+
/*** local variables ***/
|
|
49
|
+
/******************************************************************************/
|
|
50
|
+
|
|
51
|
+
static epd_config_register_t config_reg;
|
|
52
|
+
|
|
53
|
+
/******************************************************************************/
|
|
54
|
+
/*** exported functions ***/
|
|
55
|
+
/******************************************************************************/
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Write bits directly using the registers.
|
|
59
|
+
* Won't work for some pins (>= 32).
|
|
60
|
+
*/
|
|
61
|
+
inline static void fast_gpio_set_hi(gpio_num_t gpio_num)
|
|
62
|
+
{
|
|
63
|
+
GPIO.out_w1ts = (1 << gpio_num);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
inline static void fast_gpio_set_lo(gpio_num_t gpio_num)
|
|
67
|
+
{
|
|
68
|
+
GPIO.out_w1tc = (1 << gpio_num);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
inline static void IRAM_ATTR push_cfg_bit(bool bit)
|
|
72
|
+
{
|
|
73
|
+
fast_gpio_set_lo(CFG_CLK);
|
|
74
|
+
if (bit)
|
|
75
|
+
{
|
|
76
|
+
fast_gpio_set_hi(CFG_DATA);
|
|
77
|
+
}
|
|
78
|
+
else
|
|
79
|
+
{
|
|
80
|
+
fast_gpio_set_lo(CFG_DATA);
|
|
81
|
+
}
|
|
82
|
+
fast_gpio_set_hi(CFG_CLK);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static void IRAM_ATTR push_cfg(epd_config_register_t *cfg)
|
|
86
|
+
{
|
|
87
|
+
fast_gpio_set_lo(CFG_STR);
|
|
88
|
+
|
|
89
|
+
// push config bits in reverse order
|
|
90
|
+
push_cfg_bit(cfg->ep_output_enable);
|
|
91
|
+
push_cfg_bit(cfg->ep_mode);
|
|
92
|
+
push_cfg_bit(cfg->ep_scan_direction);
|
|
93
|
+
push_cfg_bit(cfg->ep_stv);
|
|
94
|
+
|
|
95
|
+
push_cfg_bit(cfg->neg_power_enable);
|
|
96
|
+
push_cfg_bit(cfg->pos_power_enable);
|
|
97
|
+
push_cfg_bit(cfg->power_disable);
|
|
98
|
+
push_cfg_bit(cfg->ep_latch_enable);
|
|
99
|
+
|
|
100
|
+
fast_gpio_set_hi(CFG_STR);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
void IRAM_ATTR busy_delay(uint32_t cycles)
|
|
105
|
+
{
|
|
106
|
+
volatile uint64_t counts = XTHAL_GET_CCOUNT() + cycles;
|
|
107
|
+
while (XTHAL_GET_CCOUNT() < counts) ;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
void epd_base_init(uint32_t epd_row_width)
|
|
112
|
+
{
|
|
113
|
+
config_reg.ep_latch_enable = false;
|
|
114
|
+
config_reg.power_disable = true;
|
|
115
|
+
config_reg.pos_power_enable = false;
|
|
116
|
+
config_reg.neg_power_enable = false;
|
|
117
|
+
config_reg.ep_stv = true;
|
|
118
|
+
config_reg.ep_scan_direction = true;
|
|
119
|
+
config_reg.ep_mode = false;
|
|
120
|
+
config_reg.ep_output_enable = false;
|
|
121
|
+
|
|
122
|
+
/* Power Control Output/Off */
|
|
123
|
+
gpio_set_direction(CFG_DATA, GPIO_MODE_OUTPUT);
|
|
124
|
+
gpio_set_direction(CFG_CLK, GPIO_MODE_OUTPUT);
|
|
125
|
+
gpio_set_direction(CFG_STR, GPIO_MODE_OUTPUT);
|
|
126
|
+
fast_gpio_set_lo(CFG_STR);
|
|
127
|
+
|
|
128
|
+
push_cfg(&config_reg);
|
|
129
|
+
|
|
130
|
+
// Setup I2S
|
|
131
|
+
i2s_bus_config i2s_config;
|
|
132
|
+
// add an offset off dummy bytes to allow for enough timing headroom
|
|
133
|
+
i2s_config.epd_row_width = epd_row_width + 32;
|
|
134
|
+
i2s_config.clock = CKH;
|
|
135
|
+
i2s_config.start_pulse = STH;
|
|
136
|
+
i2s_config.data_0 = D0;
|
|
137
|
+
i2s_config.data_1 = D1;
|
|
138
|
+
i2s_config.data_2 = D2;
|
|
139
|
+
i2s_config.data_3 = D3;
|
|
140
|
+
i2s_config.data_4 = D4;
|
|
141
|
+
i2s_config.data_5 = D5;
|
|
142
|
+
i2s_config.data_6 = D6;
|
|
143
|
+
i2s_config.data_7 = D7;
|
|
144
|
+
|
|
145
|
+
i2s_bus_init(&i2s_config);
|
|
146
|
+
|
|
147
|
+
rmt_pulse_init(CKV);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
void epd_poweron()
|
|
151
|
+
{
|
|
152
|
+
config_reg.ep_scan_direction = true;
|
|
153
|
+
config_reg.power_disable = false;
|
|
154
|
+
push_cfg(&config_reg);
|
|
155
|
+
busy_delay(100 * 240);
|
|
156
|
+
config_reg.neg_power_enable = true;
|
|
157
|
+
push_cfg(&config_reg);
|
|
158
|
+
busy_delay(500 * 240);
|
|
159
|
+
config_reg.pos_power_enable = true;
|
|
160
|
+
push_cfg(&config_reg);
|
|
161
|
+
busy_delay(100 * 240);
|
|
162
|
+
config_reg.ep_stv = true;
|
|
163
|
+
push_cfg(&config_reg);
|
|
164
|
+
fast_gpio_set_hi(STH);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
void epd_poweroff()
|
|
168
|
+
{
|
|
169
|
+
config_reg.pos_power_enable = false;
|
|
170
|
+
push_cfg(&config_reg);
|
|
171
|
+
busy_delay(10 * 240);
|
|
172
|
+
config_reg.neg_power_enable = false;
|
|
173
|
+
push_cfg(&config_reg);
|
|
174
|
+
busy_delay(100 * 240);
|
|
175
|
+
config_reg.power_disable = true;
|
|
176
|
+
push_cfg(&config_reg);
|
|
177
|
+
|
|
178
|
+
config_reg.ep_stv = false;
|
|
179
|
+
push_cfg(&config_reg);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
void epd_poweroff_all()
|
|
183
|
+
{
|
|
184
|
+
memset(&config_reg, 0, sizeof(config_reg));
|
|
185
|
+
push_cfg(&config_reg);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
void epd_start_frame()
|
|
189
|
+
{
|
|
190
|
+
while (i2s_is_busy()) ;
|
|
191
|
+
|
|
192
|
+
config_reg.ep_mode = true;
|
|
193
|
+
push_cfg(&config_reg);
|
|
194
|
+
|
|
195
|
+
pulse_ckv_us(1, 1, true);
|
|
196
|
+
|
|
197
|
+
// This is very timing-sensitive!
|
|
198
|
+
config_reg.ep_stv = false;
|
|
199
|
+
push_cfg(&config_reg);
|
|
200
|
+
busy_delay(240);
|
|
201
|
+
pulse_ckv_us(10, 10, false);
|
|
202
|
+
config_reg.ep_stv = true;
|
|
203
|
+
push_cfg(&config_reg);
|
|
204
|
+
pulse_ckv_us(0, 10, true);
|
|
205
|
+
|
|
206
|
+
config_reg.ep_output_enable = true;
|
|
207
|
+
push_cfg(&config_reg);
|
|
208
|
+
|
|
209
|
+
pulse_ckv_us(1, 1, true);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static inline void latch_row()
|
|
213
|
+
{
|
|
214
|
+
config_reg.ep_latch_enable = true;
|
|
215
|
+
push_cfg(&config_reg);
|
|
216
|
+
|
|
217
|
+
config_reg.ep_latch_enable = false;
|
|
218
|
+
push_cfg(&config_reg);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
void epd_skip()
|
|
222
|
+
{
|
|
223
|
+
#if defined(CONFIG_EPD_DISPLAY_TYPE_ED097TC2)
|
|
224
|
+
pulse_ckv_ticks(2, 2, false);
|
|
225
|
+
#else
|
|
226
|
+
// According to the spec, the OC4 maximum CKV frequency is 200kHz.
|
|
227
|
+
pulse_ckv_ticks(45, 5, false);
|
|
228
|
+
#endif
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
void epd_output_row(uint32_t output_time_dus)
|
|
232
|
+
{
|
|
233
|
+
while (i2s_is_busy());
|
|
234
|
+
|
|
235
|
+
latch_row();
|
|
236
|
+
|
|
237
|
+
pulse_ckv_ticks(output_time_dus, 50, false);
|
|
238
|
+
|
|
239
|
+
i2s_start_line_output();
|
|
240
|
+
i2s_switch_buffer();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
void epd_end_frame()
|
|
244
|
+
{
|
|
245
|
+
config_reg.ep_output_enable = false;
|
|
246
|
+
push_cfg(&config_reg);
|
|
247
|
+
config_reg.ep_mode = false;
|
|
248
|
+
push_cfg(&config_reg);
|
|
249
|
+
pulse_ckv_us(1, 1, true);
|
|
250
|
+
pulse_ckv_us(1, 1, true);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
void epd_switch_buffer()
|
|
254
|
+
{
|
|
255
|
+
i2s_switch_buffer();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
uint8_t * epd_get_current_buffer()
|
|
259
|
+
{
|
|
260
|
+
return (uint8_t *)i2s_get_current_buffer();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/******************************************************************************/
|
|
264
|
+
/*** local functions ***/
|
|
265
|
+
/******************************************************************************/
|
|
266
|
+
|
|
267
|
+
/******************************************************************************/
|
|
268
|
+
/*** END OF FILE ***/
|
|
269
|
+
/******************************************************************************/
|