@geastack/targets 0.1.100 → 0.1.102

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 (49) hide show
  1. package/package.json +7 -7
  2. package/targets/cmake/geatsc-generated-archive-build.mjs +32 -1
  3. package/targets/esp32/app_project.cmake +2 -2
  4. package/targets/esp32/chip_bindings/audio/echo_cancellation.cpp +392 -28
  5. package/targets/esp32/chip_bindings/audio/echo_cancellation.h +18 -2
  6. package/targets/esp32/chip_bindings/audio/es8311.cpp +117 -13
  7. package/targets/esp32/chip_bindings/displays/co5300.cpp +68 -28
  8. package/targets/esp32/components/gea_framework/CMakeLists.txt +17 -1
  9. package/targets/esp32/components/gea_framework/idf_component.yml +4 -0
  10. package/targets/esp32/components/gea_vpx/CMakeLists.txt +1 -1
  11. package/targets/esp32/connectivity/wifi.cpp +800 -543
  12. package/targets/esp32/display.cpp +121 -26
  13. package/targets/esp32/gea_framework.cmake +22 -28
  14. package/targets/esp32/host_sources.cmake +1 -0
  15. package/targets/esp32/services/comparison_benchmark.h +137 -0
  16. package/targets/esp32/services/comparison_gesture.h +133 -0
  17. package/targets/esp32/services/comparison_input_trace.h +64 -0
  18. package/targets/esp32/services/comparison_upload_capture.h +125 -0
  19. package/targets/esp32/services/debugger.h +634 -0
  20. package/targets/esp32/services/device_control.cpp +965 -20
  21. package/targets/esp32/services/frame_scheduler.cpp +128 -4
  22. package/targets/esp32/services/heap.cpp +125 -0
  23. package/targets/esp32/services/opus_benchmark.h +1 -1
  24. package/targets/esp32/services/storage_service.cpp +119 -104
  25. package/targets/esp32-p4-m5stack-tab5/dependencies.lock +27 -16
  26. package/targets/esp32-s3-m5stack-stopwatch/.clang-format +10 -0
  27. package/targets/esp32-s3-m5stack-stopwatch/README.md +14 -9
  28. package/targets/esp32-s3-m5stack-stopwatch/dependencies.lock +54 -1
  29. package/targets/esp32-s3-m5stack-stopwatch/main/CMakeLists.txt +10 -7
  30. package/targets/esp32-s3-m5stack-stopwatch/main/buttons.cpp +80 -0
  31. package/targets/esp32-s3-m5stack-stopwatch/main/idf_component.yml +18 -0
  32. package/targets/esp32-s3-m5stack-stopwatch/main/include/board.h +38 -17
  33. package/targets/esp32-s3-m5stack-stopwatch/main/panel_reset.cpp +132 -129
  34. package/targets/esp32-s3-m5stack-stopwatch/main/power.cpp +253 -0
  35. package/targets/esp32-s3-m5stack-stopwatch/main/touch.cpp +158 -88
  36. package/targets/esp32-s3-m5stack-stopwatch/sdkconfig.defaults +13 -0
  37. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +30 -3
  38. package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +10 -148
  39. package/targets/esp32-s31-espressif-mosaico/CMakeLists.txt +8 -0
  40. package/targets/esp32-s31-espressif-mosaico/README.md +54 -2
  41. package/targets/esp32-s31-espressif-mosaico/dependencies.lock +405 -1
  42. package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +31 -1
  43. package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +117 -0
  44. package/targets/esp32-s31-espressif-mosaico/main/camera.cpp +389 -0
  45. package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +17 -3
  46. package/targets/esp32-s31-espressif-mosaico/main/include/board.h +23 -0
  47. package/targets/esp32-s31-espressif-mosaico/main/nand_mount.cpp +172 -0
  48. package/targets/esp32-s31-espressif-mosaico/partitions.csv +7 -3
  49. package/targets/esp32-s31-espressif-mosaico/sdkconfig.defaults +24 -0
@@ -7,6 +7,7 @@
7
7
  #include <algorithm>
8
8
  #include <atomic>
9
9
  #include <cstdint>
10
+ #include <mutex>
10
11
 
11
12
  #include "driver/i2c_master.h"
12
13
  #include "esp_attr.h"
@@ -29,119 +30,188 @@ bool moveQueued = false;
29
30
  std::uint32_t lastPoll = 0;
30
31
  std::uint32_t lastReport = 0;
