@geastack/targets 0.1.102 → 0.1.104

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 (79) hide show
  1. package/README.md +7 -0
  2. package/package.json +6 -6
  3. package/targets/cmake/geatsc-generated-archive-build.mjs +41 -12
  4. package/targets/esp32/app_project.cmake +23 -27
  5. package/targets/esp32/chip_bindings/magnetometer/bmm150.cpp +140 -0
  6. package/targets/esp32/chip_bindings/touch/cst9217.cpp +27 -3
  7. package/targets/esp32/chip_bindings/touch/cst9217_controller.h +11 -2
  8. package/targets/esp32/components/gea_framework/CMakeLists.txt +10 -5
  9. package/targets/esp32/components/gea_framework/project_include.cmake +22 -0
  10. package/targets/esp32/esp_now.cpp +298 -0
  11. package/targets/esp32/esp_now_power.h +17 -0
  12. package/targets/esp32/esp_now_rate.h +57 -0
  13. package/targets/esp32/esp_now_tx_header.h +46 -0
  14. package/targets/esp32/gea_framework.cmake +2 -0
  15. package/targets/esp32/ldfragments/gea_ui_state_external.lf +11 -0
  16. package/targets/esp32/services/device_control.cpp +29 -11
  17. package/targets/esp32/services/frame_scheduler.cpp +7 -0
  18. package/targets/esp32/uart.cpp +144 -0
  19. package/targets/esp32-m5stack-m5paper/CMakeLists.txt +1 -0
  20. package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -4
  21. package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +1 -0
  22. package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +4 -0
  23. package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +9 -6
  24. package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +1 -0
  25. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +4 -0
  26. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +21 -5
  27. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +8 -5
  28. package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +1 -0
  29. package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +4 -0
  30. package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +16 -5
  31. package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +8 -5
  32. package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +1 -0
  33. package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +3 -3
  34. package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -2
  35. package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +1 -0
  36. package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +9 -9
  37. package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -4
  38. package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +1 -0
  39. package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -4
  40. package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +1 -0
  41. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -1
  42. package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +1 -0
  43. package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +7 -4
  44. package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +1 -0
  45. package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +2 -1
  46. package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +6 -3
  47. package/targets/esp32-s3-m5stack-stopwatch/CMakeLists.txt +1 -0
  48. package/targets/esp32-s3-m5stack-stopwatch/main/gea-dependencies.json +42 -0
  49. package/targets/esp32-s3-m5stack-stopwatch/main/idf_component.yml +4 -18
  50. package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +1 -0
  51. package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +8 -5
  52. package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +1 -0
  53. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +9 -4
  54. package/targets/esp32-s3-touch-amoled-1.8/main/gea-dependencies.json +26 -0
  55. package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +6 -18
  56. package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +1 -0
  57. package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +11 -10
  58. package/targets/esp32-s3-touch-amoled-2.06/main/gea-dependencies.json +58 -0
  59. package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +4 -42
  60. package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +1 -0
  61. package/targets/esp32-s3-touch-amoled-2.41/main/gea-dependencies.json +42 -0
  62. package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +5 -30
  63. package/targets/esp32-s3-touch-lcd-1.54/CMakeLists.txt +1 -0
  64. package/targets/esp32-s3-touch-lcd-1.54/main/idf_component.yml +8 -5
  65. package/targets/esp32-s3-touch-lcd-3.5b/CMakeLists.txt +1 -0
  66. package/targets/esp32-s3-touch-lcd-3.5b/main/gea-dependencies.json +26 -0
  67. package/targets/esp32-s3-touch-lcd-3.5b/main/idf_component.yml +4 -20
  68. package/targets/esp32-s31-espressif-mosaico/CMakeLists.txt +1 -0
  69. package/targets/esp32-s31-espressif-mosaico/README.md +10 -2
  70. package/targets/esp32-s31-espressif-mosaico/dependencies.lock +7 -334
  71. package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +9 -1
  72. package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +13 -1
  73. package/targets/esp32-s31-espressif-mosaico/main/gea-dependencies.json +52 -0
  74. package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +13 -40
  75. package/targets/esp32-s31-espressif-mosaico/main/include/board.h +6 -0
  76. package/targets/esp32-s31-espressif-mosaico/main/include/mosaico_peer_uart_pins.h +68 -0
  77. package/targets/esp32-s31-espressif-mosaico/main/peer_uart.cpp +28 -72
  78. package/targets/esp32-s31-espressif-mosaico/partitions.csv +1 -1
  79. package/targets/esp32-s3-m5stack-stopwatch/.clang-format +0 -10
@@ -1,86 +1,42 @@
1
- #include "driver/gpio.h"
2
- #include "driver/uart.h"
3
- #include "esp_err.h"
4
- #include "freertos/FreeRTOS.h"
5
1
  #include "mosaico_peer_uart.h"
