@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,85 @@
1
+ #pragma once
2
+
3
+ #include "driver/gpio.h"
4
+ #include "driver/spi_master.h"
5
+
6
+ // LilyGo T5 4.7" E-Paper S3 (ED047TC1, 960x540 16-level grayscale).
7
+ //
8
+ // The e-paper panel itself is driven by the vendored `epd_driver` component
9
+ // (parallel bus + CFG shift register + CKV), whose pins live in that
10
+ // component's `ed047tc1.h`/`utilities.h` (D0-D7 = {8,1,2,3,4,5,6,7}, CKH=41,
11
+ // STH=40, CKV=38, CFG_DATA=13/CFG_CLK=12/CFG_STR=0). This header only carries
12
+ // the peripherals the shared gea target files consume: I2C, touch, the user
13
+ // button, the battery ADC, and the microSD SPI bus.
14
+
15
+ namespace gea::platform::board {
16
+
17
+ struct I2cBusConfig {
18
+ gpio_num_t sda;
19
+ gpio_num_t scl;
20
+ };
21
+
22
+ struct Gt911TouchConfig {
23
+ gpio_num_t reset;
24
+ gpio_num_t interrupt;
25
+ };
26
+
27
+ struct ButtonConfig {
28
+ gpio_num_t power; // single user/BOOT-adjacent button; used for launcher/back
29
+ };
30
+
31
+ struct PowerRailConfig {
32
+ gpio_num_t batteryAdc;
33
+ };
34
+
35
+ struct SdSpiStorageConfig {
36
+ spi_host_device_t spiHost;
37
+ gpio_num_t cs;
38
+ gpio_num_t sclk;
39
+ gpio_num_t mosi;
40
+ gpio_num_t miso;
41
+ };
42
+
43
+ class LilygoT5Epaper47 {
44
+ public:
45
+ // NOTE: on this board revision GPIO 17/18 are e-paper DATA pins (D5/D6), so
46
+ // the old touch-I2C pins would collide with the display. Touch is deferred;
47
+ // point this at free GPIOs so the (non-fatal) GT911 probe can't fight the
48
+ // panel. Real touch-bus pins are a follow-up.
49
+ static constexpr I2cBusConfig i2c{
50
+ .sda = GPIO_NUM_10,
51
+ .scl = GPIO_NUM_13,
52
+ };
53
+
54
+ static constexpr Gt911TouchConfig touch{
55
+ .reset = GPIO_NUM_NC,
56
+ .interrupt = GPIO_NUM_47,
57
+ };
58
+
59
+ static constexpr ButtonConfig buttons{
60
+ .power = GPIO_NUM_21,
61
+ };
62
+
63
+ static constexpr PowerRailConfig power{
64
+ .batteryAdc = GPIO_NUM_14, // ADC2 on the S3; battery divider
65
+ };
66
+
67
+ // microSD lives on its own SPI bus (the display is parallel, not SPI).
68
+ static constexpr SdSpiStorageConfig storage{
69
+ .spiHost = SPI2_HOST,
70
+ .cs = GPIO_NUM_42,
71
+ .sclk = GPIO_NUM_11,
72
+ .mosi = GPIO_NUM_15,
73
+ .miso = GPIO_NUM_16,
74
+ };
75
+ };
76
+
77
+ using Board = LilygoT5Epaper47;
78
+
79
+ inline constexpr auto i2c = Board::i2c;
80
+ inline constexpr auto touch = Board::touch;
81
+ inline constexpr auto buttons = Board::buttons;
82
+ inline constexpr auto power = Board::power;
83
+ inline constexpr auto storage = Board::storage;
84
+
85
+ } // namespace gea::platform::board
@@ -0,0 +1,8 @@
1
+ #pragma once
2
+
3
+ namespace gea::platform::lilygo_t5::buttons {
4
+
5
+ void init();
6
+ void poll(int nowMs);
7
+
8
+ } // namespace gea::platform::lilygo_t5::buttons
@@ -0,0 +1,82 @@
1
+ #include "apps/app_manager.h"
2
+ #include "board.h"
3
+ #include "input.h"
4
+
5
+ #include "driver/gpio.h"
6
+ #include "esp_log.h"
7
+ #include "freertos/FreeRTOS.h"
8
+ #include "freertos/task.h"
9
+
10
+ namespace gea::platform::esp32::apps {
11
+
12
+ namespace {
13
+
14
+ constexpr char kTag[] = "launcher_button";
15
+ constexpr gpio_num_t kButton = gea::platform::board::buttons.power;
16
+ constexpr int kDebounceMs = 50;
17
+ constexpr int kPollMs = 25;
18
+ constexpr int kLongPressMs = 800;
19
+
20
+ class LauncherButton {
21
+ public:
22
+ static LauncherButton &instance()
23
+ {
24
+ static LauncherButton button;
25
+ return button;
26
+ }
27
+
28
+ void start()
29
+ {
30
+ if (task_ || !gea::framework::apps::AppManager::shouldEnableLauncherButton()) return;
31
+ gpio_config_t config = {};
32
+ config.pin_bit_mask = 1ULL << kButton;
33
+ config.mode = GPIO_MODE_INPUT;
34
+ config.pull_up_en = GPIO_PULLUP_DISABLE; // GPIO38 has the board pull-up.
35
+ config.pull_down_en = GPIO_PULLDOWN_DISABLE;
36
+ config.intr_type = GPIO_INTR_DISABLE;
37
+ if (gpio_config(&config) != ESP_OK) return;
38
+ if (xTaskCreate(taskMain, "launcher_button", 4096, this, 10, &task_) != pdPASS) task_ = nullptr;
39
+ }
40
+
41
+ private:
42
+ void run()
43
+ {
44
+ for (;;) {
45
+ if (gpio_get_level(kButton) == 0) {
46
+ vTaskDelay(pdMS_TO_TICKS(kDebounceMs));
47
+ if (gpio_get_level(kButton) == 0) {
48
+ const TickType_t pressedAt = xTaskGetTickCount();
49
+ bool longHandled = false;
50
+ while (gpio_get_level(kButton) == 0) {
51
+ if (!longHandled && xTaskGetTickCount() - pressedAt >= pdMS_TO_TICKS(kLongPressMs)) {
52
+ const bool returned = gea::framework::apps::AppManager::returnRunningAppToLauncher(
53
+ "LilyGo T5 power button long press");
54
+ if (!returned) gea::framework::apps::AppManager::queueSettingsToggle();
55
+ longHandled = true;
56
+ }
57
+ vTaskDelay(pdMS_TO_TICKS(kPollMs));
58
+ }
59
+ if (!longHandled) {
60
+ const bool returned = gea::framework::apps::AppManager::returnRunningAppToLauncher(
61
+ "LilyGo T5 power button press");
62
+ if (!returned) gea::framework::input::pressBackButton();
63
+ }
64
+ }
65
+ }
66
+ vTaskDelay(pdMS_TO_TICKS(kPollMs));
67
+ }
68
+ }
69
+
70
+ static void taskMain(void *arg) { static_cast<LauncherButton *>(arg)->run(); }
71
+ TaskHandle_t task_ = nullptr;
72
+ };
73
+
74
+ } // namespace
75
+
76
+ void startLauncherButtonTask()
77
+ {
78
+ LauncherButton::instance().start();
79
+ ESP_LOGI(kTag, "LilyGo T5 launcher button configured on GPIO%d", static_cast<int>(kButton));
80
+ }
81
+
82
+ } // namespace gea::platform::esp32::apps
@@ -0,0 +1,36 @@
1
+ #include "power.h"
2
+
3
+ #include "board.h"
4
+
5
+ #include "esp_log.h"
6
+
7
+ // The LilyGo T5 4.7" routes its battery divider to GPIO14, which is ADC2 on the
8
+ // ESP32-S3 — ADC2 conflicts with Wi-Fi and is unreliable while the radio is up.
9
+ // Battery gauging is not needed for display bring-up, so report "unknown"
10
+ // rather than fight the ADC2/Wi-Fi arbitration. Fill this in later with a
11
+ // radio-quiescent ADC2 read if a battery indicator is wanted.
12
+
13
+ namespace gea::platform::power {
14
+
15
+ namespace {
16
+ constexpr char kTag[] = "lilygo_t5_power";
17
+ bool initialized = false;
18
+ } // namespace
19
+
20
+ bool Power::init()
21
+ {
22
+ if (!initialized) {
23
+ initialized = true;
24
+ ESP_LOGI(kTag, "battery gauge stubbed (GPIO%d is ADC2)",
25
+ static_cast<int>(gea::platform::board::power.batteryAdc));
26
+ }
27
+ return true;
28
+ }
29
+
30
+ int Power::batteryPercent()
31
+ {
32
+ init();
33
+ return -1; // unknown
34
+ }
35
+
36
+ } // namespace gea::platform::power
@@ -0,0 +1,90 @@
1
+ #include "platform/file_cache.h"
2
+
3
+ #include "board.h"
4
+
5
+ #include <sys/stat.h>
6
+
7
+ #include "driver/sdspi_host.h"
8
+ #include "driver/spi_master.h"
9
+ #include "esp_err.h"
10
+ #include "esp_log.h"
11
+ #include "esp_vfs_fat.h"
12
+ #include "sdmmc_cmd.h"
13
+
14
+ namespace gea::platform::storage {
15
+
16
+ namespace {
17
+
18
+ constexpr char kTag[] = "lilygo_t5_sd";
19
+ bool attempted = false;
20
+ bool mounted = false;
21
+ sdmmc_card_t *card = nullptr;
22
+
23
+ bool ensureSpiBus()
24
+ {
25
+ spi_bus_config_t config = {};
26
+ config.mosi_io_num = gea::platform::board::storage.mosi;
27
+ config.miso_io_num = gea::platform::board::storage.miso;
28
+ config.sclk_io_num = gea::platform::board::storage.sclk;
29
+ config.quadwp_io_num = -1;
30
+ config.quadhd_io_num = -1;
31
+ config.max_transfer_sz = 4096;
32
+ const esp_err_t err = spi_bus_initialize(gea::platform::board::storage.spiHost, &config, SPI_DMA_CH_AUTO);
33
+ return err == ESP_OK || err == ESP_ERR_INVALID_STATE;
34
+ }
35
+
36
+ bool mountCard()
37
+ {
38
+ // SD is disabled during bring-up: the storage pins (SCLK/MOSI/MISO/CS =
39
+ // 11/15/16/42) are wrong for this board revision — 15/16 are e-paper data
40
+ // pins and 42 is the source latch, so bringing up SPI here would fight the
41
+ // live display. Return "no card" until the real SD bus for this variant is
42
+ // wired. (The reader then shows an empty library rather than crashing.)
43
+ ESP_LOGW(kTag, "SD disabled during bring-up (storage pins unresolved for this board)");
44
+ return false;
45
+
46
+ struct stat st = {};
47
+ if (stat("/sdcard", &st) == 0) return true;
48
+ if (!ensureSpiBus()) return false;
49
+
50
+ sdmmc_host_t host = SDSPI_HOST_DEFAULT();
51
+ host.slot = gea::platform::board::storage.spiHost;
52
+ host.max_freq_khz = 20000;
53
+
54
+ sdspi_device_config_t device = SDSPI_DEVICE_CONFIG_DEFAULT();
55
+ device.host_id = gea::platform::board::storage.spiHost;
56
+ device.gpio_cs = gea::platform::board::storage.cs;
57
+ device.gpio_cd = SDSPI_SLOT_NO_CD;
58
+ device.gpio_wp = SDSPI_SLOT_NO_WP;
59
+ device.gpio_int = SDSPI_SLOT_NO_INT;
60
+
61
+ esp_vfs_fat_mount_config_t mount = {};
62
+ mount.format_if_mount_failed = false;
63
+ mount.max_files = 8;
64
+ mount.allocation_unit_size = 16 * 1024;
65
+ const esp_err_t err = esp_vfs_fat_sdspi_mount("/sdcard", &host, &device, &mount, &card);
66
+ if (err != ESP_OK) {
67
+ ESP_LOGW(kTag, "microSD mount failed: %s", esp_err_to_name(err));
68
+ return false;
69
+ }
70
+ ESP_LOGI(kTag, "microSD mounted on shared SPI3 bus CS=%d", static_cast<int>(device.gpio_cs));
71
+ return true;
72
+ }
73
+
74
+ bool ensureStorageMounted()
75
+ {
76
+ if (!attempted) {
77
+ attempted = true;
78
+ mounted = mountCard();
79
+ }
80
+ return mounted;
81
+ }
82
+
83
+ } // namespace
84
+
85
+ void installSdCardFileCache()
86
+ {
87
+ setMountProvider(&ensureStorageMounted);
88
+ }
89
+
90
+ } // namespace gea::platform::storage
@@ -0,0 +1,293 @@
1
+ #include "touch.h"
2
+
3
+ #include "board.h"
4
+ #include "buttons.h"
5
+ #include "host/display_orientation.h"
6
+ #include "i2c.h"
7
+
8
+ #include <atomic>
9
+ #include <cstdint>
10
+
11
+ #include "driver/i2c_master.h"
12
+ #include "esp_err.h"
13
+ #include "esp_lcd_panel_io.h"
14
+ #include "esp_lcd_touch.h"
15
+ #include "esp_lcd_touch_gt911.h"
16
+ #include "esp_log.h"
17
+ #include "freertos/FreeRTOS.h"
18
+ #include "freertos/semphr.h"
19
+ #include "freertos/task.h"
20
+
21
+ namespace {
22
+
23
+ constexpr char kTag[] = "lilygo_t5_touch";
24
+ constexpr int kPollIntervalMs = 10;
25
+ // Dedicated touch-sampling task cadence. The GT911 reports only the CURRENT
26
+ // finger state, not a buffered history, so a tap that goes down-and-up between
27
+ // two samples is lost entirely. On this board a page turn (SD read + paginate +
28
+ // ~200 ms e-paper flush) blocks the runtime frame loop far longer than a frame,
29
+ // and touch polling used to ride that same loop — so every tap during a draw
30
+ // vanished (the "rapid taps only skip 2 pages" bug). Sampling on its own task
31
+ // at 6 ms keeps catching down/up edges through the whole draw; the events queue
32
+ // and the runtime coalesces them into one multi-page skip when it comes back.
33
+ constexpr int kTouchTaskIntervalMs = 6;
34
+ constexpr int kMaxFingers = 2;
35
+
36
+ struct TouchSample {
37
+ bool touching = false;
38
+ int x = 0;
39
+ int y = 0;
40
+ };
41
+
42
+ struct MultiSample {
43
+ int count = 0;
44
+ int x[kMaxFingers] = {0, 0};
45
+ int y[kMaxFingers] = {0, 0};
46
+ };
47
+
48
+ class Gt911TouchController {
49
+ public:
50
+ static Gt911TouchController &instance()
51
+ {
52
+ static Gt911TouchController controller;
53
+ return controller;
54
+ }
55
+
56
+ void setObserver(gea::platform::touch::Touchscreen::Observer observer) { observer_ = observer; }
57
+ void setPointerObserver(gea::platform::touch::Touchscreen::PointerObserver observer) { pointerObserver_ = observer; }
58
+
59
+ bool begin()
60
+ {
61
+ if (initialized_) return true;
62
+ // Touch fully deferred on this board revision: the GT911 bus/pins aren't
63
+ // known yet, and probing a floating I2C bus blocks the GT911 config read
64
+ // (hangs the runtime). Skip touch entirely for now — the frame loop and
65
+ // hardware button still work. Remove this early-out once the real touch
66
+ // bus is identified.
67
+ ESP_LOGW(kTag, "touch probe skipped (deferred on this board revision)");
68
+ return true;
69
+ auto bus = gea::platform::i2c::Bus::primary();
70
+ // Touch is optional on this board (the GT911 may be unpopulated, or need a
71
+ // reset/power detail we haven't wired yet). Report success either way so
72
+ // the runtime does not abort in TouchRuntime::start(); the frame loop and
73
+ // hardware button still work. Real GT911 bring-up is a follow-up.
74
+ if (!bus.available()) {
75
+ ESP_LOGW(kTag, "I2C bus unavailable; running without touch");
76
+ return true;
77
+ }
78
+ i2cBus_ = static_cast<i2c_master_bus_handle_t>(bus.nativeHandle());
79
+
80
+ esp_err_t err = attach(ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP);
81
+ if (err != ESP_OK) err = attach(ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS);
82
+ if (err != ESP_OK) {
83
+ ESP_LOGW(kTag, "GT911 not found at 0x14 or 0x5d; running without touch");
84
+ return true;
85
+ }
86
+
87
+ initialized_ = true;
88
+ hwMutex_ = xSemaphoreCreateMutex();
89
+ // Sample the GT911 on a dedicated high-priority task so touch keeps being
90
+ // read even while the runtime frame task is blocked mid-page-draw. Pinned
91
+ // to PRO_CPU (core 0) at a priority above the runtime task (5) and the
92
+ // e-paper refresh task (6); if a CPU-bound page derive is running on the
93
+ // same core it is preempted every 6 ms, and if it's on the other core the
94
+ // sampling runs fully parallel. The task only READS the panel and QUEUES
95
+ // events (thread-safe via the FrameScheduler queue); event dispatch and
96
+ // rendering stay on the runtime task.
97
+ xTaskCreatePinnedToCore(touchTaskEntry, "lilygo_t5_touch", 3072, this, 7, &touchTask_, 0);
98
+ return true;
99
+ }
100
+
101
+ void poll(int nowMs)
102
+ {
103
+ gea::platform::lilygo_t5::buttons::poll(nowMs);
104
+ if (!initialized_) return;
105
+ // The dedicated task owns GT911 sampling; the frame-loop poll only drives
106
+ // the hardware buttons. Fall back to sampling here if the task never
107
+ // started (allocation failure), so touch still works degraded.
108
+ if (touchTask_ != nullptr) return;
109
+ const auto now = static_cast<std::uint32_t>(nowMs);
110
+ if (nextPollMs_ != 0 && static_cast<std::int32_t>(now - nextPollMs_) < 0) return;
111
+ nextPollMs_ = now + kPollIntervalMs;
112
+ pollOnce();
113
+ }
114
+
115
+ static void touchTaskEntry(void *arg)
116
+ {
117
+ auto *self = static_cast<Gt911TouchController *>(arg);
118
+ for (;;) {
119
+ self->pollOnce();
120
+ vTaskDelay(pdMS_TO_TICKS(kTouchTaskIntervalMs));
121
+ }
122
+ }
123
+
124
+ int read(int *x, int *y)
125
+ {
126
+ current_ = readHardware();
127
+ if (x) *x = current_.x;
128
+ if (y) *y = current_.y;
129
+ return current_.touching ? 1 : 0;
130
+ }
131
+
132
+ int readCached(int *x, int *y) const
133
+ {
134
+ if (x) *x = current_.x;
135
+ if (y) *y = current_.y;
136
+ return current_.touching ? 1 : 0;
137
+ }
138
+
139
+ void consumeLatestMove(int *x, int *y)
140
+ {
141
+ latestMoveQueued_.store(false, std::memory_order_release);
142
+ if (x) *x = latestMove_.x;
143
+ if (y) *y = latestMove_.y;
144
+ }
145
+
146
+ void injectEvent(gea::platform::touch::Phase phase, bool touching, int x, int y)
147
+ {
148
+ current_ = TouchSample{touching, x, y};
149
+ latestMove_ = current_;
150
+ latestMoveQueued_.store(phase == gea::platform::touch::Phase::Move, std::memory_order_release);
151
+ notify(phase, touching, x, y, 0);
152
+ }
153
+
154
+ private:
155
+ esp_err_t attach(std::uint8_t address)
156
+ {
157
+ esp_lcd_panel_io_i2c_config_t ioConfig = {};
158
+ ioConfig.dev_addr = address;
159
+ ioConfig.scl_speed_hz = 100000; // shared SHT30 bus is specified at 100 kHz
160
+ ioConfig.control_phase_bytes = 1;
161
+ ioConfig.dc_bit_offset = 0;
162
+ ioConfig.lcd_cmd_bits = 16;
163
+ ioConfig.flags.disable_control_phase = 1;
164
+
165
+ esp_lcd_panel_io_handle_t io = nullptr;
166
+ esp_err_t err = esp_lcd_new_panel_io_i2c(i2cBus_, &ioConfig, &io);
167
+ if (err != ESP_OK) return err;
168
+
169
+ esp_lcd_touch_config_t config = {};
170
+ config.x_max = gea::platform::display::kNativeWidth;
171
+ config.y_max = gea::platform::display::kNativeHeight;
172
+ config.rst_gpio_num = gea::platform::board::touch.reset;
173
+ config.int_gpio_num = gea::platform::board::touch.interrupt;
174
+ config.levels.reset = 0;
175
+ config.levels.interrupt = 0;
176
+ config.flags.swap_xy = false;
177
+ config.flags.mirror_x = false;
178
+ config.flags.mirror_y = false;
179
+
180
+ err = esp_lcd_touch_new_i2c_gt911(io, &config, &touch_);
181
+ if (err != ESP_OK) {
182
+ esp_lcd_panel_io_del(io);
183
+ return err;
184
+ }
185
+ touchIo_ = io;
186
+ ESP_LOGI(kTag, "GT911 ready address=0x%02x INT=%d", address, static_cast<int>(config.int_gpio_num));
187
+ return ESP_OK;
188
+ }
189
+
190
+ MultiSample readMulti()
191
+ {
192
+ MultiSample result;
193
+ if (!touch_) return result;
194
+ // read_data fills the touch handle's internal buffer and get_coordinates
195
+ // drains it — a two-step, non-atomic sequence on shared state. Now that a
196
+ // dedicated task samples continuously, an app-driven read() on the runtime
197
+ // task could interleave and mix the two callers' data (or glitch the
198
+ // driver's point state). Serialize the pair (mutex created in begin();
199
+ // a null mutex just skips locking — degraded, not broken).
200
+ if (hwMutex_) xSemaphoreTake(hwMutex_, portMAX_DELAY);
201
+ esp_lcd_touch_read_data(touch_);
202
+ std::uint16_t xs[kMaxFingers] = {};
203
+ std::uint16_t ys[kMaxFingers] = {};
204
+ std::uint16_t strengths[kMaxFingers] = {};
205
+ std::uint8_t count = 0;
206
+ const bool ok = esp_lcd_touch_get_coordinates(touch_, xs, ys, strengths, &count, kMaxFingers);
207
+ if (hwMutex_) xSemaphoreGive(hwMutex_);
208
+ if (!ok || count == 0) return result;
209
+ result.count = count > kMaxFingers ? kMaxFingers : static_cast<int>(count);
210
+ for (int i = 0; i < result.count; ++i) {
211
+ int x = xs[i];
212
+ int y = ys[i];
213
+ gea::framework::display::detail::DisplayOrientationState::mapPanelToViewport(&x, &y);
214
+ result.x[i] = x;
215
+ result.y[i] = y;
216
+ }
217
+ return result;
218
+ }
219
+
220
+ TouchSample readHardware()
221
+ {
222
+ const MultiSample sample = readMulti();
223
+ if (sample.count == 0) return TouchSample{false, current_.x, current_.y};
224
+ return TouchSample{true, sample.x[0], sample.y[0]};
225
+ }
226
+
227
+ void notify(gea::platform::touch::Phase phase, bool touching, int x, int y, int pointerId)
228
+ {
229
+ if (pointerObserver_) pointerObserver_(phase, touching, x, y, pointerId);
230
+ else if (observer_ && pointerId == 0) observer_(phase, touching, x, y);
231
+ }
232
+
233
+ void pollOnce()
234
+ {
235
+ const MultiSample sample = readMulti();
236
+ if (sample.count > 0) current_ = TouchSample{true, sample.x[0], sample.y[0]};
237
+ else current_.touching = false;
238
+
239
+ for (int slot = 0; slot < kMaxFingers; ++slot) {
240
+ const bool nowActive = slot < sample.count;
241
+ const int x = nowActive ? sample.x[slot] : oldX_[slot];
242
+ const int y = nowActive ? sample.y[slot] : oldY_[slot];
243
+ if (nowActive && !active_[slot]) {
244
+ notify(gea::platform::touch::Phase::Down, true, x, y, slot);
245
+ } else if (nowActive && active_[slot] && (x != oldX_[slot] || y != oldY_[slot])) {
246
+ if (slot == 0) {
247
+ latestMove_ = TouchSample{true, x, y};
248
+ if (!latestMoveQueued_.exchange(true, std::memory_order_acq_rel))
249
+ notify(gea::platform::touch::Phase::Move, true, x, y, slot);
250
+ } else {
251
+ notify(gea::platform::touch::Phase::Move, true, x, y, slot);
252
+ }
253
+ } else if (!nowActive && active_[slot]) {
254
+ notify(gea::platform::touch::Phase::Up, false, x, y, slot);
255
+ }
256
+ if (nowActive) {
257
+ oldX_[slot] = x;
258
+ oldY_[slot] = y;
259
+ }
260
+ active_[slot] = nowActive;
261
+ }
262
+ }
263
+
264
+ gea::platform::touch::Touchscreen::Observer observer_ = nullptr;
265
+ gea::platform::touch::Touchscreen::PointerObserver pointerObserver_ = nullptr;
266
+ i2c_master_bus_handle_t i2cBus_ = nullptr;
267
+ esp_lcd_touch_handle_t touch_ = nullptr;
268
+ esp_lcd_panel_io_handle_t touchIo_ = nullptr;
269
+ TouchSample current_ = {};
270
+ TouchSample latestMove_ = {};
271
+ std::atomic<bool> latestMoveQueued_{false};
272
+ bool active_[kMaxFingers] = {};
273
+ int oldX_[kMaxFingers] = {};
274
+ int oldY_[kMaxFingers] = {};
275
+ std::uint32_t nextPollMs_ = 0;
276
+ bool initialized_ = false;
277
+ TaskHandle_t touchTask_ = nullptr;
278
+ SemaphoreHandle_t hwMutex_ = nullptr;
279
+ };
280
+
281
+ } // namespace
282
+
283
+ void gea::platform::touch::Touchscreen::setObserver(Observer observer) { Gt911TouchController::instance().setObserver(observer); }
284
+ void gea::platform::touch::Touchscreen::setPointerObserver(PointerObserver observer) { Gt911TouchController::instance().setPointerObserver(observer); }
285
+ bool gea::platform::touch::Touchscreen::init() { return Gt911TouchController::instance().begin(); }
286
+ void gea::platform::touch::Touchscreen::poll(int nowMs) { Gt911TouchController::instance().poll(nowMs); }
287
+ int gea::platform::touch::Touchscreen::read(int *x, int *y) { return Gt911TouchController::instance().read(x, y); }
288
+ int gea::platform::touch::Touchscreen::readCached(int *x, int *y) { return Gt911TouchController::instance().readCached(x, y); }
289
+ void gea::platform::touch::Touchscreen::consumeLatestMove(int *x, int *y) { Gt911TouchController::instance().consumeLatestMove(x, y); }
290
+ void gea::platform::touch::Touchscreen::injectEvent(Phase phase, bool touching, int x, int y)
291
+ {
292
+ Gt911TouchController::instance().injectEvent(phase, touching, x, y);
293
+ }
@@ -0,0 +1,9 @@
1
+ # LilyGo T5 4.7" E-Paper S3, 16 MB flash. Two 7 MB OTA slots leave 1.875 MB for
2
+ # the local file cache while keeping every app partition 64 KiB aligned.
3
+ # Name, Type, SubType, Offset, Size
4
+ nvs, data, nvs, 0x9000, 0x6000
5
+ otadata, data, ota, 0xf000, 0x2000
6
+ phy_init, data, phy, 0x11000, 0x1000
7
+ ota_0, app, ota_0, 0x20000, 0x700000
8
+ ota_1, app, ota_1, 0x720000, 0x700000
9
+ storage, data, spiffs, 0xe20000, 0x1e0000