31
32
  std::atomic<bool> reportPending{false};
33
+ std::atomic<bool> injectedGestureActive{false};
34
+ std::mutex streamMutex;
35
+ std::mutex cacheMutex;
32
36
 
33
- void IRAM_ATTR touchInterrupt(void *)
34
- {
35
- reportPending.store(true, std::memory_order_relaxed);
37
+ void IRAM_ATTR touchInterrupt(void*) {
38
+ reportPending.store(true, std::memory_order_relaxed);
36
39
  }
37
40
 
38
- void notify(Phase phase, bool touching, int x, int y)
39
- {
40
- if (pointerObserver) pointerObserver(phase, touching, x, y, 0);
41
- else if (observer) observer(phase, touching, x, y);
41
+ void notify(Phase phase, bool touching, int x, int y) {
42
+ Touchscreen::Observer currentObserver;
43
+ Touchscreen::PointerObserver currentPointerObserver;
44
+ {
45
+ const std::lock_guard<std::mutex> guard(cacheMutex);
46
+ currentObserver = observer;
47
+ currentPointerObserver = pointerObserver;
48
+ }
49
+ if (currentPointerObserver) {
50
+ currentPointerObserver(phase, touching, x, y, 0);
51
+ } else if (currentObserver) {
52
+ currentObserver(phase, touching, x, y);
53
+ }
42
54
  }
43
55
 
44
- void update(Phase phase, bool touching, int x, int y)
45
- {
56
+ void update(Phase phase, bool touching, int x, int y) {
57
+ {
58
+ const std::lock_guard<std::mutex> guard(cacheMutex);
46
59
  pressed = touching;
47
60
  cachedX = x;
48
61
  cachedY = y;
49
62
  latestX = x;
50
63
  latestY = y;
51
64
  if (phase == Phase::Move) {
52
- if (moveQueued) return;
53
- moveQueued = true;
65
+ if (moveQueued) {
66
+ return;
67
+ }
68
+ moveQueued = true;
54
69
  }
55
- notify(phase, touching, x, y);
70
+ }
71
+ // The observer may consume a dropped/coalesced Move immediately.
72
+ notify(phase, touching, x, y);
56
73
  }
57
74
 
58
- } // namespace
75
+ } // namespace
59
76
 
60
77
  namespace gea::platform::touch {
61
78
 
62
- void Touchscreen::setObserver(Observer next) { observer = next; }
63
- void Touchscreen::setPointerObserver(PointerObserver next) { pointerObserver = next; }
64
-
65
- bool Touchscreen::init()
66
- {
67
- if (device) return true;
68
- board::resetTouchPanel();
69
- const auto bus = i2c::Bus::primary();
70
- if (!bus.available()) return false;
71
- i2c_device_config_t config = {};
72
- config.dev_addr_length = I2C_ADDR_BIT_LEN_7;
73
- config.device_address = 0x15;
74
- config.scl_speed_hz = 100000;
75
- const auto handle = static_cast<i2c_master_bus_handle_t>(bus.nativeHandle());
76
- esp_err_t err = i2c_master_probe(handle, config.device_address, 100);
77
- if (err == ESP_OK) err = i2c_master_bus_add_device(handle, &config, &device);
78
- if (err != ESP_OK) {
79
- ESP_LOGE(kTag, "CST820 not found: %s", esp_err_to_name(err));
80
- return false;
81
- }
82
- gpio_config_t interrupt = {};
83
- interrupt.pin_bit_mask = 1ULL << board::touch.interrupt;
84
- interrupt.mode = GPIO_MODE_INPUT;
85
- interrupt.pull_up_en = GPIO_PULLUP_ENABLE;
86
- interrupt.intr_type = GPIO_INTR_NEGEDGE;
87
- ESP_ERROR_CHECK(gpio_config(&interrupt));
88
- err = gpio_install_isr_service(0);
89
- if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) ESP_ERROR_CHECK(err);
90
- ESP_ERROR_CHECK(gpio_isr_handler_add(board::touch.interrupt, touchInterrupt, nullptr));
91
- reportPending.store(true, std::memory_order_relaxed);
92
- ESP_LOGI(kTag, "touch ready (address=0x15, INT=GPIO%d)", board::touch.interrupt);
79
+ void Touchscreen::setObserver(Observer next) {
80
+ const std::lock_guard<std::mutex> guard(cacheMutex);
81
+ observer = next;
82
+ }
83
+
84
+ void Touchscreen::setPointerObserver(PointerObserver next) {
85
+ const std::lock_guard<std::mutex> guard(cacheMutex);
86
+ pointerObserver = next;
87
+ }
88
+
89
+ bool Touchscreen::init() {
90
+ board::startButtons();
91
+ if (device) {
93
92
  return true;
93
+ }
94
+ board::resetTouchPanel();
95
+ const auto bus = i2c::Bus::primary();
96
+ if (!bus.available()) {
97
+ return false;
98
+ }
99
+ i2c_device_config_t config = {};
100
+ config.dev_addr_length = I2C_ADDR_BIT_LEN_7;
101
+ config.device_address = 0x15;
102
+ config.scl_speed_hz = 100000;
103
+ const auto handle = static_cast<i2c_master_bus_handle_t>(bus.nativeHandle());
104
+ esp_err_t err = i2c_master_probe(handle, config.device_address, 100);
105
+ if (err == ESP_OK) {
106
+ err = i2c_master_bus_add_device(handle, &config, &device);
107
+ }
108
+ if (err != ESP_OK) {
109
+ ESP_LOGE(kTag, "CST820 not found: %s", esp_err_to_name(err));
110
+ return false;
111
+ }
112
+ gpio_config_t interrupt = {};
113
+ interrupt.pin_bit_mask = 1ULL << board::touch.interrupt;
114
+ interrupt.mode = GPIO_MODE_INPUT;
115
+ interrupt.pull_up_en = GPIO_PULLUP_ENABLE;
116
+ interrupt.intr_type = GPIO_INTR_NEGEDGE;
117
+ ESP_ERROR_CHECK(gpio_config(&interrupt));
118
+ err = gpio_install_isr_service(0);
119
+ if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) {
120
+ ESP_ERROR_CHECK(err);
121
+ }
122
+ ESP_ERROR_CHECK(gpio_isr_handler_add(board::touch.interrupt, touchInterrupt, nullptr));
123
+ reportPending.store(true, std::memory_order_relaxed);
124
+ ESP_LOGI(kTag, "touch ready (address=0x15, INT=GPIO%d)", board::touch.interrupt);
125
+ return true;
94
126
  }
95
127
 
96
- void Touchscreen::poll(int nowMs)
97
- {
98
- if (!device) return;
99
- const auto now = static_cast<std::uint32_t>(nowMs);
100
- if (now - lastPoll < 10) return;
101
- // Avoid waking the controller or blocking animation when it has no report.
102
- // While held, poll too so a lost release interrupt cannot stick the pointer.
103
- const bool pending = reportPending.exchange(false, std::memory_order_relaxed);
104
- if (!pressed && !pending && gpio_get_level(board::touch.interrupt) != 0) return;
105
- lastPoll = now;
106
- const std::uint8_t reg = 0x00;
107
- std::uint8_t report[7] = {};
108
- if (i2c_master_transmit_receive(device, &reg, 1, report, sizeof(report), 10) != ESP_OK) {
109
- // The controller sleeps after idle. A missed final report followed by
110
- // NACKs must not leave a finger permanently held in the runtime.
111
- if (pressed && now - lastReport >= 60) update(Phase::Up, false, cachedX, cachedY);
112
- return;
128
+ void Touchscreen::poll(int nowMs) {
129
+ if (injectedGestureActive.load(std::memory_order_acquire) || !device) {
130
+ return;
131
+ }
132
+ // Serialize a poll already in progress with the control task's injected
133
+ // Down. During its gesture, leave the hardware IRQ latch untouched.
134
+ const std::lock_guard<std::mutex> guard(streamMutex);
135
+ if (injectedGestureActive.load(std::memory_order_acquire)) {
136
+ return;
137
+ }
138
+ const auto now = static_cast<std::uint32_t>(nowMs);
139
+ if (now - lastPoll < 10) {
140
+ return;
141
+ }
142
+ // Avoid waking the controller or blocking animation when it has no report.
143
+ // While held, poll too so a lost release interrupt cannot stick the pointer.
144
+ const bool pending = reportPending.exchange(false, std::memory_order_relaxed);
145
+ if (!pressed && !pending && gpio_get_level(board::touch.interrupt) != 0) {
146
+ return;
147
+ }
148
+ lastPoll = now;
149
+ const std::uint8_t reg = 0x00;
150
+ std::uint8_t report[7] = {};
151
+ if (i2c_master_transmit_receive(device, &reg, 1, report, sizeof(report), 10) != ESP_OK) {
152
+ // The controller sleeps after idle. A missed final report followed by
153
+ // NACKs must not leave a finger permanently held in the runtime.
154
+ if (pressed && now - lastReport >= 60) {
155
+ update(Phase::Up, false, cachedX, cachedY);
113
156
  }
114
- lastReport = now;
115
- // The CST820 report is not the CST92xx protocol. Decode the factory
116
- // firmware's seven-byte report, including its explicit lift event.
117
- const unsigned event = report[3] >> 6;
118
- const bool touching = (report[2] & 0x0F) != 0 && (event == 0 || event == 2);
119
- if (!touching) {
120
- if (pressed) update(Phase::Up, false, cachedX, cachedY);
121
- return;
157
+ return;
158
+ }
159
+ lastReport = now;
160
+ // The CST820 report is not the CST92xx protocol. Decode the factory
161
+ // firmware's seven-byte report, including its explicit lift event.
162
+ const unsigned event = report[3] >> 6;
163
+ const bool touching = (report[2] & 0x0F) != 0 && (event == 0 || event == 2);
164
+ if (!touching) {
165
+ if (pressed) {
166
+ update(Phase::Up, false, cachedX, cachedY);
122
167
  }
123
- const int x = std::clamp(((report[3] & 0x0F) << 8) | report[4], 0, display::kWidth - 1);
124
- const int y = std::clamp(((report[5] & 0x0F) << 8) | report[6], 0, display::kHeight - 1);
125
- if (!pressed) update(Phase::Down, true, x, y);
126
- else if (x != cachedX || y != cachedY) update(Phase::Move, true, x, y);
168
+ return;
169
+ }
170
+ const int x = std::clamp(((report[3] & 0x0F) << 8) | report[4], 0, display::kWidth - 1);
171
+ const int y = std::clamp(((report[5] & 0x0F) << 8) | report[6], 0, display::kHeight - 1);
172
+ if (!pressed) {
173
+ update(Phase::Down, true, x, y);
174
+ } else if (x != cachedX || y != cachedY) {
175
+ update(Phase::Move, true, x, y);
176
+ }
177
+ }
178
+
179
+ int Touchscreen::read(int* x, int* y) {
180
+ return readCached(x, y);
127
181
  }
128
182
 
129
- int Touchscreen::read(int *x, int *y) { return readCached(x, y); }
130
- int Touchscreen::readCached(int *x, int *y)
131
- {
132
- if (x) *x = cachedX;
133
- if (y) *y = cachedY;
134
- return pressed ? 1 : 0;
183
+ int Touchscreen::readCached(int* x, int* y) {
184
+ const std::lock_guard<std::mutex> guard(cacheMutex);
185
+ if (x) {
186
+ *x = cachedX;
187
+ }
188
+ if (y) {
189
+ *y = cachedY;
190
+ }
191
+ return pressed ? 1 : 0;
135
192
  }
136
- void Touchscreen::consumeLatestMove(int *x, int *y)
137
- {
138
- moveQueued = false;
139
- if (x) *x = latestX;
140
- if (y) *y = latestY;
193
+
194
+ void Touchscreen::consumeLatestMove(int* x, int* y) {
195
+ const std::lock_guard<std::mutex> guard(cacheMutex);
196
+ moveQueued = false;
197
+ if (x) {
198
+ *x = latestX;
199
+ }
200
+ if (y) {
201
+ *y = latestY;
202
+ }
141
203
  }
142
- void Touchscreen::injectEvent(Phase phase, bool touching, int x, int y)
143
- {
144
- update(phase, touching, x, y);
204
+
205
+ void Touchscreen::injectEvent(Phase phase, bool touching, int x, int y) {
206
+ const std::lock_guard<std::mutex> guard(streamMutex);
207
+ if (phase == Phase::Down) {
208
+ injectedGestureActive.store(true, std::memory_order_release);
209
+ }
210
+ update(phase, touching, x, y);
211
+ if (phase == Phase::Up) {
212
+ // Publish the Up before letting hardware reports resume the stream.
213
+ injectedGestureActive.store(false, std::memory_order_release);
214
+ }
145
215
  }
146
216
 
147
- } // namespace gea::platform::touch
217
+ } // namespace gea::platform::touch
@@ -31,3 +31,16 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3
31
31
  CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
32
32
  CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
33
33
  CONFIG_HEAP_TRACING_OFF=y
34
+
35
+ # Shared network runtime: DTLS/SRTP and device certificate generation.
36
+ CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
37
+ CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
38
+ CONFIG_MBEDTLS_SSL_DTLS_HELLO_VERIFY=y
39
+ CONFIG_MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE=y
40
+ CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
41
+ CONFIG_MBEDTLS_X509_CREATE_C=y
42
+ CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
43
+ CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
44
+
45
+ # Native audio/worklet thread-local cleanup needs more than IDF's 1536-byte idle stack.
46
+ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=3072
@@ -311,6 +311,15 @@ set(GEATSC_COMPILE_OPTIONS
311
311
  # ESP32-S31 Mosaico) has no such option and gcc refuses the whole archive.
312
312
  ${GEA_XTENSA_LITERALS}
313
313
  )
314
+ # RISC-V (the S31 Mosaico): binutils' relaxation deletes bytes symbol by symbol,
315
+ # and while any `-Wl,--wrap` is active (the board wraps gpio/panic/usb calls)
316
+ # each deletion rescans every earlier global of the object -- quadratic in an
317
+ # object's globals. The generated archive's objects carry up to ~16k globals and
318
+ # 2 MB of text, which made the final link take ~27 minutes against 7 seconds
319
+ # without relaxation. Not relaxing the generated code costs ~3% of its size.
320
+ if(CONFIG_IDF_TARGET_ARCH_RISCV)
321
+ list(APPEND GEATSC_COMPILE_OPTIONS -mno-relax)
322
+ endif()
314
323
  set(GEATSC_COMPILE_DEFINITIONS "")
315
324
  if(NOT CMAKE_SCRIPT_MODE_FILE)
316
325
  # RTC contains the decode/conversion workers, not generated app templates.
@@ -429,9 +438,15 @@ else()
429
438
  )
430
439
  endif()
431
440
 
432
- # rtc_esp.cpp is the WebRTC peer and pulls esp_peer/libsrtp in through
433
- # esp_peer.h; only an app that can reach a network has a peer to talk to.
434
- if(GEA_EMBEDDED_CAPABILITY_NETWORK)
441
+ # RTC is independently excludable for apps that only need HTTP/Wi-Fi.
442
+ set(_GEA_BOARD_RTC_ENABLED 1)
443
+ if(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_RTC}
444
+ AND NOT "$ENV{GEA_EMBEDDED_CAPABILITY_RTC}" STREQUAL "")
445
+ set(_GEA_BOARD_RTC_ENABLED "$ENV{GEA_EMBEDDED_CAPABILITY_RTC}")
446
+ elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_RTC})
447
+ set(_GEA_BOARD_RTC_ENABLED "$CACHE{GEA_EMBEDDED_CAPABILITY_RTC}")
448
+ endif()
449
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK AND _GEA_BOARD_RTC_ENABLED)
435
450
  set(GEA_BOARD_NETWORK_SOURCES "${GEA_HOST}/host/rtc_esp.cpp")
