@geastack/targets 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +83 -0
- package/package.json +50 -0
- package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
- package/targets/cmake/geatsc_generated_archive.cmake +116 -0
- package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
- package/targets/esp32/app_project.cmake +33 -0
- package/targets/esp32/apps/app_manager.cpp +188 -0
- package/targets/esp32/apps/app_manager.h +10 -0
- package/targets/esp32/chip_bindings/README.md +58 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
- package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
- package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
- package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
- package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
- package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
- package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
- package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
- package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
- package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
- package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
- package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
- package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
- package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
- package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
- package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
- package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
- package/targets/esp32/connectivity/ble_hid.h +8 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
- package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
- package/targets/esp32/connectivity/wifi.cpp +615 -0
- package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
- package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
- package/targets/esp32/display.cpp +6010 -0
- package/targets/esp32/display_headless.cpp +468 -0
- package/targets/esp32/gea/platform_random.h +11 -0
- package/targets/esp32/gea_framework.cmake +382 -0
- package/targets/esp32/gpio.cpp +229 -0
- package/targets/esp32/host_sources.cmake +35 -0
- package/targets/esp32/imu_absent.cpp +36 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
- package/targets/esp32/memory_config.h +64 -0
- package/targets/esp32/power_absent.cpp +22 -0
- package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
- package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
- package/targets/esp32/sdk-patches/README.md +127 -0
- package/targets/esp32/services/app_runner.cpp +248 -0
- package/targets/esp32/services/app_state.cpp +56 -0
- package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
- package/targets/esp32/services/battery_service.cpp +31 -0
- package/targets/esp32/services/device_control.cpp +1896 -0
- package/targets/esp32/services/device_control.h +31 -0
- package/targets/esp32/services/frame_scheduler.cpp +1571 -0
- package/targets/esp32/services/heap.cpp +129 -0
- package/targets/esp32/services/memory.cpp +103 -0
- package/targets/esp32/services/ota.cpp +840 -0
- package/targets/esp32/services/ota_image.cpp +162 -0
- package/targets/esp32/services/ota_image.h +16 -0
- package/targets/esp32/services/storage_service.cpp +159 -0
- package/targets/esp32/touch_absent.cpp +44 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
- package/targets/esp32-m5stack-m5paper/README.md +55 -0
- package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
- package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
- package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
- package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
- package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
- package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
- package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
- package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
- package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
- package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
- package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
- package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
- package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
- package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
- package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
- package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
- package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
- package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
- package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
- package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
- package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
- package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
- package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
- package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
- package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
- package/targets/esp32-s3-devkit-n16r8.json +31 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
- package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
- package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
- package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
- package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
- package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
- package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
- package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
- package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
- package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
- package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
- package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
- package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
- package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
- package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
- package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
- package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
- package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
- package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
- package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
- package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
- package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
- package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
- package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
- package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
- package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
- package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
- package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
- package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
- package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
- package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
- package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
- package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
- package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
- package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
- package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
- package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
- package/targets/rp2350-tufty-2350/README.md +53 -0
- package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
- package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
- package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
- package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
- package/targets.json +154 -0
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
#include "display.h"
|
|
2
|
+
|
|
3
|
+
#include "board.h"
|
|
4
|
+
#include "canvas.h"
|
|
5
|
+
#include "display_present.h"
|
|
6
|
+
#include "host/display_orientation.h"
|
|
7
|
+
#include "pixel.h"
|
|
8
|
+
|
|
9
|
+
#include <algorithm>
|
|
10
|
+
#include <atomic>
|
|
11
|
+
#include <cstddef>
|
|
12
|
+
#include <cstdint>
|
|
13
|
+
#include <cstring>
|
|
14
|
+
|
|
15
|
+
#include "esp_heap_caps.h"
|
|
16
|
+
#include "esp_log.h"
|
|
17
|
+
#include "esp_timer.h"
|
|
18
|
+
#include "freertos/FreeRTOS.h"
|
|
19
|
+
#include "freertos/semphr.h"
|
|
20
|
+
#include "freertos/task.h"
|
|
21
|
+
|
|
22
|
+
extern "C" {
|
|
23
|
+
#include "papers3_epd.h"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
namespace platform_display = gea::platform::display;
|
|
27
|
+
namespace orientation_detail = gea::framework::display::detail;
|
|
28
|
+
namespace pixel = gea::framework::graphics::pixel;
|
|
29
|
+
|
|
30
|
+
namespace gea::platform::papers3::display {
|
|
31
|
+
|
|
32
|
+
namespace {
|
|
33
|
+
|
|
34
|
+
constexpr char kTag[] = "papers3_display";
|
|
35
|
+
|
|
36
|
+
// Physical panel is 960x540 LANDSCAPE (ED047TC1 class), wired straight to the
|
|
37
|
+
// SoC — no controller-side rotation (unlike the original M5Paper's IT8951).
|
|
38
|
+
//
|
|
39
|
+
// Apps + the framework render LOGICAL PORTRAIT 540x960. We render LANDSCAPE-
|
|
40
|
+
// NATIVE: the Canvas is bound in its rotation-aware mode straight to the physical
|
|
41
|
+
// 960x540 GRAY4 buffer (bindPixelsRotatedLandscape), so a logical pixel (lx,ly)
|
|
42
|
+
// lands directly at physical (px=ly, py=539-lx). There is NO per-frame transpose
|
|
43
|
+
// pass — the Canvas IS the panel buffer. The 90° map here is authoritative and
|
|
44
|
+
// matches the packing the panel driver reads (high nibble = left/even pixel).
|
|
45
|
+
constexpr int kControllerWidth = PAPERS3_EPD_WIDTH; // 960 (physical width)
|
|
46
|
+
constexpr int kControllerHeight = PAPERS3_EPD_HEIGHT; // 540 (physical height)
|
|
47
|
+
constexpr int kPortraitWidth = 540; // logical width
|
|
48
|
+
constexpr int kPortraitHeight = 960; // logical height
|
|
49
|
+
constexpr int kEpdStride = kControllerWidth / 2; // 480 bytes/row
|
|
50
|
+
constexpr int kEpdBytes = kEpdStride * kControllerHeight; // 960x540 4bpp
|
|
51
|
+
|
|
52
|
+
// ED047TC1 4-bit brightness: 0x0 = black, 0xF = white. gea GRAY4 native values
|
|
53
|
+
// use the same polarity (0 = black, 15 = white), so no inversion is needed and
|
|
54
|
+
// the Canvas gray values go straight to the panel unchanged (the old transpose's
|
|
55
|
+
// kInvertGray=false is now implicit — nothing rewrites the levels).
|
|
56
|
+
|
|
57
|
+
// Reset accumulated e-paper ghosting periodically. Apps normally override this
|
|
58
|
+
// (the e-reader uses 10); zero disables cadence-based full refreshes.
|
|
59
|
+
constexpr int kDefaultFullRefreshEvery = 10;
|
|
60
|
+
|
|
61
|
+
// NOTE ON PANEL SAFETY. The protection that matters lives in
|
|
62
|
+
// components/papers3_epd: a pixel stops being driven the moment it reaches its
|
|
63
|
+
// target level (NOP-at-target), drive per pixel is bounded by construction, and a
|
|
64
|
+
// drive-duty limiter forces a rails-off rest if a caller refreshes continuously.
|
|
65
|
+
|
|
66
|
+
class DisplayBackend {
|
|
67
|
+
public:
|
|
68
|
+
static DisplayBackend &instance()
|
|
69
|
+
{
|
|
70
|
+
static DisplayBackend backend;
|
|
71
|
+
return backend;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
bool init()
|
|
75
|
+
{
|
|
76
|
+
if (initialized_) return true;
|
|
77
|
+
mutex_ = xSemaphoreCreateMutex();
|
|
78
|
+
if (!mutex_) return false;
|
|
79
|
+
|
|
80
|
+
// The Canvas renders rotated straight into a physical landscape GRAY4
|
|
81
|
+
// buffer. The panel gets a second physical buffer as an immutable scan
|
|
82
|
+
// snapshot: a quality refresh takes up to two 13-field cycles, and letting the runtime draw
|
|
83
|
+
// the next page into the buffer while those fields are being generated mixes
|
|
84
|
+
// two targets in one waveform. Worse, the driver's final shadow commit would
|
|
85
|
+
// then claim that the mixed scan showed the newest live buffer, poisoning
|
|
86
|
+
// every later delta. A 253 KiB snapshot is cheaper than holding the render
|
|
87
|
+
// mutex for the entire blocking panel scan and keeps touch/render responsive.
|
|
88
|
+
epdFb_ = static_cast<std::uint8_t *>(
|
|
89
|
+
heap_caps_aligned_calloc(16, 1, kEpdBytes, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
|
90
|
+
scanFb_ = static_cast<std::uint8_t *>(
|
|
91
|
+
heap_caps_aligned_alloc(16, kEpdBytes, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
|
92
|
+
if (!epdFb_ || !scanFb_) {
|
|
93
|
+
ESP_LOGE(kTag, "framebuffer allocation failed (two PSRAM GRAY4 buffers required)");
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
std::memset(scanFb_, 0xff, kEpdBytes);
|
|
97
|
+
std::memset(dirtyRows_, 0, sizeof(dirtyRows_));
|
|
98
|
+
dirtyCoversScreen_ = false;
|
|
99
|
+
|
|
100
|
+
// Bring up the direct-drive panel and flash it to a clean white.
|
|
101
|
+
papers3_epd_init();
|
|
102
|
+
// TREATMENT-ONLY boot: no app rendering — balanced deghosting drive
|
|
103
|
+
// with rails-off rests, 30-min session cap (reboot for another
|
|
104
|
+
// session). Set false to restore normal rendering.
|
|
105
|
+
constexpr bool kTreatmentOnlyBoot = false;
|
|
106
|
+
if (kTreatmentOnlyBoot) {
|
|
107
|
+
ESP_LOGI(kTag, "TREATMENT build: deghosting loop, no app rendering, 30-min session cap");
|
|
108
|
+
papers3_epd_treatment_forever(); // never returns
|
|
109
|
+
}
|
|
110
|
+
papers3_epd_clear();
|
|
111
|
+
|
|
112
|
+
bindCanvas();
|
|
113
|
+
if (xTaskCreatePinnedToCore(refreshTaskEntry, "papers3_epd", 4096, this, 6, &refreshTask_, 1) != pdPASS) {
|
|
114
|
+
ESP_LOGE(kTag, "failed to start refresh task");
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
initialized_ = true;
|
|
118
|
+
ESP_LOGI(kTag, "M5PaperS3 ready %dx%d portrait (landscape-native %dx%d), GRAY4 canvas / calibrated 4-level panel, epd=%d bytes",
|
|
119
|
+
kPortraitWidth, kPortraitHeight, kControllerWidth, kControllerHeight, kEpdBytes);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
bool start() { return init(); }
|
|
124
|
+
|
|
125
|
+
gea::framework::graphics::Canvas *canvas()
|
|
126
|
+
{
|
|
127
|
+
if (!initialized_) init();
|
|
128
|
+
return &canvas_;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
bool framebufferIsPanelDirect() const { return false; }
|
|
132
|
+
|
|
133
|
+
void applyOrientation(gea::framework::display::DisplayOrientation)
|
|
134
|
+
{
|
|
135
|
+
if (!init()) return;
|
|
136
|
+
take();
|
|
137
|
+
bindCanvasLocked();
|
|
138
|
+
canvas_.clear(static_cast<pixel::native_t>(15));
|
|
139
|
+
markAllRowsLocked();
|
|
140
|
+
forceFull_.store(true);
|
|
141
|
+
give();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
void clear()
|
|
145
|
+
{
|
|
146
|
+
clearNoFlush();
|
|
147
|
+
flush();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
void clearNoFlush()
|
|
151
|
+
{
|
|
152
|
+
if (!init()) return;
|
|
153
|
+
take();
|
|
154
|
+
canvas_.clear(static_cast<pixel::native_t>(15));
|
|
155
|
+
markAllRowsLocked();
|
|
156
|
+
forceFull_.store(true);
|
|
157
|
+
give();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
void flush()
|
|
161
|
+
{
|
|
162
|
+
if (!init()) return;
|
|
163
|
+
take();
|
|
164
|
+
accumulateCanvasDirtyLocked();
|
|
165
|
+
canvas_.resetDirty();
|
|
166
|
+
const bool needsRefresh = anyDirtyRows_ || forceFull_.load();
|
|
167
|
+
give();
|
|
168
|
+
if (needsRefresh) requestRefresh();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
void flushRects(const platform_display::DisplayFlushRect *rects, int count)
|
|
172
|
+
{
|
|
173
|
+
if (!rects || count <= 0 || !init()) return;
|
|
174
|
+
take();
|
|
175
|
+
for (int i = 0; i < count; ++i)
|
|
176
|
+
markLogicalRectLocked(rects[i].x0, rects[i].y0, rects[i].x1, rects[i].y1);
|
|
177
|
+
canvas_.resetDirty();
|
|
178
|
+
give();
|
|
179
|
+
requestRefresh();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
bool streamRect(int x, int y, int w, int h, platform_display::DisplayStreamRasterFn raster, void *user)
|
|
183
|
+
{
|
|
184
|
+
if (!raster || w <= 0 || h <= 0 || !init()) return false;
|
|
185
|
+
const int x0 = std::max(0, x);
|
|
186
|
+
const int y0 = std::max(0, y);
|
|
187
|
+
const int x1 = std::min(kPortraitWidth - 1, x + w - 1);
|
|
188
|
+
const int y1 = std::min(kPortraitHeight - 1, y + h - 1);
|
|
189
|
+
if (x0 > x1 || y0 > y1) return true;
|
|
190
|
+
const int width = x1 - x0 + 1;
|
|
191
|
+
static pixel::native_t rowbuf[kPortraitWidth];
|
|
192
|
+
take();
|
|
193
|
+
for (int row = y0; row <= y1; ++row) {
|
|
194
|
+
raster(rowbuf, width, 1, x0, row, user);
|
|
195
|
+
for (int i = 0; i < width; ++i)
|
|
196
|
+
epdSetLogical(x0 + i, row, static_cast<std::uint8_t>(rowbuf[i]));
|
|
197
|
+
}
|
|
198
|
+
markLogicalRectLocked(x0, y0, x1, y1);
|
|
199
|
+
give();
|
|
200
|
+
requestRefresh();
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Accept the direct-canvas present batch and rasterize it straight into the
|
|
205
|
+
// GRAY4 framebuffer (native_t colors are already gray4 at compile time), then
|
|
206
|
+
// refresh. The Canvas is bound rotated, so every draw lands landscape-native.
|
|
207
|
+
bool presentCommands(const platform_display::DisplayPresentCommand *commands, int count)
|
|
208
|
+
{
|
|
209
|
+
using T = platform_display::DisplayPresentCommandType;
|
|
210
|
+
if (!commands || count <= 0 || !init()) return false;
|
|
211
|
+
take();
|
|
212
|
+
canvas_.resetClip();
|
|
213
|
+
for (int i = 0; i < count; ++i) {
|
|
214
|
+
const auto &c = commands[i];
|
|
215
|
+
switch (c.type) {
|
|
216
|
+
case T::Clear:
|
|
217
|
+
canvas_.setGlobalAlpha(255);
|
|
218
|
+
canvas_.clear(static_cast<pixel::native_t>(15));
|
|
219
|
+
break;
|
|
220
|
+
case T::FillRectRgb565:
|
|
221
|
+
canvas_.setGlobalAlpha(c.fillRectRgb565.alpha);
|
|
222
|
+
canvas_.fillRect(c.fillRectRgb565.x, c.fillRectRgb565.y, c.fillRectRgb565.w, c.fillRectRgb565.h, c.fillRectRgb565.color);
|
|
223
|
+
break;
|
|
224
|
+
case T::StrokeRectRgb565:
|
|
225
|
+
canvas_.setGlobalAlpha(c.strokeRectRgb565.alpha);
|
|
226
|
+
canvas_.strokeRect(c.strokeRectRgb565.x, c.strokeRectRgb565.y, c.strokeRectRgb565.w, c.strokeRectRgb565.h, c.strokeRectRgb565.color);
|
|
227
|
+
break;
|
|
228
|
+
case T::FillTriangleRgb565:
|
|
229
|
+
canvas_.setGlobalAlpha(c.fillTriangleRgb565.alpha);
|
|
230
|
+
canvas_.fillTriangle(c.fillTriangleRgb565.x0, c.fillTriangleRgb565.y0, c.fillTriangleRgb565.x1, c.fillTriangleRgb565.y1,
|
|
231
|
+
c.fillTriangleRgb565.x2, c.fillTriangleRgb565.y2, c.fillTriangleRgb565.color);
|
|
232
|
+
break;
|
|
233
|
+
case T::FillCircleRgb565:
|
|
234
|
+
canvas_.setGlobalAlpha(c.fillCircleRgb565.alpha);
|
|
235
|
+
canvas_.fillCircle(c.fillCircleRgb565.x, c.fillCircleRgb565.y, c.fillCircleRgb565.radius, c.fillCircleRgb565.color);
|
|
236
|
+
break;
|
|
237
|
+
case T::StrokeCircleRgb565:
|
|
238
|
+
canvas_.setGlobalAlpha(c.strokeCircleRgb565.alpha);
|
|
239
|
+
canvas_.strokeCircle(c.strokeCircleRgb565.x, c.strokeCircleRgb565.y, c.strokeCircleRgb565.radius, c.strokeCircleRgb565.color);
|
|
240
|
+
break;
|
|
241
|
+
case T::FillCirclesRgb565:
|
|
242
|
+
canvas_.setGlobalAlpha(c.fillCirclesRgb565.alpha);
|
|
243
|
+
canvas_.fillCirclesRgb565(c.fillCirclesRgb565.xs, c.fillCirclesRgb565.ys, c.fillCirclesRgb565.count,
|
|
244
|
+
c.fillCirclesRgb565.radius, c.fillCirclesRgb565.colors);
|
|
245
|
+
break;
|
|
246
|
+
case T::FillTrianglesRgb565:
|
|
247
|
+
canvas_.setGlobalAlpha(c.fillTrianglesRgb565.alpha);
|
|
248
|
+
for (int t = 0; t < c.fillTrianglesRgb565.count; ++t) {
|
|
249
|
+
const auto &e = c.fillTrianglesRgb565.entries[t];
|
|
250
|
+
canvas_.fillTriangle(e.x0, e.y0, e.x1, e.y1, e.x2, e.y2, e.color);
|
|
251
|
+
}
|
|
252
|
+
break;
|
|
253
|
+
case T::DrawImage:
|
|
254
|
+
canvas_.setGlobalAlpha(c.drawImage.alpha);
|
|
255
|
+
canvas_.drawImage(c.drawImage.pixels, c.drawImage.alphaPixels, c.drawImage.srcWidth, c.drawImage.srcHeight, c.drawImage.x, c.drawImage.y);
|
|
256
|
+
break;
|
|
257
|
+
case T::DrawImageScaled:
|
|
258
|
+
canvas_.setGlobalAlpha(c.drawImageScaled.alpha);
|
|
259
|
+
canvas_.drawImage(c.drawImageScaled.pixels, c.drawImageScaled.alphaPixels, c.drawImageScaled.srcWidth, c.drawImageScaled.srcHeight,
|
|
260
|
+
c.drawImageScaled.x, c.drawImageScaled.y, c.drawImageScaled.w, c.drawImageScaled.h);
|
|
261
|
+
break;
|
|
262
|
+
case T::DrawImageRotated90CW:
|
|
263
|
+
canvas_.setGlobalAlpha(c.drawImageRotated90CW.alpha);
|
|
264
|
+
canvas_.drawImageRotated90CW(c.drawImageRotated90CW.pixels, c.drawImageRotated90CW.alphaPixels, c.drawImageRotated90CW.srcWidth, c.drawImageRotated90CW.srcHeight,
|
|
265
|
+
c.drawImageRotated90CW.x, c.drawImageRotated90CW.y, c.drawImageRotated90CW.w, c.drawImageRotated90CW.h);
|
|
266
|
+
break;
|
|
267
|
+
case T::DrawImageTiledX:
|
|
268
|
+
canvas_.setGlobalAlpha(c.drawImageTiledX.alpha);
|
|
269
|
+
canvas_.drawImageTiledX(c.drawImageTiledX.pixels, c.drawImageTiledX.alphaPixels, c.drawImageTiledX.srcWidth, c.drawImageTiledX.srcHeight,
|
|
270
|
+
c.drawImageTiledX.x, c.drawImageTiledX.y, c.drawImageTiledX.w);
|
|
271
|
+
break;
|
|
272
|
+
case T::FillText:
|
|
273
|
+
canvas_.setGlobalAlpha(255);
|
|
274
|
+
if (c.fillText.fontFamilyId >= 0)
|
|
275
|
+
canvas_.drawTextFontFamily(c.fillText.text, c.fillText.x, c.fillText.y, c.fillText.color, c.fillText.fontFamilyId, c.fillText.fontSizePx);
|
|
276
|
+
else
|
|
277
|
+
canvas_.drawText(c.fillText.text, c.fillText.x, c.fillText.y, c.fillText.color, c.fillText.scale);
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
canvas_.setGlobalAlpha(255);
|
|
282
|
+
// A canvas-app present repaints the whole logical surface; mark every
|
|
283
|
+
// physical row and let the per-pixel delta drive skip what did not change.
|
|
284
|
+
markAllRowsLocked();
|
|
285
|
+
give();
|
|
286
|
+
requestRefresh();
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
void setFlushConfig(int, int) {}
|
|
291
|
+
int flushChunkRows() const { return kPortraitHeight; }
|
|
292
|
+
int flushQueueDepth() const { return 1; }
|
|
293
|
+
int flushBufferBytes() const { return kEpdBytes; }
|
|
294
|
+
|
|
295
|
+
// Read the physical landscape buffer back out as a LOGICAL portrait RGB565
|
|
296
|
+
// snapshot (inverse of the render rotation): logical (lx,ly) <- physical
|
|
297
|
+
// (px=ly, py=539-lx).
|
|
298
|
+
bool copySnapshotRgb565(std::uint16_t *dst, int capacity, int *width, int *height)
|
|
299
|
+
{
|
|
300
|
+
const int pixels = kPortraitWidth * kPortraitHeight;
|
|
301
|
+
if (!dst || capacity < pixels || !epdFb_) return false;
|
|
302
|
+
if (width) *width = kPortraitWidth;
|
|
303
|
+
if (height) *height = kPortraitHeight;
|
|
304
|
+
for (int ly = 0; ly < kPortraitHeight; ++ly) {
|
|
305
|
+
for (int lx = 0; lx < kPortraitWidth; ++lx) {
|
|
306
|
+
const std::uint8_t v = epdGetLogical(lx, ly);
|
|
307
|
+
dst[static_cast<std::size_t>(ly) * kPortraitWidth + lx] = pixel::gray4ToRgb565(v);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Same LOGICAL-portrait snapshot as copySnapshotRgb565, but packed 2 px/byte
|
|
314
|
+
// (this board's native GRAY4 storage) instead of expanded to RGB565 -- 259,200
|
|
315
|
+
// bytes for the 540x960 panel vs 1,036,800 expanded. Caller (device_control's
|
|
316
|
+
// screenshot commands) expands to RGB565 per-pixel while it encodes, so the
|
|
317
|
+
// wire format is unchanged; only the device-side allocation shrinks. Written
|
|
318
|
+
// as a flat row-major pixel stream (index ly*kPortraitWidth+lx, no per-row
|
|
319
|
+
// padding -- kPortraitWidth is even so that never bites), through the same
|
|
320
|
+
// epdGetLogical rotation the RGB565 path uses (physical px=ly, py=539-lx).
|
|
321
|
+
bool copySnapshotPacked(std::uint8_t *dst, int byteCapacity, int *width, int *height)
|
|
322
|
+
{
|
|
323
|
+
const int pixels = kPortraitWidth * kPortraitHeight;
|
|
324
|
+
const int neededBytes = pixel::packed::rowBytes(pixels);
|
|
325
|
+
if (!dst || byteCapacity < neededBytes || !epdFb_) return false;
|
|
326
|
+
if (width) *width = kPortraitWidth;
|
|
327
|
+
if (height) *height = kPortraitHeight;
|
|
328
|
+
for (int ly = 0; ly < kPortraitHeight; ++ly) {
|
|
329
|
+
for (int lx = 0; lx < kPortraitWidth; ++lx) {
|
|
330
|
+
const std::uint8_t v = epdGetLogical(lx, ly);
|
|
331
|
+
pixel::packed::set(dst, ly * kPortraitWidth + lx, v);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
int countNonBlackPixels() const
|
|
338
|
+
{
|
|
339
|
+
int count = 0;
|
|
340
|
+
for (int i = 0; epdFb_ && i < kEpdBytes; ++i) {
|
|
341
|
+
const std::uint8_t b = epdFb_[i];
|
|
342
|
+
if (b >> 4) ++count;
|
|
343
|
+
if (b & 0x0F) ++count;
|
|
344
|
+
}
|
|
345
|
+
return count;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
void setBrightness(int) {}
|
|
349
|
+
int brightness() const { return 100; }
|
|
350
|
+
platform_display::DisplayFlushPerfStats flushStats() const { return stats_; }
|
|
351
|
+
void flushStatsReset() { stats_ = {}; }
|
|
352
|
+
const char *flushStageName() const { return refreshInFlight_.load() ? "epd-refresh" : "idle"; }
|
|
353
|
+
|
|
354
|
+
std::uint16_t *backgroundCache(int *capacity) { return scratch(backgroundCache_, backgroundAttempted_, capacity); }
|
|
355
|
+
std::uint16_t *backdropCache(int *capacity) { return scratch(backdropCache_, backdropAttempted_, capacity); }
|
|
356
|
+
|
|
357
|
+
void setRefreshConfig(int fullEvery, int hardCap, int)
|
|
358
|
+
{
|
|
359
|
+
if (fullEvery >= 0) fullRefreshEvery_.store(fullEvery);
|
|
360
|
+
if (hardCap >= 0) fullRefreshHardCap_.store(hardCap);
|
|
361
|
+
ESP_LOGI(kTag, "refresh config fullEvery=%d hardCap=%d",
|
|
362
|
+
fullRefreshEvery_.load(), fullRefreshHardCap_.load());
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
void requestFullRefresh()
|
|
366
|
+
{
|
|
367
|
+
if (!init()) return;
|
|
368
|
+
forceFull_.store(true);
|
|
369
|
+
requestRefresh();
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
void setQualityGrayscale(bool enabled)
|
|
373
|
+
{
|
|
374
|
+
// A waveform-mode boundary gets a known-white baseline. Promote the next
|
|
375
|
+
// real frame rather than immediately repainting stale content.
|
|
376
|
+
if (qualityGrayscale_.exchange(enabled) != enabled) forceFull_.store(true);
|
|
377
|
+
ESP_LOGI(kTag, "grayscale mode=%s",
|
|
378
|
+
enabled ? "calibrated 4-level high" : "calibrated 4-level fast");
|
|
379
|
+
}
|
|
380
|
+
void setFullOnCover(bool enabled) { fullOnCover_.store(enabled); }
|
|
381
|
+
void rebindCanvasToFramebuffer() { bindCanvas(); }
|
|
382
|
+
|
|
383
|
+
private:
|
|
384
|
+
DisplayBackend() = default;
|
|
385
|
+
|
|
386
|
+
int logicalWidth() const { return kPortraitWidth; }
|
|
387
|
+
int logicalHeight() const { return kPortraitHeight; }
|
|
388
|
+
|
|
389
|
+
void take() { if (mutex_) xSemaphoreTake(mutex_, portMAX_DELAY); }
|
|
390
|
+
void give() { if (mutex_) xSemaphoreGive(mutex_); }
|
|
391
|
+
|
|
392
|
+
void bindCanvas() { take(); bindCanvasLocked(); give(); }
|
|
393
|
+
void bindCanvasLocked()
|
|
394
|
+
{
|
|
395
|
+
// Rotation-aware bind: the Canvas presents logical portrait 540x960 but
|
|
396
|
+
// writes rotated into the physical landscape buffer. Every draw lands in
|
|
397
|
+
// its final panel location with no separate transpose pass.
|
|
398
|
+
canvas_.bindPixelsRotatedLandscape(epdFb_, kPortraitWidth, kPortraitHeight);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Direct rotated write of a LOGICAL pixel into the physical buffer (used by the
|
|
402
|
+
// streamRect raster path, which does not go through the Canvas). Mirrors the
|
|
403
|
+
// Canvas rotation exactly: physical (px=ly, py=539-lx), high nibble = even px.
|
|
404
|
+
void epdSetLogical(int lx, int ly, std::uint8_t v)
|
|
405
|
+
{
|
|
406
|
+
const int px = ly;
|
|
407
|
+
const int py = (kPortraitWidth - 1) - lx;
|
|
408
|
+
std::uint8_t *b = epdFb_ + static_cast<std::size_t>(py) * kEpdStride + (px >> 1);
|
|
409
|
+
if (px & 1) *b = static_cast<std::uint8_t>((*b & 0xF0) | (v & 0x0F));
|
|
410
|
+
else *b = static_cast<std::uint8_t>((*b & 0x0F) | ((v & 0x0F) << 4));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
std::uint8_t epdGetLogical(int lx, int ly) const
|
|
414
|
+
{
|
|
415
|
+
const int px = ly;
|
|
416
|
+
const int py = (kPortraitWidth - 1) - lx;
|
|
417
|
+
const std::uint8_t b = epdFb_[static_cast<std::size_t>(py) * kEpdStride + (px >> 1)];
|
|
418
|
+
return (px & 1) ? static_cast<std::uint8_t>(b & 0x0F) : static_cast<std::uint8_t>(b >> 4);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Map a LOGICAL-portrait dirty rect to the PHYSICAL rows it touches and mark
|
|
422
|
+
// them. logical x range [lx0,lx1] -> physical rows [539-lx1, 539-lx0]; the
|
|
423
|
+
// logical y range maps to physical columns, which the driver drives whole-row
|
|
424
|
+
// (unchanged pixels NOP), so it does not narrow the row set. Caller holds mutex.
|
|
425
|
+
void markLogicalRectLocked(int lx0, int ly0, int lx1, int ly1)
|
|
426
|
+
{
|
|
427
|
+
if (lx0 < 0) lx0 = 0;
|
|
428
|
+
if (ly0 < 0) ly0 = 0;
|
|
429
|
+
if (lx1 > kPortraitWidth - 1) lx1 = kPortraitWidth - 1;
|
|
430
|
+
if (ly1 > kPortraitHeight - 1) ly1 = kPortraitHeight - 1;
|
|
431
|
+
if (lx0 > lx1 || ly0 > ly1) return;
|
|
432
|
+
int py0 = (kControllerHeight - 1) - lx1;
|
|
433
|
+
int py1 = (kControllerHeight - 1) - lx0;
|
|
434
|
+
if (py0 < 0) py0 = 0;
|
|
435
|
+
if (py1 > kControllerHeight - 1) py1 = kControllerHeight - 1;
|
|
436
|
+
for (int py = py0; py <= py1; ++py) dirtyRows_[py] = 1;
|
|
437
|
+
anyDirtyRows_ = true;
|
|
438
|
+
if (lx0 == 0 && ly0 == 0 && lx1 == kPortraitWidth - 1 && ly1 == kPortraitHeight - 1)
|
|
439
|
+
dirtyCoversScreen_ = true;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
void markAllRowsLocked()
|
|
443
|
+
{
|
|
444
|
+
std::memset(dirtyRows_, 1, sizeof(dirtyRows_));
|
|
445
|
+
anyDirtyRows_ = true;
|
|
446
|
+
dirtyCoversScreen_ = true;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
bool coversScreenLocked() const { return dirtyCoversScreen_; }
|
|
450
|
+
|
|
451
|
+
// Pull the engine's per-rect dirty regions (or its overall bounds) off the
|
|
452
|
+
// Canvas and fold them into the physical dirty-row set. Caller holds mutex.
|
|
453
|
+
void accumulateCanvasDirtyLocked()
|
|
454
|
+
{
|
|
455
|
+
gea::framework::graphics::CanvasDirtyRect rects[gea::framework::graphics::Canvas::kMaxDirtyRects];
|
|
456
|
+
const int n = canvas_.dirtyRects(rects, gea::framework::graphics::Canvas::kMaxDirtyRects);
|
|
457
|
+
if (n > 0) {
|
|
458
|
+
for (int i = 0; i < n; ++i)
|
|
459
|
+
markLogicalRectLocked(rects[i].x0, rects[i].y0, rects[i].x1, rects[i].y1);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
|
|
463
|
+
if (canvas_.dirty(&x0, &y0, &x1, &y1)) markLogicalRectLocked(x0, y0, x1, y1);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
std::uint16_t *scratch(std::uint16_t *&buffer, bool &attempted, int *capacity)
|
|
467
|
+
{
|
|
468
|
+
const int pixels = kPortraitWidth * kPortraitHeight;
|
|
469
|
+
if (!attempted) {
|
|
470
|
+
attempted = true;
|
|
471
|
+
buffer = static_cast<std::uint16_t *>(
|
|
472
|
+
heap_caps_malloc(pixels * sizeof(std::uint16_t), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
|
473
|
+
}
|
|
474
|
+
if (capacity) *capacity = buffer ? pixels : 0;
|
|
475
|
+
return buffer;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
void requestRefresh()
|
|
479
|
+
{
|
|
480
|
+
pendingSeq_.fetch_add(1, std::memory_order_release);
|
|
481
|
+
if (refreshTask_) xTaskNotifyGive(refreshTask_);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
static void refreshTaskEntry(void *arg) { static_cast<DisplayBackend *>(arg)->refreshLoop(); }
|
|
485
|
+
|
|
486
|
+
void refreshLoop()
|
|
487
|
+
{
|
|
488
|
+
std::uint32_t transmitted = 0;
|
|
489
|
+
for (;;) {
|
|
490
|
+
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
|
491
|
+
const std::uint32_t seq = pendingSeq_.load(std::memory_order_acquire);
|
|
492
|
+
const bool newFrame = (seq != transmitted);
|
|
493
|
+
if (!newFrame) continue;
|
|
494
|
+
transmitted = seq;
|
|
495
|
+
|
|
496
|
+
refreshInFlight_.store(true);
|
|
497
|
+
const std::int64_t started = esp_timer_get_time();
|
|
498
|
+
|
|
499
|
+
// Both modes use the calibrated four-state physical transition model.
|
|
500
|
+
// Reading mode (quality=true, fullOnCover=false) deliberately uses the
|
|
501
|
+
// 7-pass FAST table for ordinary page turns and periodically clears the
|
|
502
|
+
// panel. QUALITY (fullOnCover=true) still flashes full page redraws; its
|
|
503
|
+
// smaller partials use the 13-pass HIGH table.
|
|
504
|
+
const bool quality = qualityGrayscale_.load();
|
|
505
|
+
const bool highPartial = quality && fullOnCover_.load();
|
|
506
|
+
bool coversScreen = false;
|
|
507
|
+
|
|
508
|
+
// Clear the engine's dirty accumulator after snapshotting this frame.
|
|
509
|
+
take();
|
|
510
|
+
coversScreen = coversScreenLocked();
|
|
511
|
+
// From this point until the panel powers off, every field and the
|
|
512
|
+
// driver's shadow commit must observe exactly this same frame.
|
|
513
|
+
std::memcpy(scanFb_, epdFb_, kEpdBytes);
|
|
514
|
+
std::memset(dirtyRows_, 0, sizeof(dirtyRows_));
|
|
515
|
+
anyDirtyRows_ = false;
|
|
516
|
+
dirtyCoversScreen_ = false;
|
|
517
|
+
give();
|
|
518
|
+
|
|
519
|
+
const bool forced = forceFull_.exchange(false);
|
|
520
|
+
const int fullEvery = fullRefreshEvery_.load();
|
|
521
|
+
const int hardCap = fullRefreshHardCap_.load();
|
|
522
|
+
const bool cadenceFull = quality &&
|
|
523
|
+
((fullEvery > 0 && partialsSinceFull_ >= fullEvery) ||
|
|
524
|
+
(hardCap > 0 && partialsSinceFull_ >= hardCap));
|
|
525
|
+
const bool coverFull = quality && coversScreen && fullOnCover_.load();
|
|
526
|
+
const bool full = forced || cadenceFull || coverFull;
|
|
527
|
+
|
|
528
|
+
papers3_epd_power_on();
|
|
529
|
+
if (full) {
|
|
530
|
+
// Blocking flash-to-white + calibrated full redraw.
|
|
531
|
+
papers3_epd_refresh(scanFb_);
|
|
532
|
+
partialsSinceFull_ = 0;
|
|
533
|
+
} else if (highPartial) {
|
|
534
|
+
// HIGH partial: changed old ink is erased to white, then non-white
|
|
535
|
+
// targets are painted with the calibrated PaperS3 waveform. Unchanged
|
|
536
|
+
// pixels emit NOP throughout.
|
|
537
|
+
papers3_epd_draw_gray4(scanFb_);
|
|
538
|
+
++partialsSinceFull_;
|
|
539
|
+
} else {
|
|
540
|
+
papers3_epd_draw_fast_gray4(scanFb_);
|
|
541
|
+
++partialsSinceFull_;
|
|
542
|
+
}
|
|
543
|
+
papers3_epd_power_off();
|
|
544
|
+
|
|
545
|
+
const std::int64_t elapsed = esp_timer_get_time() - started;
|
|
546
|
+
stats_.callCount++;
|
|
547
|
+
stats_.txUs += elapsed;
|
|
548
|
+
stats_.chunkCount++;
|
|
549
|
+
refreshInFlight_.store(false);
|
|
550
|
+
const char *kind = full ? "full" : (highPartial ? "high4" : "fast4");
|
|
551
|
+
ESP_LOGI(kTag, "%s present %lldms (partials=%d)",
|
|
552
|
+
kind,
|
|
553
|
+
static_cast<long long>(elapsed / 1000), partialsSinceFull_);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
SemaphoreHandle_t mutex_ = nullptr;
|
|
558
|
+
TaskHandle_t refreshTask_ = nullptr;
|
|
559
|
+
gea::framework::graphics::Canvas canvas_;
|
|
560
|
+
std::uint8_t *epdFb_ = nullptr; // physical landscape GRAY4 (Canvas target)
|
|
561
|
+
std::uint8_t *scanFb_ = nullptr; // immutable physical GRAY4 panel target
|
|
562
|
+
std::uint16_t *backgroundCache_ = nullptr;
|
|
563
|
+
std::uint16_t *backdropCache_ = nullptr;
|
|
564
|
+
// Physical rows dirtied by the engine since the last drive; drained by the
|
|
565
|
+
// refresh task. Protected by mutex_.
|
|
566
|
+
std::uint8_t dirtyRows_[kControllerHeight] = {};
|
|
567
|
+
bool anyDirtyRows_ = false;
|
|
568
|
+
bool dirtyCoversScreen_ = false;
|
|
569
|
+
std::atomic<std::uint32_t> pendingSeq_{0};
|
|
570
|
+
std::atomic<bool> refreshInFlight_{false};
|
|
571
|
+
std::atomic<bool> forceFull_{true};
|
|
572
|
+
// Default = calibrated FAST; apps that want cleaner text opt into HIGH.
|
|
573
|
+
std::atomic<bool> qualityGrayscale_{false};
|
|
574
|
+
std::atomic<bool> fullOnCover_{false};
|
|
575
|
+
int partialsSinceFull_ = 0;
|
|
576
|
+
std::atomic<int> fullRefreshEvery_{kDefaultFullRefreshEvery};
|
|
577
|
+
std::atomic<int> fullRefreshHardCap_{0};
|
|
578
|
+
bool backgroundAttempted_ = false;
|
|
579
|
+
bool backdropAttempted_ = false;
|
|
580
|
+
bool initialized_ = false;
|
|
581
|
+
platform_display::DisplayFlushPerfStats stats_ = {};
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
} // namespace
|
|
585
|
+
|
|
586
|
+
} // namespace gea::platform::papers3::display
|
|
587
|
+
|
|
588
|
+
extern "C" void gea_epaper_set_refresh_config(
|
|
589
|
+
int fullEvery, int hardCap, int fastWindowMs,
|
|
590
|
+
const std::uint8_t *, int, const std::uint8_t *, int)
|
|
591
|
+
{
|
|
592
|
+
(void)fastWindowMs;
|
|
593
|
+
gea::platform::papers3::display::DisplayBackend::instance().setRefreshConfig(fullEvery, hardCap, fastWindowMs);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
extern "C" void gea_epaper_full_refresh(void)
|
|
597
|
+
{
|
|
598
|
+
gea::platform::papers3::display::DisplayBackend::instance().requestFullRefresh();
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
extern "C" void gea_epaper_set_grayscale(int enabled)
|
|
602
|
+
{
|
|
603
|
+
gea::platform::papers3::display::DisplayBackend::instance().setQualityGrayscale(enabled != 0);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
extern "C" void gea_epaper_set_full_on_cover(int enabled)
|
|
607
|
+
{
|
|
608
|
+
gea::platform::papers3::display::DisplayBackend::instance().setFullOnCover(enabled != 0);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
extern "C" std::uint16_t *gea_bg_cache(int *capacity)
|
|
612
|
+
{
|
|
613
|
+
return gea::platform::papers3::display::DisplayBackend::instance().backgroundCache(capacity);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
extern "C" std::uint16_t *gea_backdrop_cache(int *capacity)
|
|
617
|
+
{
|
|
618
|
+
return gea::platform::papers3::display::DisplayBackend::instance().backdropCache(capacity);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
namespace gea::platform::display {
|
|
622
|
+
|
|
623
|
+
namespace {
|
|
624
|
+
|
|
625
|
+
using Backend = gea::platform::papers3::display::DisplayBackend;
|
|
626
|
+
gea::framework::graphics::Canvas *drawingCanvas() { return Backend::instance().canvas(); }
|
|
627
|
+
|
|
628
|
+
} // namespace
|
|
629
|
+
|
|
630
|
+
bool Display::init() { return Backend::instance().init(); }
|
|
631
|
+
bool Display::start() { return Backend::instance().start(); }
|
|
632
|
+
gea::framework::graphics::Canvas *Display::canvas() { return Backend::instance().canvas(); }
|
|
633
|
+
bool Display::framebufferIsPanelDirect() { return false; }
|
|
634
|
+
void Display::clear() { Backend::instance().clear(); }
|
|
635
|
+
void Display::clearNoFlush() { Backend::instance().clearNoFlush(); }
|
|
636
|
+
void Display::print(const char *) {}
|
|
637
|
+
void Display::flush() { Backend::instance().flush(); }
|
|
638
|
+
void Display::flushRects(const DisplayFlushRect *rects, int count, bool) { Backend::instance().flushRects(rects, count); }
|
|
639
|
+
bool Display::streamRect(int x, int y, int w, int h, DisplayStreamRasterFn raster, void *user) { return Backend::instance().streamRect(x, y, w, h, raster, user); }
|
|
640
|
+
bool Display::present(const DisplayPresentCommand *commands, int count) { return Backend::instance().presentCommands(commands, count); }
|
|
641
|
+
void Display::rebindCanvasToFramebuffer() { Backend::instance().rebindCanvasToFramebuffer(); }
|
|
642
|
+
void Display::setFlushConfig(int rows, int depth) { Backend::instance().setFlushConfig(rows, depth); }
|
|
643
|
+
void Display::reserveInternal(std::size_t) {}
|
|
644
|
+
bool Display::setHighBrightnessMode(bool) { return false; }
|
|
645
|
+
bool Display::highBrightnessMode() { return false; }
|
|
646
|
+
void Display::applyPendingInternalReserve() {}
|
|
647
|
+
int Display::flushChunkRows() { return Backend::instance().flushChunkRows(); }
|
|
648
|
+
int Display::flushQueueDepth() { return Backend::instance().flushQueueDepth(); }
|
|
649
|
+
int Display::flushBufferBytes() { return Backend::instance().flushBufferBytes(); }
|
|
650
|
+
void Display::pushClip(int x, int y, int w, int h) { if (auto *c = drawingCanvas()) c->pushClip(x, y, w, h); }
|
|
651
|
+
void Display::popClip() { if (auto *c = drawingCanvas()) c->popClip(); }
|
|
652
|
+
void Display::resetClip() { if (auto *c = drawingCanvas()) c->resetClip(); }
|
|
653
|
+
void Display::setAlpha(std::uint8_t alpha) { if (auto *c = drawingCanvas()) c->setGlobalAlpha(alpha); }
|
|
654
|
+
std::uint8_t Display::alpha() { return drawingCanvas() ? drawingCanvas()->globalAlpha() : 255; }
|
|
655
|
+
int Display::brightness() { return Backend::instance().brightness(); }
|
|
656
|
+
void Display::setBrightness(int value) { Backend::instance().setBrightness(value); }
|
|
657
|
+
void Display::setVSync(bool) {}
|
|
658
|
+
bool Display::vsyncEnabled() { return false; }
|
|
659
|
+
void Display::vsyncWaitForFrame() {}
|
|
660
|
+
void Display::invalidate() {}
|
|
661
|
+
void Display::clip(int *x0, int *y0, int *x1, int *y1) { if (auto *c = drawingCanvas()) c->currentClip(x0, y0, x1, y1); }
|
|
662
|
+
void Display::fillRect(int x, int y, int w, int h, pixel::native_t color) { if (auto *c = drawingCanvas()) c->fillRect(x, y, w, h, color); }
|
|
663
|
+
void Display::scrollRect(int x, int y, int w, int h, int dx, int dy) { if (auto *c = drawingCanvas()) c->scrollRect(x, y, w, h, dx, dy); }
|
|
664
|
+
void Display::resetScrollRegion() {}
|
|
665
|
+
void Display::strokeRect(int x, int y, int w, int h, pixel::native_t color) { if (auto *c = drawingCanvas()) c->strokeRect(x, y, w, h, color); }
|
|
666
|
+
void Display::fillCircle(int x, int y, int r, pixel::native_t color) { if (auto *c = drawingCanvas()) c->fillCircle(x, y, r, color); }
|
|
667
|
+
void Display::strokeCircle(int x, int y, int r, pixel::native_t color) { if (auto *c = drawingCanvas()) c->strokeCircle(x, y, r, color); }
|
|
668
|
+
void Display::drawLine(int x0, int y0, int x1, int y1, pixel::native_t color) { if (auto *c = drawingCanvas()) c->drawLine(x0, y0, x1, y1, color); }
|
|
669
|
+
void Display::drawArc(int x, int y, int r, int start, int end, pixel::native_t color) { if (auto *c = drawingCanvas()) c->drawArc(x, y, r, start, end, color); }
|
|
670
|
+
void Display::fillTriangle(int x0, int y0, int x1, int y1, int x2, int y2, pixel::native_t color) { if (auto *c = drawingCanvas()) c->fillTriangle(x0, y0, x1, y1, x2, y2, color); }
|
|
671
|
+
void Display::drawText(const char *text, int x, int y, pixel::native_t color, float scale) { if (auto *c = drawingCanvas()) c->drawText(text, x, y, color, scale); }
|
|
672
|
+
void Display::drawTextFont(const char *text, int x, int y, pixel::native_t color, int font) { if (auto *c = drawingCanvas()) c->drawTextFont(text, x, y, color, font); }
|
|
673
|
+
void Display::drawTextFontFamily(const char *text, int x, int y, pixel::native_t color, int family, int size) { if (auto *c = drawingCanvas()) c->drawTextFontFamily(text, x, y, color, family, size); }
|
|
674
|
+
void Display::setPixel(int x, int y, pixel::native_t color) { if (auto *c = drawingCanvas()) c->fillRect(x, y, 1, 1, color); }
|
|
675
|
+
void Display::fillRoundedRect(int x, int y, int w, int h, int tl, int tr, int br, int bl, pixel::native_t color) { if (auto *c = drawingCanvas()) c->fillRoundedRect(x, y, w, h, tl, tr, br, bl, color); }
|
|
676
|
+
void Display::fillRoundedRectBoxesRgb565(const std::int16_t *xs, const std::int16_t *ys, int count, int w, int h, int tl, int tr, int br, int bl, const pixel::native_t *colors) { if (auto *c = drawingCanvas()) c->fillRoundedRectBoxesRgb565(xs, ys, count, w, h, tl, tr, br, bl, colors); }
|
|
677
|
+
void Display::strokeRoundedRect(int x, int y, int w, int h, int tl, int tr, int br, int bl, int lw, pixel::native_t color) { if (auto *c = drawingCanvas()) c->strokeRoundedRect(x, y, w, h, tl, tr, br, bl, lw, color); }
|
|
678
|
+
void Display::blitImage(const pixel::native_t *src, const std::uint8_t *alpha, int sw, int sh, int x, int y) { if (auto *c = drawingCanvas()) c->drawImage(src, alpha, sw, sh, x, y); }
|
|
679
|
+
void Display::blitImageScaled(const pixel::native_t *src, const std::uint8_t *alpha, int sw, int sh, int x, int y, int w, int h) { if (auto *c = drawingCanvas()) c->drawImage(src, alpha, sw, sh, x, y, w, h); }
|
|
680
|
+
void Display::setWorldOverlay(const std::uint16_t *, int, int, int, int) {}
|
|
681
|
+
void Display::setWorldScroll(int) {}
|
|
682
|
+
void Display::flushStatsRead(std::int64_t *us, int *calls, int *pixels)
|
|
683
|
+
{
|
|
684
|
+
const auto stats = Backend::instance().flushStats();
|
|
685
|
+
if (us) *us = stats.totalUs;
|
|
686
|
+
if (calls) *calls = stats.callCount;
|
|
687
|
+
if (pixels) *pixels = stats.pixelCount;
|
|
688
|
+
}
|
|
689
|
+
DisplayFlushPerfStats Display::flushPerfStatsRead() { return Backend::instance().flushStats(); }
|
|
690
|
+
void Display::flushStatsReset() { Backend::instance().flushStatsReset(); }
|
|
691
|
+
const char *Display::flushStageName() { return Backend::instance().flushStageName(); }
|
|
692
|
+
int Display::flushStageChunk() { return 0; }
|
|
693
|
+
DisplayFlushStageDetail Display::flushStageDetail() { return {}; }
|
|
694
|
+
bool Display::copySnapshotRgb565(std::uint16_t *dst, int capacity, int *w, int *h, bool) { return Backend::instance().copySnapshotRgb565(dst, capacity, w, h); }
|
|
695
|
+
bool Display::copySnapshotPacked(std::uint8_t *dst, int byteCapacity, int *w, int *h, bool) { return Backend::instance().copySnapshotPacked(dst, byteCapacity, w, h); }
|
|
696
|
+
int Display::countNonBlackPixels(bool) { return Backend::instance().countNonBlackPixels(); }
|
|
697
|
+
|
|
698
|
+
// The canvas draws directly into the packed 4bpp framebuffer, so the presented
|
|
699
|
+
// copy IS the live frame; a retained-snapshot re-replay would read packed
|
|
700
|
+
// storage as unpacked and lie.
|
|
701
|
+
extern "C" bool geaDisplaySnapshotPrefersPresented() { return true; }
|
|
702
|
+
|
|
703
|
+
void applyOrientation(gea::framework::display::DisplayOrientation orientation) { Backend::instance().applyOrientation(orientation); }
|
|
704
|
+
bool autoRotateAllowed() { return false; }
|
|
705
|
+
|
|
706
|
+
} // namespace gea::platform::display
|