6
- #include <array>
7
- namespace {
8
- // Digital side-header link profile. H1 pin 12 -> H2 pin 12 is right TX
9
- // -> left RX; H1 pin 11 <- H2 pin 11 is right RX <- left TX. Connect only
10
- // these signal contacts plus GND; this does not join output power rails.
11
- struct Pins {
12
- uart_port_t uart;
13
- int tx, rx;
14
- };
15
- constexpr std::array<Pins, 2> pins{{{UART_NUM_1, 15, 4}, {UART_NUM_2, 5, 38}}};
16
- bool opened = false;
17
- } // namespace
18
- extern "C" bool gea_mosaico_peer_uart_open(uint32_t baud) {
2
+ #include "mosaico_peer_uart_pins.h"
3
+ #include "platform/uart.h"
4
+
5
+ namespace peer = gea::platform::board::peer;
6
+ using gea::platform::uart::Uart;
7
+
8
+ extern "C" bool gea_board_uart_pin_allowed(int pin) {
19
9
  #if GEA_MOSAICO_CAMERA_ENABLED
20
- // Camera expansion owns these side GPIOs when that capability is enabled.
21
10
  return false;
11
+ #else
12
+ return peer::isExpansionGpio(pin);
22
13
  #endif
23
- if (opened)
24
- return true;
14
+ }
15
+
16
+ // Compatibility for native apps using the original side-link entry points.
17
+ // New applications configure controllers through the public Uart API.
18
+ extern "C" bool gea_mosaico_peer_uart_open(uint32_t baud) {
25
19
  if (baud < 115200 || baud > 5000000)
26
20
  return false;
27
- // Never steal a UART already claimed by another board capability.
28
- for (const auto &p : pins)
29
- if (uart_is_driver_installed(p.uart))
30
- return false;
31
- unsigned installed = 0;
32
- for (const auto &p : pins) {
33
- uart_config_t config{};
34
- config.baud_rate = baud;
35
- config.data_bits = UART_DATA_8_BITS;
36
- config.parity = UART_PARITY_DISABLE;
37
- config.stop_bits = UART_STOP_BITS_1;
38
- config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
39
- config.source_clk = UART_SCLK_DEFAULT;
40
- // RX driver storage and TX ring are reserved once, off the audio path.
41
- if (uart_param_config(p.uart, &config) != ESP_OK ||
42
- uart_set_pin(p.uart, p.tx, p.rx, UART_PIN_NO_CHANGE,
43
- UART_PIN_NO_CHANGE) != ESP_OK ||
44
- uart_driver_install(p.uart, 4096, 4096, 0, nullptr, 0) != ESP_OK) {
45
- for (unsigned i = 0; i < installed; ++i)
46
- uart_driver_delete(pins[i].uart);
47
- for (const auto &reset : pins) {
48
- gpio_reset_pin(static_cast<gpio_num_t>(reset.tx));
49
- gpio_reset_pin(static_cast<gpio_num_t>(reset.rx));
50
- }
51
- return false;
52
- }
53
- ++installed;
54
- uart_set_rx_full_threshold(p.uart, 96);
55
- uart_set_rx_timeout(p.uart, 2);
56
- }
57
- opened = true;
58
- return true;
21
+ const bool leftWasOpen = Uart::isOpen(1);
22
+ if (!Uart::open(1, {peer::left.tx, peer::left.rx, static_cast<int>(baud)}))
23
+ return false;
24
+ if (Uart::open(2, {peer::right.tx, peer::right.rx, static_cast<int>(baud)}))
25
+ return true;
26
+ if (!leftWasOpen)
27
+ Uart::close(1);
28
+ return false;
59
29
  }
60
- extern "C" void gea_mosaico_peer_uart_close(void) {
61
- if (!opened)
62
- return;
63
- for (const auto &p : pins) {
64
- uart_driver_delete(p.uart);
65
- gpio_reset_pin(static_cast<gpio_num_t>(p.tx));
66
- gpio_reset_pin(static_cast<gpio_num_t>(p.rx));
67
- }
68
- opened = false;
30
+ extern "C" void gea_mosaico_peer_uart_close() {
31
+ Uart::close(1);
32
+ Uart::close(2);
69
33
  }
70
34
  extern "C" int gea_mosaico_peer_uart_read(unsigned side, void *bytes,
71
35
  size_t capacity) {
72
- if (!opened || side >= pins.size() || !bytes || !capacity)
73
- return -1;
74
- return uart_read_bytes(pins[side].uart, bytes, capacity, 0);
36
+ return side < 2 ? Uart::read(static_cast<int>(side) + 1, bytes, capacity)
37
+ : -1;
75
38
  }
76
39
  extern "C" int gea_mosaico_peer_uart_write(unsigned side, const void *bytes,
77
40
  size_t length) {
78
- if (!opened || side >= pins.size() || !bytes || !length)
79
- return -1;
80
- // The transport task owns this call. DSP only pushes its preallocated queue.
81
- size_t free = 0;
82
- if (uart_get_tx_buffer_free_size(pins[side].uart, &free) != ESP_OK ||
83
- free < length + 32)
84
- return 0;
85
- return uart_write_bytes(pins[side].uart, bytes, length);
41
+ return side < 2 ? Uart::write(static_cast<int>(side) + 1, bytes, length) : -1;
86
42
  }
@@ -3,7 +3,7 @@
3
3
  # leaves it 24 KB below the partition table at 0x8000.
4
4
  # The app slots take all but 256 KB of storage: an app is installed over USB
5
5
  # into a slot, so the slot is the largest app the board can run, and three.js
6
- # games (skytail) outgrew 7 MB. A board still on the old 7 MB layout rewrites
6
+ # games outgrew 7 MB. A board still on the old 7 MB layout rewrites
7
7
  # its table to this one on boot (board_power.cpp, migratePartitionTable).
8
8
  # Name, Type, SubType, Offset, Size
9
9
  nvs, data, nvs, 0x9000, 0x6000
@@ -1,10 +0,0 @@
1
- BasedOnStyle: LLVM
2
- IndentWidth: 2
3
- ColumnLimit: 100
4
- PointerAlignment: Left
5
- SeparateDefinitionBlocks: Always
6
- AllowShortFunctionsOnASingleLine: None
7
- AllowShortIfStatementsOnASingleLine: Never
8
- AllowShortLoopsOnASingleLine: false
9
- AllowShortBlocksOnASingleLine: Never
10
- InsertBraces: true