436
451
  else()
437
452
  set(GEA_BOARD_NETWORK_SOURCES "")
@@ -645,6 +660,17 @@ file(GLOB_RECURSE _GEATSC_DIST_SRCS CONFIGURE_DEPENDS
645
660
  "${GEA_COMPILER}/dist/targets/cpp/runtime/*.cpp"
646
661
  "${GEA_PLUGIN}/dist/*.js"
647
662
  )
663
+ # GEA_GEATSC_REUSE_GENERATED=1 keeps the C++ geatsc already wrote (and the
664
+ # runtime header copied beside it) instead of re-running geatsc: it re-runs on
665
+ # any compiler source change, so a board build otherwise follows every
666
+ # in-flight compiler edit -- including ones that do not compile this app yet.
667
+ if(DEFINED ENV{GEA_GEATSC_REUSE_GENERATED} AND "$ENV{GEA_GEATSC_REUSE_GENERATED}" STREQUAL "1" AND EXISTS "${GEATSC_SOURCE_LIST}")
668
+ message(STATUS "geatsc: reusing the generated sources in ${GENERATED_APP_DIR}")
669
+ add_custom_command(
670
+ OUTPUT ${_GEATSC_BUILD_STAMP}
671
+ COMMAND ${CMAKE_COMMAND} -E touch ${_GEATSC_BUILD_STAMP}
672
+ )
673
+ else()
648
674
  add_custom_command(
649
675
  OUTPUT ${_GEATSC_BUILD_STAMP}
650
676
  COMMAND node ${_GEA_VITE_GEATSC_SCRIPT}
@@ -687,6 +713,7 @@ add_custom_command(
687
713
  COMMENT "Compiling ${GEA_EMBEDDED_APP}: TSX -> JS via vite-plugin-gea -> C++ via geatsc"
688
714
  VERBATIM
689
715
  )
716
+ endif()
690
717
  add_custom_target(geatsc_build ALL DEPENDS ${_GEATSC_BUILD_STAMP})
691
718
  gea_geatsc_add_generated_archive(
692
719
  TARGET ${COMPONENT_LIB}
@@ -6,7 +6,7 @@ dependencies:
6
6
  require: private
7
7
  version: '>=5.0'
8
8
  source:
9
- registry_url: https://components.espressif.com
9
+ registry_url: https://components.espressif.com/
10
10
  type: service
11
11
  version: 1.7.19~2
12
12
  espressif/cmake_utilities:
@@ -19,106 +19,6 @@ dependencies:
19
19
  registry_url: https://components.espressif.com
20
20
  type: service
21
21
  version: 0.5.3
22
- espressif/dl_fft:
23
- component_hash: 965be7152132b365061abf5fc5fc7b85e525f73b94a204cdda61cfe9572c0d77
24
- dependencies:
25
- - name: idf
26
- require: private
27
- version: '>=5.0'
28
- source:
29
- registry_url: https://components.espressif.com
30
- type: service
31
- version: 0.8.0
32
- espressif/esp-dl:
33
- component_hash: 3148b2692a2943d7e35401dc10a181b6ba83515ec70ef51499ac5d2593eef3e2
34
- dependencies:
35
- - name: espressif/dl_fft
36
- registry_url: https://components.espressif.com
37
- require: private
38
- version: '>=0.8.0'
39
- - name: espressif/esp_new_jpeg
40
- registry_url: https://components.espressif.com
41
- require: private
42
- version: ^1
43
- - name: idf
44
- require: private
45
- version: '*'
46
- source:
47
- registry_url: https://components.espressif.com
48
- type: service
49
- targets:
50
- - esp32
51
- - esp32c2
52
- - esp32c3
53
- - esp32c5
54
- - esp32c6
55
- - esp32p4
56
- - esp32s2
57
- - esp32s3
58
- - esp32s31
59
- version: 3.3.13
60
- espressif/esp-sr:
61
- component_hash: 698154c0a94f6c8ac3e1ac669ec3ea741e6f848022b0f89030eddb23f3a31e14
62
- dependencies:
63
- - name: espressif/cjson
64
- registry_url: https://components.espressif.com
65
- require: private
66
- version: ^1.7.19
67
- - name: espressif/dl_fft
68
- registry_url: https://components.espressif.com
69
- require: private
70
- version: '>=0.6.0'
71
- - name: espressif/esp-dl
72
- registry_url: https://components.espressif.com
73
- require: private
74
- version: ~3.3.12
75
- - name: espressif/esp-dsp
76
- registry_url: https://components.espressif.com
77
- require: private
78
- rules:
79
- - if: target in [esp32, esp32s2, esp32c3, esp32c5, esp32c6]
80
- version: 1.8.0
81
- - name: idf
82
- require: private
83
- version: '>=5.0'
84
- source:
85
- registry_url: https://components.espressif.com/
86
- type: service
87
- version: 2.5.5
88
- espressif/esp_audio_codec:
89
- component_hash: a5b9275af74247e3ce536d16a7080e4d77207a185b63e1bea368eb4d57176c2b
90
- dependencies:
91
- - name: idf
92
- require: private
93
- version: '>=4.4'
94
- source:
95
- registry_url: https://components.espressif.com/
96
- type: service
97
- version: 2.6.2
98
- espressif/esp_codec_dev:
99
- component_hash: 4779f31a3ba3f9b38aee1afe6ccb9ba8f6108dc3a6e77d39d7d714e9a215371b
100
- dependencies:
101
- - name: idf
102
- require: private
103
- version: '>=4.0'
104
- source:
105
- registry_url: https://components.espressif.com/
106
- type: service
107
- version: 1.6.2
108
- espressif/esp_h264:
109
- component_hash: 3d60078419ceac61cd87579664ae6a5a9b9a42d6f2edf4e23d753af8d2a67da9
110
- dependencies:
111
- - name: idf
112
- require: private
113
- version: '>=4.4'
114
- source:
115
- registry_url: https://components.espressif.com/
116
- type: service
117
- targets:
118
- - esp32s3
119
- - esp32s31
120
- - esp32p4
121
- version: 1.4.1
122
22
  espressif/esp_io_expander:
123
23
  component_hash: 7b7f91270172e46ca4597e3874f48d8412e280e8c295559f5922ec38656e3e5f
124
24
  dependencies:
@@ -161,68 +61,30 @@ dependencies:
161
61
  registry_url: https://components.espressif.com/
162
62
  type: service
163
63
  version: 1.0.1~1
164
- espressif/esp_libsrtp:
165
- component_hash: 131560184c73ec09f77d8904a2db709307803f0f9f111898921b6966776eac15
166
- dependencies: []
167
- source:
168
- registry_url: https://components.espressif.com
169
- type: service
170
- version: 1.0.0
171
- espressif/esp_new_jpeg:
172
- component_hash: e1e7e6991193c41ed6c9fc386702aa7821433319e7aa9c3147cd3236310cd69c
173
- dependencies: []
174
- source:
175
- registry_url: https://components.espressif.com/
176
- type: service
177
- targets:
178
- - esp32
179
- - esp32s2
180
- - esp32s3
181
- - esp32s31
182
- - esp32p4
183
- - esp32c2
184
- - esp32c3
185
- - esp32c5
186
- - esp32c6
187
- - esp32c61
188
- - esp32h4
189
- version: 1.0.2
190
- espressif/esp_peer:
191
- component_hash: 97aac8b5a27e3901ca5c415a3b9ac083209e02b942af1f5911a754319331e0ca
64
+ espressif/esp_lcd_sh8601:
65
+ component_hash: 18245cd23204eefb67f61b362405f78364fa13b13cdedda5f7546d89701c506b
192
66
  dependencies:
193
- - name: espressif/esp_libsrtp
67
+ - name: espressif/cmake_utilities
194
68
  registry_url: https://components.espressif.com
195
69
  require: private
196
- version: ^1.0.0
197
- source:
198
- registry_url: https://components.espressif.com/
199
- type: service
200
- version: 1.5.5
201
- espressif/esp_websocket_client:
202
- component_hash: dc00233af846f3a744ada283a300e0d586040aadc3ee67361645ecdce4523672
203
- dependencies:
70
+ version: 0.*
204
71
  - name: idf
205
72
  require: private
206
- version: '>=5.0'
73
+ version: '>=5.3'
207
74
  source:
208
75
  registry_url: https://components.espressif.com/
209
76
  type: service
210
- version: 1.8.0
77
+ version: 2.0.1~1
211
78
  idf:
212
79
  source:
213
80
  type: idf
214
81
  version: 6.0.2
215
82
  direct_dependencies:
216
- - espressif/esp-sr
217
- - espressif/esp_audio_codec
218
- - espressif/esp_codec_dev
219
- - espressif/esp_h264
83
+ - espressif/cjson
220
84
  - espressif/esp_lcd_co5300
221
85
  - espressif/esp_lcd_panel_io_additions
222
- - espressif/esp_new_jpeg
223
- - espressif/esp_peer
224
- - espressif/esp_websocket_client
86
+ - espressif/esp_lcd_sh8601
225
87
  - idf
226
- manifest_hash: 0dc57984fca8a1c7d21cd93f23e3f0722d046fd111c214224bcb9fed7be4746f
88
+ manifest_hash: bf7fec51668e63dfcd2244456e1c0b928f5bd1ef4c46f9bb547535aad1d8290c
227
89
  target: esp32s3
228
90
  version: 3.0.0
@@ -7,4 +7,12 @@ set(PROJECT_VER "${GEA_EMBEDDED_APP}" CACHE STRING "Firmware app id" FORCE)
7
7
 
8
8
  include($ENV{IDF_PATH}/tools/cmake/project.cmake)
9
9
  idf_build_set_property(MINIMAL_BUILD ON)
10
+ # Camera component patches use git apply --no-index against PROJECT_DIR.
11
+ # Inside a consumer Git checkout, discovery of its enclosing repository makes
12
+ # Git silently skip those project-relative paths and report success. Stop
13
+ # discovery at this target's parent while the SDK components configure.
14
+ set(GEA_CAMERA_PREVIOUS_GIT_CEILING "$ENV{GIT_CEILING_DIRECTORIES}")
15
+ get_filename_component(GEA_CAMERA_GIT_CEILING "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
16
+ set(ENV{GIT_CEILING_DIRECTORIES} "${GEA_CAMERA_GIT_CEILING}")
10
17
  project(gea_embedded)
18
+ set(ENV{GIT_CEILING_DIRECTORIES} "${GEA_CAMERA_PREVIOUS_GIT_CEILING}")
@@ -61,5 +61,57 @@ before display init touches the panel.
61
61
  The panel's TE line is wired on GPIO43, so apps that ask for vsync
62
62
  (`Display.setVSync(true)`) render locked to the panel's ~60 Hz refresh.
63
63
 
64
- Not yet wired: the BQ27220 fuel gauge (the board reports no battery reading),
65
- the magnetometers and the SPI NAND.
64
+ The 128 MB SPI NAND provides file storage at `/nand`, using FAT with Dhara
65
+ wear levelling. `main/nand_mount.cpp` installs the storage provider; file
66
+ operations mount it as needed, and a blank chip is formatted on first mount.
67
+ Assets can be uploaded with `gea devctl push <file> /nand/...`.
68
+
69
+ Not yet wired: the BQ27220 fuel gauge (the board reports no battery reading)
70
+ and the BMM150 magnetometers.
71
+
72
+ ## Camera module
73
+
74
+ The optional camera plugs into the **left expansion slot**. The official
75
+ `mosaico_module_camera` driver detects the included SC101IOT module and the
76
+ older OV3640 module. Gea downloads its pinned BSP dependencies only for apps
77
+ whose compiler analysis reaches the `Camera` binding. The BSP owns the separate
78
+ expansion I2C1 bus on GPIO0/1; Gea continues to own the onboard I2C0 bus, panel,
79
+ touch and audio. The Type-C USB-OTG console works while DVP capture is active.
80
+
81
+ `Camera.open()` starts continuous UYVY capture on a native worker. The worker
82
+ returns each borrowed camera buffer immediately after downsampling, and JPEG
83
+ encoding runs at most once every two seconds. `Camera.captureFrame()` consumes
84
+ the newest JPEG data URL without waiting; it returns an empty string when no
85
+ fresh image is ready. There is one pending image, so a disconnected consumer
86
+ cannot accumulate frames.
87
+
88
+ Images are rotated counter-clockwise by 90 degrees to correct the module's
89
+ mounting orientation, then fit inside **320 × 240 pixels** at JPEG quality 70.
90
+ The encoder uses whole 16-pixel blocks: the SC101IOT's 1280 × 720 default becomes
91
+ an upright **128 × 240** image; the OV3640's 1024 × 768 default becomes
92
+ **176 × 240**. Encoded images are capped at 96 KiB before base64 encoding.
93
+ Local preview and still captures retain the sensor's original capture aspect
94
+ ratio at 160 pixels wide (160 × 90 on SC101IOT, 160 × 120 on OV3640), without
95
+ the upload's portrait rotation or JPEG block alignment. `Camera.orientation`
96
+ reports the configured 180° mounting; preview pixels are already corrected for it.
97
+ The module has no hinge-angle sensor, so this value does not detect folding
98
+ between front-facing and rear-facing positions.
99
+ Preview uses nearest-neighbor pixel sampling, with no averaging filter. A visible native
100
+ `<camera fit="contain">` preview refreshes up to ten times per second;
101
+ JPEG uploads remain limited to one every two seconds. Video recording,
102
+ zoom and manual sensor tuning are not implemented by this backend.
103
+
104
+ `Camera.close()` stops the worker, releases the module lease and capture
105
+ buffers, deletes the JPEG encoder and clears the pending image. Sensor reads
106
+ retain the SDK's 1000 ms timeout, including the first frames discarded during
107
+ stream startup, and encoding times out after 500 ms. The worker join waits at most 2000 ms;
108
+ if the SDK stalls during shutdown, it logs the failure and retains the live resources so that a
109
+ later close/open can safely retry.
110
+ After three consecutive capture timeouts, the capture worker calls the SDK's
111
+ stream restart with no borrowed frames to recover a stalled DVP queue.
112
+
113
+ The pinned official camera component applies its ESP-IDF DVP and SC101IOT
114
+ stability patches during configuration. The target scopes Git discovery to
115
+ prevent an enclosing consumer repository from silently skipping the sensor patch.
116
+ Check configuration output for patch
117
+ warnings: a failed patch application means those workarounds are absent.