@geastack/targets 0.1.98 → 0.1.100
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/build-config.json
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"renderer.subtreeRevealChecks",
|
|
16
16
|
"renderer.recordInlinePositions",
|
|
17
17
|
"diagnostics.performanceCounters",
|
|
18
|
-
"diagnostics.frameTiming"
|
|
18
|
+
"diagnostics.frameTiming",
|
|
19
|
+
"renderer.bandedUi"
|
|
19
20
|
],
|
|
20
21
|
"defaults": {
|
|
21
22
|
"ui": {
|
|
@@ -29,6 +30,9 @@
|
|
|
29
30
|
"storeRelowering": true,
|
|
30
31
|
"moduleGraph": "auto",
|
|
31
32
|
"allowAny": false
|
|
33
|
+
},
|
|
34
|
+
"renderer": {
|
|
35
|
+
"bandedUi": false
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
},
|
|
@@ -41,7 +45,8 @@
|
|
|
41
45
|
"compiler.translationUnits",
|
|
42
46
|
"compiler.storeRelowering",
|
|
43
47
|
"compiler.moduleGraph",
|
|
44
|
-
"compiler.allowAny"
|
|
48
|
+
"compiler.allowAny",
|
|
49
|
+
"renderer.bandedUi"
|
|
45
50
|
],
|
|
46
51
|
"defaults": {
|
|
47
52
|
"ui": {
|
|
@@ -55,6 +60,9 @@
|
|
|
55
60
|
"storeRelowering": true,
|
|
56
61
|
"moduleGraph": "auto",
|
|
57
62
|
"allowAny": false
|
|
63
|
+
},
|
|
64
|
+
"renderer": {
|
|
65
|
+
"bandedUi": false
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/targets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.100",
|
|
4
4
|
"description": "Native embedded build targets (ESP32-IDF, RP2350) for geastack apps: board sources, target catalog, and CMake glue driven by the gea CLI.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -34,10 +34,6 @@ set(GEA_BOARD_EXTRA_COMPILE_DEFINITIONS
|
|
|
34
34
|
GEA_BOARD_USB_CONSOLE=1
|
|
35
35
|
# `gea flash` installs apps through the running app (usbAppUpdate).
|
|
36
36
|
GEA_DEVICE_CONTROL_USB_OTA=1
|
|
37
|
-
# Framebuffer-free retained UI: each dirty band is rendered straight into the
|
|
38
|
-
# internal-RAM DMA staging chunk and streamed while the next band renders,
|
|
39
|
-
# instead of writing the PSRAM framebuffer and reading it back to flush.
|
|
40
|
-
GEA_EMBEDDED_DISPLAY_BANDED_UI=1
|
|
41
37
|
GEA_EMBEDDED_CO5300_MOSAICO_INIT=1
|
|
42
38
|
GEA_EMBEDDED_CO5300_PANEL_X_GAP=0
|
|
43
39
|
GEA_EMBEDDED_CO5300_PANEL_Y_GAP=0
|
|
@@ -54,6 +50,7 @@ set(GEA_BOARD_PLATFORM_SOURCES
|
|
|
54
50
|
"${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/launcher_button.cpp"
|
|
55
51
|
"${CMAKE_CURRENT_LIST_DIR}/touch.cpp"
|
|
56
52
|
"${CMAKE_CURRENT_LIST_DIR}/board_power.cpp"
|
|
53
|
+
"${CMAKE_CURRENT_LIST_DIR}/peer_uart.cpp"
|
|
57
54
|
"${GEA_CHIPS}/displays/co5300/co5300.cpp"
|
|
58
55
|
"${CMAKE_CURRENT_LIST_DIR}/../../esp32/display.cpp"
|
|
59
56
|
"${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/displays/co5300.cpp"
|
|
@@ -72,6 +69,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/CMakeLis
|
|
|
72
69
|
# std::move()s as redundant. Warnings, not errors, until the compiler runtime
|
|
73
70
|
# and emitter are fixed for this toolchain.
|
|
74
71
|
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
|
|
72
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,-u,gea_mosaico_peer_uart_open")
|
|
75
73
|
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-error=nonnull -Wno-error=redundant-move)
|
|
76
74
|
# board_power.cpp keeps a crash's registers and log across the reset (no UART0 here)
|
|
77
75
|
# and makes the USB console wait for the host instead of dropping output.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <stddef.h>
|
|
3
|
+
#include <stdbool.h>
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
// Target-owned GPIO/UART reservation. Side 0 is left, side 1 is right. This API
|
|
9
|
+
// carries digital bytes only; packet framing and DSP are application concerns.
|
|
10
|
+
// Explicit opt-in; unconfigured boards do not drive expansion pins.
|
|
11
|
+
bool gea_mosaico_peer_uart_open(uint32_t baud);
|
|
12
|
+
void gea_mosaico_peer_uart_close(void);
|
|
13
|
+
int gea_mosaico_peer_uart_read(unsigned side, void* bytes, size_t capacity);
|
|
14
|
+
int gea_mosaico_peer_uart_write(unsigned side, const void* bytes, size_t length);
|
|
15
|
+
#ifdef __cplusplus
|
|
16
|
+
}
|
|
17
|
+
#endif
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#include "driver/gpio.h"
|
|
2
|
+
#include "driver/uart.h"
|
|
3
|
+
#include "esp_err.h"
|
|
4
|
+
#include "freertos/FreeRTOS.h"
|
|
5
|
+
#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) {
|
|
19
|
+
#if GEA_MOSAICO_CAMERA_ENABLED
|
|
20
|
+
// Camera expansion owns these side GPIOs when that capability is enabled.
|
|
21
|
+
return false;
|
|
22
|
+
#endif
|
|
23
|
+
if (opened)
|
|
24
|
+
return true;
|
|
25
|
+
if (baud < 115200 || baud > 5000000)
|
|
26
|
+
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;
|
|
59
|
+
}
|
|
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;
|
|
69
|
+
}
|
|
70
|
+
extern "C" int gea_mosaico_peer_uart_read(unsigned side, void *bytes,
|
|
71
|
+
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);
|
|
75
|
+
}
|
|
76
|
+
extern "C" int gea_mosaico_peer_uart_write(unsigned side, const void *bytes,
|
|
77
|
+
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);
|
|
86
|
+
}
|