@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.
Files changed (348) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +83 -0
  3. package/package.json +50 -0
  4. package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
  5. package/targets/cmake/geatsc_generated_archive.cmake +116 -0
  6. package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
  7. package/targets/esp32/app_project.cmake +33 -0
  8. package/targets/esp32/apps/app_manager.cpp +188 -0
  9. package/targets/esp32/apps/app_manager.h +10 -0
  10. package/targets/esp32/chip_bindings/README.md +58 -0
  11. package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
  12. package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
  13. package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
  14. package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
  15. package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
  16. package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
  17. package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
  18. package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
  19. package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
  20. package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
  21. package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
  22. package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
  23. package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
  24. package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
  25. package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
  26. package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
  27. package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
  28. package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
  29. package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
  30. package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
  31. package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
  32. package/targets/esp32/connectivity/ble_hid.h +8 -0
  33. package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
  34. package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
  35. package/targets/esp32/connectivity/wifi.cpp +615 -0
  36. package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
  37. package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
  38. package/targets/esp32/display.cpp +6010 -0
  39. package/targets/esp32/display_headless.cpp +468 -0
  40. package/targets/esp32/gea/platform_random.h +11 -0
  41. package/targets/esp32/gea_framework.cmake +382 -0
  42. package/targets/esp32/gpio.cpp +229 -0
  43. package/targets/esp32/host_sources.cmake +35 -0
  44. package/targets/esp32/imu_absent.cpp +36 -0
  45. package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
  46. package/targets/esp32/memory_config.h +64 -0
  47. package/targets/esp32/power_absent.cpp +22 -0
  48. package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
  49. package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
  50. package/targets/esp32/sdk-patches/README.md +127 -0
  51. package/targets/esp32/services/app_runner.cpp +248 -0
  52. package/targets/esp32/services/app_state.cpp +56 -0
  53. package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
  54. package/targets/esp32/services/battery_service.cpp +31 -0
  55. package/targets/esp32/services/device_control.cpp +1896 -0
  56. package/targets/esp32/services/device_control.h +31 -0
  57. package/targets/esp32/services/frame_scheduler.cpp +1571 -0
  58. package/targets/esp32/services/heap.cpp +129 -0
  59. package/targets/esp32/services/memory.cpp +103 -0
  60. package/targets/esp32/services/ota.cpp +840 -0
  61. package/targets/esp32/services/ota_image.cpp +162 -0
  62. package/targets/esp32/services/ota_image.h +16 -0
  63. package/targets/esp32/services/storage_service.cpp +159 -0
  64. package/targets/esp32/touch_absent.cpp +44 -0
  65. package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
  66. package/targets/esp32-m5stack-m5paper/README.md +55 -0
  67. package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
  68. package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
  69. package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
  70. package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
  71. package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
  72. package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
  73. package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
  74. package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
  75. package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
  76. package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
  77. package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
  78. package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
  79. package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
  80. package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
  81. package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
  82. package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
  83. package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
  84. package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
  85. package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
  86. package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
  87. package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
  88. package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
  89. package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
  90. package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
  91. package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
  92. package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
  93. package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
  94. package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
  95. package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
  96. package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
  97. package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
  98. package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
  99. package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
  100. package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
  101. package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
  102. package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
  103. package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
  104. package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
  105. package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
  106. package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
  107. package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
  108. package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
  109. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
  110. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
  111. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
  112. package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
  113. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
  114. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
  115. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
  116. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
  117. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
  118. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
  119. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
  120. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
  121. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
  122. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
  123. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
  124. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
  125. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
  126. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
  127. package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
  128. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
  129. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
  130. package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
  131. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
  132. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
  133. package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
  134. package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
  135. package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
  136. package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
  137. package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
  138. package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
  139. package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
  140. package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
  141. package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
  142. package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
  143. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
  144. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
  145. package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
  146. package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
  147. package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
  148. package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
  149. package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
  150. package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
  151. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
  152. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
  153. package/targets/esp32-s3-devkit-n16r8.json +31 -0
  154. package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
  155. package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
  156. package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
  157. package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
  158. package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
  159. package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
  160. package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
  161. package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
  162. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
  163. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
  164. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
  165. package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
  166. package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
  167. package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
  168. package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
  169. package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
  170. package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
  171. package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
  172. package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
  173. package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
  174. package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
  175. package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
  176. package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
  177. package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
  178. package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
  179. package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
  180. package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
  181. package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
  182. package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
  183. package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
  184. package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
  185. package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
  186. package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
  187. package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
  188. package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
  189. package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
  190. package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
  191. package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
  192. package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
  193. package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
  194. package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
  195. package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
  196. package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
  197. package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
  198. package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
  199. package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
  200. package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
  201. package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
  202. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
  203. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
  204. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
  205. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
  206. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
  207. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
  208. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
  209. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
  210. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
  211. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
  212. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
  213. package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
  214. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
  215. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
  216. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
  217. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
  218. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
  219. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
  220. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
  221. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
  222. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
  223. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
  224. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
  225. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
  226. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
  227. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
  228. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
  229. package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
  230. package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
  231. package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
  232. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
  233. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
  234. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
  235. package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
  236. package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
  237. package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
  238. package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
  239. package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
  240. package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
  241. package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
  242. package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
  243. package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
  244. package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
  245. package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
  246. package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
  247. package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
  248. package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
  249. package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
  250. package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
  251. package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
  252. package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
  253. package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
  254. package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
  255. package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
  256. package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
  257. package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
  258. package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
  259. package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
  260. package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
  261. package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
  262. package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
  263. package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
  264. package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
  265. package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
  266. package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
  267. package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
  268. package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
  269. package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
  270. package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
  271. package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
  272. package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
  273. package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
  274. package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
  275. package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
  276. package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
  277. package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
  278. package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
  279. package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
  280. package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
  281. package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
  282. package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
  283. package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
  284. package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
  285. package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
  286. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
  287. package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
  288. package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
  289. package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
  290. package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
  291. package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
  292. package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
  293. package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
  294. package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
  295. package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
  296. package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
  297. package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
  298. package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
  299. package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
  300. package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
  301. package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
  302. package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
  303. package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
  304. package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
  305. package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
  306. package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
  307. package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
  308. package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
  309. package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
  310. package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
  311. package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
  312. package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
  313. package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
  314. package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
  315. package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
  316. package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
  317. package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
  318. package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
  319. package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
  320. package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
  321. package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
  322. package/targets/rp2350-tufty-2350/README.md +53 -0
  323. package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
  324. package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
  325. package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
  326. package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
  327. package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
  328. package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
  329. package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
  330. package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
  331. package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
  332. package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
  333. package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
  334. package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
  335. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
  336. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
  337. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
  338. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
  339. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
  340. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
  341. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
  342. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
  343. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
  344. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
  345. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
  346. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
  347. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
  348. package/targets.json +154 -0
@@ -0,0 +1,310 @@
1
+ #include "ft6336_controller.h"
2
+ #include "board.h"
3
+ #include "i2c.h"
4
+
5
+ #include "driver/gpio.h"
6
+ #include "esp_attr.h"
7
+ #include "esp_log.h"
8
+ #include "esp_timer.h"
9
+ #include "freertos/FreeRTOS.h"
10
+ #include "freertos/task.h"
11
+
12
+ namespace {
13
+
14
+ constexpr char kTag[] = "ft6336";
15
+ constexpr gpio_num_t kResetPin = gea::platform::board::touch.reset;
16
+ constexpr gpio_num_t kInterruptPin = gea::platform::board::touch.interrupt;
17
+ constexpr int kPollIntervalMs = 10;
18
+ // BELOW the render. The renderer rasters in parallel across both cores — the
19
+ // main task on CPU0 (priority 5) plus a worker pinned to CPU1 at the SAME
20
+ // priority 5 that the main task spin-waits on (display.cpp gea_render_parallel
21
+ // _submit/_wait). This poll task shares CPU1 with that worker. At its old
22
+ // priority 10 every I2C read (~140/sec, ~550us each, while a finger is down)
23
+ // PREEMPTED the worker mid-band, stalling it and forcing the main task to spin
24
+ // on CPU0 — ~6ms/frame, dropping a finger-down drag from ~60 to ~42fps (injected
25
+ // drags don't run this task, so they rastered uncontended at ~86fps). At
26
+ // priority 4 it can't preempt the raster; it samples in the render's idle
27
+ // windows instead, still at the panel's full report rate.
28
+ constexpr int kTaskPriority = 4;
29
+ constexpr TickType_t kI2cTimeoutTicks = pdMS_TO_TICKS(100);
30
+
31
+ } // namespace
32
+
33
+ namespace gea::platform::esp32::chip_bindings::ft6336 {
34
+
35
+ bool EspI2cRegisterBus::attach(i2c_master_bus_handle_t bus) {
36
+ if (device_) return true;
37
+
38
+ i2c_device_config_t config = {};
39
+ config.dev_addr_length = I2C_ADDR_BIT_LEN_7;
40
+ config.device_address = gea::chips::ft6336::kI2cAddress;
41
+ config.scl_speed_hz = gea::chips::ft6336::kI2cFrequencyHz;
42
+ return i2c_master_bus_add_device(bus, &config, &device_) == ESP_OK;
43
+ }
44
+
45
+ bool EspI2cRegisterBus::writeRegister(std::uint8_t reg, std::uint8_t value) {
46
+ std::uint8_t data[2] = {reg, value};
47
+ return device_ && i2c_master_transmit(device_, data, sizeof(data), kI2cTimeoutTicks) == ESP_OK;
48
+ }
49
+
50
+ bool EspI2cRegisterBus::readRegister(std::uint8_t reg, std::uint8_t &value) {
51
+ return readRegisters(reg, &value, 1);
52
+ }
53
+
54
+ bool EspI2cRegisterBus::readRegisters(std::uint8_t reg, std::uint8_t *data, std::size_t length) {
55
+ return device_ && i2c_master_transmit_receive(device_, &reg, 1, data, length, kI2cTimeoutTicks) == ESP_OK;
56
+ }
57
+
58
+ TouchController &TouchController::instance() {
59
+ static TouchController controller;
60
+ return controller;
61
+ }
62
+
63
+ void TouchController::setObserver(Observer observer) {
64
+ observer_ = observer;
65
+ }
66
+
67
+ void TouchController::setPointerObserver(PointerObserver observer) {
68
+ pointerObserver_ = observer;
69
+ }
70
+
71
+ esp_err_t TouchController::begin() {
72
+ if (initialized_) return ESP_OK;
73
+
74
+ ESP_LOGI(kTag, "Initializing FT6336 touch (RST=%d, INT=%d)", static_cast<int>(kResetPin), static_cast<int>(kInterruptPin));
75
+
76
+ auto bus = gea::platform::i2c::Bus::primary();
77
+ if (!bus.available()) return ESP_ERR_INVALID_STATE;
78
+ bus_ = static_cast<i2c_master_bus_handle_t>(bus.nativeHandle());
79
+
80
+ esp_err_t err = resetChip();
81
+ if (err != ESP_OK) return err;
82
+
83
+ err = attachI2cDevice();
84
+ if (err != ESP_OK) return err;
85
+
86
+ err = configureChip();
87
+ if (err != ESP_OK) return err;
88
+
89
+ err = startTask();
90
+ if (err != ESP_OK) return err;
91
+
92
+ err = attachInterrupt();
93
+ if (err != ESP_OK) return err;
94
+
95
+ initialized_ = true;
96
+ ESP_LOGI(kTag, "Touch controller ready (%s)", kInterruptPin >= 0 ? "interrupt-driven" : "polled");
97
+ return ESP_OK;
98
+ }
99
+
100
+ bool TouchController::read(TouchSample &sample) {
101
+ const bool touching = core_.read(device_, sample);
102
+ current_ = sample;
103
+ return touching;
104
+ }
105
+
106
+ TouchSample TouchController::cached() const {
107
+ return current_;
108
+ }
109
+
110
+ void TouchController::consumeLatestMove(int *x, int *y) {
111
+ latestMoveQueued_.store(false, std::memory_order_release);
112
+ if (x) *x = latestMove_.x;
113
+ if (y) *y = latestMove_.y;
114
+ }
115
+
116
+ esp_err_t TouchController::resetChip() {
117
+ if constexpr (static_cast<int>(kResetPin) < 0) {
118
+ vTaskDelay(pdMS_TO_TICKS(50));
119
+ return ESP_OK;
120
+ } else {
121
+ gpio_config_t config = {};
122
+ config.pin_bit_mask = 1ULL << static_cast<unsigned>(kResetPin);
123
+ config.mode = GPIO_MODE_OUTPUT;
124
+ esp_err_t err = gpio_config(&config);
125
+ if (err != ESP_OK) return err;
126
+
127
+ gpio_set_level(kResetPin, 0);
128
+ vTaskDelay(pdMS_TO_TICKS(5));
129
+ gpio_set_level(kResetPin, 1);
130
+ vTaskDelay(pdMS_TO_TICKS(300));
131
+ return ESP_OK;
132
+ }
133
+ }
134
+
135
+ esp_err_t TouchController::attachI2cDevice() {
136
+ return device_.attach(bus_) ? ESP_OK : ESP_FAIL;
137
+ }
138
+
139
+ esp_err_t TouchController::configureChip() {
140
+ // Read the chip id first: it is the only proof the controller is actually
141
+ // answering. A silent I2C failure otherwise looks exactly like a screen
142
+ // nobody is touching.
143
+ std::uint8_t chipId = 0;
144
+ if (!core_.readChipId(device_, chipId)) {
145
+ ESP_LOGE(kTag, "touch controller did not answer on I2C");
146
+ return ESP_ERR_NOT_FOUND;
147
+ }
148
+ if (chipId != gea::chips::ft6336::kExpectedChipId) {
149
+ ESP_LOGW(kTag, "unexpected touch chip id 0x%02X (expected 0x%02X)", chipId,
150
+ gea::chips::ft6336::kExpectedChipId);
151
+ }
152
+ return core_.configure(device_, false) ? ESP_OK : ESP_FAIL;
153
+ }
154
+
155
+ esp_err_t TouchController::startTask() {
156
+ // Pinned to CPU1, where the parallel render worker also runs. kTaskPriority (4)
157
+ // is BELOW that worker (5) so reads sample in its idle windows instead of
158
+ // preempting its raster band — see the kTaskPriority comment for the full why.
159
+ task_ = xTaskCreateStaticPinnedToCore(taskEntry, "ft6336-touch",
160
+ static_cast<std::uint32_t>(sizeof(taskStack_) / sizeof(taskStack_[0])), this,
161
+ kTaskPriority, taskStack_, &taskControlBlock_, 1);
162
+ if (task_) return ESP_OK;
163
+ ESP_LOGE(kTag, "Failed to start touch task");
164
+ return ESP_ERR_NO_MEM;
165
+ }
166
+
167
+ esp_err_t TouchController::attachInterrupt() {
168
+ // A board can route the controller's INT to an I2C expander rather than to a
169
+ // GPIO, leaving board::touch.interrupt as GPIO_NUM_NC. Shifting by -1 is
170
+ // undefined -- the compiler rejects it outright -- so skip the attach and let
171
+ // the task poll instead: it reads the controller on its own cadence anyway,
172
+ // and the interrupt only ever woke it sooner.
173
+ // `if constexpr`, not `if`: kInterruptPin is a compile-time constant, so the
174
+ // shift below is still evaluated -- and rejected -- in a plain branch.
175
+ if constexpr (kInterruptPin < 0) {
176
+ ESP_LOGI(kTag, "no interrupt GPIO for touch; polling instead");
177
+ return ESP_OK;
178
+ } else {
179
+ gpio_config_t config = {};
180
+ config.pin_bit_mask = 1ULL << static_cast<unsigned>(kInterruptPin);
181
+ config.mode = GPIO_MODE_INPUT;
182
+ config.intr_type = GPIO_INTR_NEGEDGE;
183
+ esp_err_t err = gpio_config(&config);
184
+ if (err != ESP_OK) return err;
185
+
186
+ err = gpio_install_isr_service(0);
187
+ if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) return err;
188
+
189
+ return gpio_isr_handler_add(kInterruptPin, interruptEntry, this);
190
+ }
191
+ }
192
+
193
+ void IRAM_ATTR TouchController::interruptEntry(void *arg) {
194
+ auto *self = static_cast<TouchController *>(arg);
195
+ if (self) self->notifyTaskFromInterrupt();
196
+ }
197
+
198
+ void IRAM_ATTR TouchController::notifyTaskFromInterrupt() {
199
+ BaseType_t woken = pdFALSE;
200
+ if (task_) vTaskNotifyGiveFromISR(task_, &woken);
201
+ portYIELD_FROM_ISR(woken);
202
+ }
203
+
204
+ void TouchController::taskEntry(void *arg) {
205
+ static_cast<TouchController *>(arg)->pollLoop();
206
+ }
207
+
208
+ void TouchController::pollLoop() {
209
+ // Per-finger slot tracking (mirrors the CST9217 multi-touch controller): each
210
+ // slot emits its own Down/Move/Up tagged with its pointerId, so a second
211
+ // finger (pointerId 1) reaches the maps pinch-zoom gesture. Slot 0 remains the
212
+ // primary pointer (drives scroll/focus + the consumeLatestMove fast path).
213
+ bool slotActive[kMaxFingers] = {false, false};
214
+ int slotX[kMaxFingers] = {0, 0};
215
+ int slotY[kMaxFingers] = {0, 0};
216
+ bool anyActive = false;
217
+
218
+ while (true) {
219
+ // Interrupt-driven while idle (wait for the touch INT); poll at the report
220
+ // rate while any finger is down.
221
+ // Waiting forever while idle is only safe when an interrupt can wake this
222
+ // task. A board that routes INT to an I2C expander has none, so it polls on
223
+ // the report interval instead -- otherwise the first touch is never read.
224
+ constexpr bool kInterruptDriven = kInterruptPin >= 0;
225
+ const TickType_t wait =
226
+ (anyActive || !kInterruptDriven) ? pdMS_TO_TICKS(kPollIntervalMs) : portMAX_DELAY;
227
+ ulTaskNotifyTake(pdTRUE, wait);
228
+
229
+ gea::chips::ft6336::MultiTouchSample multi;
230
+ core_.readMulti(device_, multi); // multi.count == 0 when no contact
231
+
232
+ // DIAG: does the chip ever report a 2nd contact?
233
+ static int s_maxCount = 0;
234
+ if (multi.count > s_maxCount) {
235
+ s_maxCount = multi.count;
236
+ ESP_LOGW(kTag, "DIAG maxCount=%d (p0=%d,%d p1=%d,%d)", multi.count, multi.x[0], multi.y[0], multi.x[1],
237
+ multi.y[1]);
238
+ }
239
+
240
+ current_ = multi.count > 0 ? TouchSample{true, multi.x[0], multi.y[0]}
241
+ : TouchSample{false, current_.x, current_.y};
242
+
243
+ for (int slot = 0; slot < kMaxFingers; slot++) {
244
+ const bool nowActive = slot < multi.count;
245
+ const int x = nowActive ? multi.x[slot] : slotX[slot];
246
+ const int y = nowActive ? multi.y[slot] : slotY[slot];
247
+
248
+ if (nowActive && !slotActive[slot]) {
249
+ ESP_LOGW(kTag, "DIAG slot %d DOWN %d,%d", slot, x, y);
250
+ if (slot == 0) latestMove_ = TouchSample{true, x, y};
251
+ notifyPointer(Phase::Down, true, x, y, slot);
252
+ } else if (nowActive && slotActive[slot] && (x != slotX[slot] || y != slotY[slot])) {
253
+ if (slot == 0) {
254
+ // Coalesce primary moves through latestMove_ so the runtime's
255
+ // consumeLatestMove drains the freshest coord (queued-move fast path).
256
+ latestMove_ = TouchSample{true, x, y};
257
+ if (!latestMoveQueued_.exchange(true, std::memory_order_acq_rel)) {
258
+ notifyPointer(Phase::Move, true, x, y, slot);
259
+ }
260
+ } else {
261
+ notifyPointer(Phase::Move, true, x, y, slot);
262
+ }
263
+ } else if (!nowActive && slotActive[slot]) {
264
+ notifyPointer(Phase::Up, false, x, y, slot);
265
+ }
266
+
267
+ if (nowActive) {
268
+ slotX[slot] = x;
269
+ slotY[slot] = y;
270
+ }
271
+ slotActive[slot] = nowActive;
272
+ }
273
+ anyActive = multi.count > 0;
274
+ }
275
+ }
276
+
277
+ void TouchController::notifyObserver(Phase phase, const TouchSample &sample) {
278
+ notifyPointer(phase, sample.touching, sample.x, sample.y, 0);
279
+ }
280
+
281
+ void TouchController::notifyPointer(Phase phase, bool touching, int x, int y, int pointerId) {
282
+ // A multi-finger observer (set by the runtime when an app uses multi-touch)
283
+ // takes every contact; otherwise the legacy single Observer gets the primary.
284
+ if (pointerObserver_) {
285
+ pointerObserver_(phase, touching, x, y, pointerId);
286
+ } else if (observer_ && pointerId == 0) {
287
+ observer_(phase, touching, x, y);
288
+ }
289
+ }
290
+
291
+ void TouchController::notifyMove(const TouchSample &sample) {
292
+ latestMove_ = sample;
293
+ if (latestMoveQueued_.exchange(true, std::memory_order_acq_rel)) return;
294
+ notifyPointer(Phase::Move, true, sample.x, sample.y, 0);
295
+ }
296
+
297
+ void TouchController::injectEvent(Phase phase, bool touching, int x, int y) {
298
+ TouchSample sample;
299
+ sample.x = x;
300
+ sample.y = y;
301
+ sample.touching = touching;
302
+ current_ = sample;
303
+ // Route Move through notifyMove so latestMove_ is set — otherwise the
304
+ // TouchRuntime's consumeLatestMove would overwrite the injected coords with
305
+ // the last real hardware sample and the synthetic drag wouldn't scroll.
306
+ if (phase == Phase::Move) notifyMove(sample);
307
+ else notifyObserver(phase, sample);
308
+ }
309
+
310
+ } // namespace gea::platform::esp32::chip_bindings::ft6336
@@ -0,0 +1,90 @@
1
+ #pragma once
2
+
3
+ #include "touch/ft6336/ft6336.h"
4
+ #include "touch.h"
5
+
6
+ #include <cstddef>
7
+ #include <cstdint>
8
+ #include <atomic>
9
+
10
+ #include "driver/gpio.h"
11
+ #include "driver/i2c_master.h"
12
+ #include "esp_err.h"
13
+ #include "freertos/FreeRTOS.h"
14
+ #include "freertos/task.h"
15
+
16
+ namespace gea::platform::esp32::chip_bindings::ft6336 {
17
+
18
+ using TouchSample = gea::chips::ft6336::TouchSample;
19
+
20
+ class EspI2cRegisterBus final : public gea::chips::ft6336::RegisterBus {
21
+ public:
22
+ bool attach(i2c_master_bus_handle_t bus);
23
+ bool writeRegister(std::uint8_t reg, std::uint8_t value) override;
24
+ bool readRegister(std::uint8_t reg, std::uint8_t &value) override;
25
+ bool readRegisters(std::uint8_t reg, std::uint8_t *data, std::size_t length) override;
26
+
27
+ private:
28
+ i2c_master_dev_handle_t device_ = nullptr;
29
+ };
30
+
31
+ class TouchController {
32
+ public:
33
+ using Observer = gea::platform::touch::Touchscreen::Observer;
34
+ using PointerObserver = gea::platform::touch::Touchscreen::PointerObserver;
35
+ using Phase = gea::platform::touch::Phase;
36
+
37
+ TouchController(const TouchController &) = delete;
38
+ TouchController &operator=(const TouchController &) = delete;
39
+
40
+ static TouchController &instance();
41
+
42
+ void setObserver(Observer observer);
43
+ // Strong override of the runtime's weak default: a multi-finger observer that
44
+ // receives every contact tagged with a pointerId (0 = primary). The maps
45
+ // pinch-zoom gesture needs the second finger (pointerId 1).
46
+ void setPointerObserver(PointerObserver observer);
47
+ esp_err_t begin();
48
+ bool read(TouchSample &sample);
49
+ TouchSample cached() const;
50
+ void consumeLatestMove(int *x, int *y);
51
+ // Inject a synthetic touch event through the same notify path as the hardware
52
+ // poll loop. A Move updates latestMove_ (so the TouchRuntime's
53
+ // consumeLatestMove returns these coords instead of stale hardware samples),
54
+ // letting GEADEV DRAG/SWIPE drive scroll gestures exactly like a real finger.
55
+ void injectEvent(Phase phase, bool touching, int x, int y);
56
+
57
+ private:
58
+ TouchController() = default;
59
+
60
+ esp_err_t resetChip();
61
+ esp_err_t attachI2cDevice();
62
+ esp_err_t configureChip();
63
+ esp_err_t startTask();
64
+ esp_err_t attachInterrupt();
65
+ static void interruptEntry(void *arg);
66
+ void notifyTaskFromInterrupt();
67
+ static void taskEntry(void *arg);
68
+ void pollLoop();
69
+ void notifyObserver(Phase phase, const TouchSample &sample);
70
+ void notifyPointer(Phase phase, bool touching, int x, int y, int pointerId);
71
+ void notifyMove(const TouchSample &sample);
72
+
73
+ static constexpr std::size_t kTaskStackWords = 4096;
74
+ static constexpr int kMaxFingers = gea::chips::ft6336::kMaxTouchPoints;
75
+
76
+ bool initialized_ = false;
77
+ i2c_master_bus_handle_t bus_ = nullptr;
78
+ EspI2cRegisterBus device_;
79
+ gea::chips::ft6336::ControllerCore core_;
80
+ TaskHandle_t task_ = nullptr;
81
+ StaticTask_t taskControlBlock_ = {};
82
+ StackType_t taskStack_[kTaskStackWords] = {};
83
+ gea::chips::ft6336::TouchSample current_ = {};
84
+ gea::chips::ft6336::TouchSample latestMove_ = {};
85
+ std::atomic<bool> latestMoveQueued_{false};
86
+ Observer observer_ = nullptr;
87
+ PointerObserver pointerObserver_ = nullptr;
88
+ };
89
+
90
+ } // namespace gea::platform::esp32::chip_bindings::ft6336
@@ -0,0 +1,62 @@
1
+ set(GEA_EMBEDDED_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../..")
2
+ cmake_path(ABSOLUTE_PATH GEA_EMBEDDED_ROOT NORMALIZE)
3
+
4
+ include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_framework.cmake")
5
+
6
+ # None of the framework's own stable sources include an HTTP or OTA header:
7
+ # host/http.cpp, fetch.cpp, websocket.cpp and app_manager.cpp are app-sensitive
8
+ # and compile into `main`. These entries are here only so REQUIRES' transitivity
9
+ # reaches them without every board target repeating the list -- which means they
10
+ # must follow the app's network capability too, or an app that asks for no
11
+ # network still drags the HTTP server and the OTA writer into its image. The
12
+ # capability comes from the gea CLI (env, then the -D cache entry); a direct
13
+ # `idf.py` build leaves it unset and keeps the components, since the board is
14
+ # then the only thing that knows what the app needs.
15
+ set(GEA_EMBEDDED_FRAMEWORK_NETWORK_REQUIRES app_update esp_http_server)
16
+ if(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_NETWORK}
17
+ AND "$ENV{GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "0")
18
+ set(GEA_EMBEDDED_FRAMEWORK_NETWORK_REQUIRES "")
19
+ elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_NETWORK}
20
+ AND "$CACHE{GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "0")
21
+ set(GEA_EMBEDDED_FRAMEWORK_NETWORK_REQUIRES "")
22
+ endif()
23
+
24
+ idf_component_register(
25
+ SRCS
26
+ ${GEA_FW_CXX_SOURCES}
27
+ ${GEA_FW_C_SOURCES}
28
+ INCLUDE_DIRS
29
+ ${GEA_FW_INCLUDE_DIRS}
30
+ LDFRAGMENTS
31
+ ${GEA_EMBEDDED_APP_LDFRAGMENT_FILES}
32
+ REQUIRES
33
+ esp_system
34
+ esp_timer
35
+ freertos
36
+ ${GEA_EMBEDDED_FRAMEWORK_NETWORK_REQUIRES}
37
+ esp_partition
38
+ esp_app_format
39
+ nvs_flash
40
+ # targets/esp32/gpio.cpp: plain pins through esp_driver_gpio, and WS2812
41
+ # bit timing clocked by an RMT TX channel rather than by the managed
42
+ # `led_strip` component, which would land in the dependency lock of
43
+ # every board that builds this file.
44
+ esp_driver_gpio
45
+ esp_driver_rmt
46
+ # gea.targets.esp32.componentRequires: the components an app's own native
47
+ # sources need headers or PUBLIC definitions from. REQUIRES is transitive,
48
+ # so listing them here reaches the app sources compiled into `main` without
49
+ # every board target having to know about them.
50
+ ${GEA_EMBEDDED_APP_COMPONENT_REQUIRES}
51
+ )
52
+
53
+ # gpio.cpp has no caller inside the framework or `main` — only the app's own
54
+ # geatsc archive, which the linker reaches after every ESP-IDF component
55
+ # archive. Naming its anchor undefined from the start makes the linker take the
56
+ # object while esp_driver_rmt (and the gdma/soc archives behind it) are still
57
+ # ahead of the cursor; without it every rmt_* call is undefined at link. The
58
+ # flag travels through the link INTERFACE because this component is a static
59
+ # archive, so a PRIVATE option would stop at the archive.
60
+ target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl$<COMMA>-u$<COMMA>gea_gpio_link_bindings")
61
+
62
+ gea_apply_app_native_build()