@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.
- package/README.md +7 -0
- package/package.json +6 -6
- package/targets/cmake/geatsc-generated-archive-build.mjs +41 -12
- package/targets/esp32/app_project.cmake +23 -27
- package/targets/esp32/chip_bindings/magnetometer/bmm150.cpp +140 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +27 -3
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +11 -2
- package/targets/esp32/components/gea_framework/CMakeLists.txt +10 -5
- package/targets/esp32/components/gea_framework/project_include.cmake +22 -0
- package/targets/esp32/esp_now.cpp +298 -0
- package/targets/esp32/esp_now_power.h +17 -0
- package/targets/esp32/esp_now_rate.h +57 -0
- package/targets/esp32/esp_now_tx_header.h +46 -0
- package/targets/esp32/gea_framework.cmake +2 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +11 -0
- package/targets/esp32/services/device_control.cpp +29 -11
- package/targets/esp32/services/frame_scheduler.cpp +7 -0
- package/targets/esp32/uart.cpp +144 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +1 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -4
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +1 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +4 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +9 -6
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +1 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +4 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +21 -5
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +8 -5
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +1 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +4 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +16 -5
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +8 -5
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +1 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +3 -3
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -2
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +1 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +9 -9
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -4
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +1 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -4
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +1 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -1
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +1 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +7 -4
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +1 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +2 -1
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +6 -3
- package/targets/esp32-s3-m5stack-stopwatch/CMakeLists.txt +1 -0
- package/targets/esp32-s3-m5stack-stopwatch/main/gea-dependencies.json +42 -0
- package/targets/esp32-s3-m5stack-stopwatch/main/idf_component.yml +4 -18
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +8 -5
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +9 -4
- package/targets/esp32-s3-touch-amoled-1.8/main/gea-dependencies.json +26 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +6 -18
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +11 -10
- package/targets/esp32-s3-touch-amoled-2.06/main/gea-dependencies.json +58 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +4 -42
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/gea-dependencies.json +42 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +5 -30
- package/targets/esp32-s3-touch-lcd-1.54/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-lcd-1.54/main/idf_component.yml +8 -5
- package/targets/esp32-s3-touch-lcd-3.5b/CMakeLists.txt +1 -0
- package/targets/esp32-s3-touch-lcd-3.5b/main/gea-dependencies.json +26 -0
- package/targets/esp32-s3-touch-lcd-3.5b/main/idf_component.yml +4 -20
- package/targets/esp32-s31-espressif-mosaico/CMakeLists.txt +1 -0
- package/targets/esp32-s31-espressif-mosaico/README.md +10 -2
- package/targets/esp32-s31-espressif-mosaico/dependencies.lock +7 -334
- package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +9 -1
- package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +13 -1
- package/targets/esp32-s31-espressif-mosaico/main/gea-dependencies.json +52 -0
- package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +13 -40
- package/targets/esp32-s31-espressif-mosaico/main/include/board.h +6 -0
- package/targets/esp32-s31-espressif-mosaico/main/include/mosaico_peer_uart_pins.h +68 -0
- package/targets/esp32-s31-espressif-mosaico/main/peer_uart.cpp +28 -72
- package/targets/esp32-s31-espressif-mosaico/partitions.csv +1 -1
- package/targets/esp32-s3-m5stack-stopwatch/.clang-format +0 -10
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#include "platform/uart.h"
|
|
2
|
+
#include "driver/gpio.h"
|
|
3
|
+
#include "driver/uart.h"
|
|
4
|
+
#include "soc/soc_caps.h"
|
|
5
|
+
#include <array>
|
|
6
|
+
#include <limits>
|
|
7
|
+
#include <mutex>
|
|
8
|
+
|
|
9
|
+
// Board resource policy is separate from the chip's GPIO matrix capability.
|
|
10
|
+
extern "C" bool gea_board_uart_pin_allowed(int pin) __attribute__((weak));
|
|
11
|
+
extern "C" void gea_uart_link_bindings() {}
|
|
12
|
+
|
|
13
|
+
namespace {
|
|
14
|
+
struct Port {
|
|
15
|
+
bool open = false;
|
|
16
|
+
gea::platform::uart::Config config{-1, -1, 0};
|
|
17
|
+
};
|
|
18
|
+
std::array<Port, SOC_UART_HP_NUM> ports{};
|
|
19
|
+
std::mutex mutex;
|
|
20
|
+
bool validPort(int port) {
|
|
21
|
+
return port >= 0 && port < static_cast<int>(ports.size());
|
|
22
|
+
}
|
|
23
|
+
bool usablePin(int pin, bool output) {
|
|
24
|
+
if (pin < 0 || pin >= GPIO_NUM_MAX)
|
|
25
|
+
return false;
|
|
26
|
+
if (output ? !GPIO_IS_VALID_OUTPUT_GPIO(pin) : !GPIO_IS_VALID_GPIO(pin))
|
|
27
|
+
return false;
|
|
28
|
+
return !gea_board_uart_pin_allowed || gea_board_uart_pin_allowed(pin);
|
|
29
|
+
}
|
|
30
|
+
bool configured(int port) { return validPort(port) && ports[port].open; }
|
|
31
|
+
int writable(int port) {
|
|
32
|
+
std::size_t bytes = 0;
|
|
33
|
+
if (uart_get_tx_buffer_free_size(static_cast<uart_port_t>(port), &bytes) !=
|
|
34
|
+
ESP_OK)
|
|
35
|
+
return -1;
|
|
36
|
+
// IDF's ring buffer also needs an item header and alignment for each write.
|
|
37
|
+
return bytes > 32 ? static_cast<int>(bytes - 32) : 0;
|
|
38
|
+
}
|
|
39
|
+
} // namespace
|
|
40
|
+
|
|
41
|
+
extern "C" bool gea_uart_open(int port, int tx, int rx, int baud, int rxBytes,
|
|
42
|
+
int txBytes) {
|
|
43
|
+
std::lock_guard lock(mutex);
|
|
44
|
+
if (!validPort(port) || !usablePin(tx, true) || !usablePin(rx, false) ||
|
|
45
|
+
tx == rx || baud < 1 || baud > 5000000 || rxBytes < 256 ||
|
|
46
|
+
rxBytes > 65536 || txBytes < 256 || txBytes > 65536)
|
|
47
|
+
return false;
|
|
48
|
+
#if defined(CONFIG_ESP_CONSOLE_UART_NUM)
|
|
49
|
+
if (port == CONFIG_ESP_CONSOLE_UART_NUM)
|
|
50
|
+
return false;
|
|
51
|
+
#endif
|
|
52
|
+
const auto uart = static_cast<uart_port_t>(port);
|
|
53
|
+
if (ports[port].open) {
|
|
54
|
+
const auto &old = ports[port].config;
|
|
55
|
+
return old.tx == tx && old.rx == rx && old.baudRate == baud &&
|
|
56
|
+
old.rxBufferSize == rxBytes && old.txBufferSize == txBytes;
|
|
57
|
+
}
|
|
58
|
+
if (uart_is_driver_installed(uart))
|
|
59
|
+
return false;
|
|
60
|
+
for (const auto &other : ports) {
|
|
61
|
+
if (other.open && (other.config.tx == tx || other.config.rx == tx ||
|
|
62
|
+
other.config.tx == rx || other.config.rx == rx))
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
uart_config_t config{};
|
|
66
|
+
config.baud_rate = baud;
|
|
67
|
+
config.data_bits = UART_DATA_8_BITS;
|
|
68
|
+
config.parity = UART_PARITY_DISABLE;
|
|
69
|
+
config.stop_bits = UART_STOP_BITS_1;
|
|
70
|
+
config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
|
|
71
|
+
config.source_clk = UART_SCLK_DEFAULT;
|
|
72
|
+
// Allocate before routing pins: a failed allocation cannot disturb the
|
|
73
|
+
// pins.
|
|
74
|
+
if (uart_driver_install(uart, rxBytes, txBytes, 0, nullptr, 0) != ESP_OK)
|
|
75
|
+
return false;
|
|
76
|
+
// IDF's matrix RX route enables input but deliberately preserves output
|
|
77
|
+
// (it also supports shared TX/RX pads). Gea requires distinct pins, so clear
|
|
78
|
+
// stale routes first, including a previous firmware's TX on our new RX pad.
|
|
79
|
+
// Software restart can leave the pad configured after driver state is lost.
|
|
80
|
+
if (uart_param_config(uart, &config) != ESP_OK ||
|
|
81
|
+
gpio_reset_pin(static_cast<gpio_num_t>(tx)) != ESP_OK ||
|
|
82
|
+
gpio_reset_pin(static_cast<gpio_num_t>(rx)) != ESP_OK ||
|
|
83
|
+
uart_set_pin(uart, tx, rx, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE) !=
|
|
84
|
+
ESP_OK ||
|
|
85
|
+
uart_set_rx_full_threshold(uart, 96) != ESP_OK ||
|
|
86
|
+
uart_set_rx_timeout(uart, 2) != ESP_OK) {
|
|
87
|
+
uart_driver_delete(uart);
|
|
88
|
+
gpio_reset_pin(static_cast<gpio_num_t>(tx));
|
|
89
|
+
gpio_reset_pin(static_cast<gpio_num_t>(rx));
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
ports[port] = {true, {tx, rx, baud, rxBytes, txBytes}};
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
extern "C" bool gea_uart_is_open(int port) {
|
|
96
|
+
std::lock_guard lock(mutex);
|
|
97
|
+
return configured(port);
|
|
98
|
+
}
|
|
99
|
+
extern "C" void gea_uart_close(int port) {
|
|
100
|
+
std::lock_guard lock(mutex);
|
|
101
|
+
if (!configured(port))
|
|
102
|
+
return;
|
|
103
|
+
uart_driver_delete(static_cast<uart_port_t>(port));
|
|
104
|
+
gpio_reset_pin(static_cast<gpio_num_t>(ports[port].config.tx));
|
|
105
|
+
gpio_reset_pin(static_cast<gpio_num_t>(ports[port].config.rx));
|
|
106
|
+
ports[port] = {};
|
|
107
|
+
}
|
|
108
|
+
extern "C" int gea_uart_read(int port, void *bytes, std::size_t capacity) {
|
|
109
|
+
std::lock_guard lock(mutex);
|
|
110
|
+
if (!configured(port) || (!bytes && capacity) ||
|
|
111
|
+
capacity > std::numeric_limits<int>::max())
|
|
112
|
+
return -1;
|
|
113
|
+
return capacity ? uart_read_bytes(static_cast<uart_port_t>(port), bytes,
|
|
114
|
+
capacity, 0)
|
|
115
|
+
: 0;
|
|
116
|
+
}
|
|
117
|
+
extern "C" int gea_uart_write(int port, const void *bytes, std::size_t length) {
|
|
118
|
+
std::lock_guard lock(mutex);
|
|
119
|
+
if (!configured(port) || (!bytes && length) ||
|
|
120
|
+
length > std::numeric_limits<int>::max())
|
|
121
|
+
return -1;
|
|
122
|
+
if (!length)
|
|
123
|
+
return 0;
|
|
124
|
+
const int free = writable(port);
|
|
125
|
+
if (free < 0)
|
|
126
|
+
return -1;
|
|
127
|
+
if (length > static_cast<std::size_t>(free))
|
|
128
|
+
return 0;
|
|
129
|
+
return uart_write_bytes(static_cast<uart_port_t>(port), bytes, length);
|
|
130
|
+
}
|
|
131
|
+
extern "C" int gea_uart_available(int port) {
|
|
132
|
+
std::lock_guard lock(mutex);
|
|
133
|
+
if (!configured(port))
|
|
134
|
+
return -1;
|
|
135
|
+
std::size_t bytes = 0;
|
|
136
|
+
return uart_get_buffered_data_len(static_cast<uart_port_t>(port), &bytes) ==
|
|
137
|
+
ESP_OK
|
|
138
|
+
? static_cast<int>(bytes)
|
|
139
|
+
: -1;
|
|
140
|
+
}
|
|
141
|
+
extern "C" int gea_uart_writable(int port) {
|
|
142
|
+
std::lock_guard lock(mutex);
|
|
143
|
+
return configured(port) ? writable(port) : -1;
|
|
144
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_lcd_touch_gt911: '
|
|
5
|
-
espressif/esp_codec_dev: '
|
|
6
|
-
espressif/esp_websocket_client: '
|
|
7
|
-
espressif/esp_peer: '
|
|
7
|
+
espressif/esp_lcd_touch_gt911: '==1.2.0~2'
|
|
8
|
+
espressif/esp_codec_dev: '==1.5.11'
|
|
9
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
10
|
+
espressif/esp_peer: '==1.5.0'
|
|
8
11
|
idf:
|
|
9
12
|
version: '>=5.3'
|
|
@@ -332,6 +332,8 @@ idf_component_register(
|
|
|
332
332
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
|
|
333
333
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
|
|
334
334
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp"
|
|
335
|
+
# ota.cpp stages the image through ota_image.cpp (and its debug hooks).
|
|
336
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp"
|
|
335
337
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
|
|
336
338
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
|
|
337
339
|
${APP_GENERATED_SOURCES}
|
|
@@ -353,6 +355,8 @@ idf_component_register(
|
|
|
353
355
|
esp_http_client
|
|
354
356
|
${GEA_EMBEDDED_HTTPS_REQUIRES}
|
|
355
357
|
app_update
|
|
358
|
+
# esp32/services/ota.cpp reads the flash through esp_flash.h.
|
|
359
|
+
spi_flash
|
|
356
360
|
esp_mm
|
|
357
361
|
esp_netif
|
|
358
362
|
esp_event
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
|
-
78/esp-opus: '
|
|
6
|
+
78/esp-opus: '==1.0.5'
|
|
4
7
|
esp_video:
|
|
5
8
|
version: '~2.0'
|
|
6
9
|
public: true
|
|
7
|
-
espressif/esp_codec_dev: '
|
|
8
|
-
espressif/esp_websocket_client: '
|
|
9
|
-
espressif/esp_peer: '
|
|
10
|
+
espressif/esp_codec_dev: '==1.5.11'
|
|
11
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
12
|
+
espressif/esp_peer: '==1.5.0'
|
|
10
13
|
# ESP32-P4 has no native WiFi MAC: WiFi runs on the onboard ESP32-C6
|
|
11
14
|
# co-processor over SDIO via esp_hosted, with esp_wifi_remote providing the
|
|
12
15
|
# standard esp_wifi API on the host. Gated to esp32p4 so other targets keep
|
|
13
16
|
# their native radio. (Canonical versions per IDF 6.0.1 wifi/station example.)
|
|
14
17
|
espressif/esp_wifi_remote:
|
|
15
|
-
version: '
|
|
18
|
+
version: '==1.6.1'
|
|
16
19
|
rules:
|
|
17
20
|
- if: 'target in [esp32p4]'
|
|
18
21
|
espressif/esp_hosted:
|
|
19
|
-
version: '
|
|
22
|
+
version: '==2.12.13'
|
|
20
23
|
rules:
|
|
21
24
|
- if: 'target in [esp32p4]'
|
|
22
25
|
idf:
|
|
@@ -7,6 +7,7 @@ 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
|
+
gea_solve_dependencies_in_build_dir()
|
|
10
11
|
project(gea_embedded)
|
|
11
12
|
|
|
12
13
|
# Re-apply this board's tracked managed-component patches. The IDF component
|
|
@@ -312,6 +312,8 @@ idf_component_register(
|
|
|
312
312
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
|
|
313
313
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
|
|
314
314
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp"
|
|
315
|
+
# ota.cpp stages the image through ota_image.cpp (and its debug hooks).
|
|
316
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp"
|
|
315
317
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
|
|
316
318
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
|
|
317
319
|
${APP_GENERATED_SOURCES}
|
|
@@ -332,6 +334,8 @@ idf_component_register(
|
|
|
332
334
|
esp_http_client
|
|
333
335
|
${GEA_EMBEDDED_HTTPS_REQUIRES}
|
|
334
336
|
app_update
|
|
337
|
+
# esp32/services/ota.cpp reads the flash through esp_flash.h.
|
|
338
|
+
spi_flash
|
|
335
339
|
esp_mm
|
|
336
340
|
esp_netif
|
|
337
341
|
esp_event
|
|
@@ -44,6 +44,20 @@ namespace gea::platform::esp32_p4_waveshare::display {
|
|
|
44
44
|
|
|
45
45
|
namespace {
|
|
46
46
|
|
|
47
|
+
// Floor square root, the one engine/canvas.cpp's CanvasMath uses for a circle
|
|
48
|
+
// row's half width, so a batched circle covers the pixels the canvas would.
|
|
49
|
+
int integerSqrt(int n)
|
|
50
|
+
{
|
|
51
|
+
if (n <= 0) return 0;
|
|
52
|
+
int x = n;
|
|
53
|
+
int y = (x + 1) / 2;
|
|
54
|
+
while (y < x) {
|
|
55
|
+
x = y;
|
|
56
|
+
y = (x + n / x) / 2;
|
|
57
|
+
}
|
|
58
|
+
return x;
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
constexpr const char *kTag = "waveshare_p4_display";
|
|
48
62
|
constexpr int kNativeWidth = platform_display::kNativeWidth;
|
|
49
63
|
constexpr int kNativeHeight = platform_display::kNativeHeight;
|
|
@@ -579,11 +593,7 @@ public:
|
|
|
579
593
|
if (cy + dy1 >= height) dy1 = height - 1 - cy;
|
|
580
594
|
if (dy0 > dy1) continue;
|
|
581
595
|
for (int dy = dy0; dy <= dy1; ++dy) {
|
|
582
|
-
const int
|
|
583
|
-
const int halfWidth =
|
|
584
|
-
spanIndex >= 0 && spanIndex < static_cast<int>(command.spans.halfWidths.size())
|
|
585
|
-
? command.spans.halfWidths[static_cast<std::size_t>(spanIndex)]
|
|
586
|
-
: present::integerSqrt(r * r - dy * dy);
|
|
596
|
+
const int halfWidth = integerSqrt(r * r - dy * dy);
|
|
587
597
|
int x0 = cx - halfWidth;
|
|
588
598
|
int x1 = cx + halfWidth;
|
|
589
599
|
if (x0 < 0) x0 = 0;
|
|
@@ -667,6 +677,11 @@ public:
|
|
|
667
677
|
workerCanvas_.resetDirty();
|
|
668
678
|
}
|
|
669
679
|
|
|
680
|
+
// Display::rebindCanvasToFramebuffer() restores the canvas binding after a
|
|
681
|
+
// path that rebinds it (a retained snapshot render); this board has no
|
|
682
|
+
// rasterized flush, so rebinding the framebuffer is the whole restore.
|
|
683
|
+
void rebindCanvasToFramebuffer() { bindCanvas(); }
|
|
684
|
+
|
|
670
685
|
private:
|
|
671
686
|
DisplayBackend() = default;
|
|
672
687
|
|
|
@@ -1660,6 +1675,7 @@ void Display::clear() { gea::platform::esp32_p4_waveshare::display::DisplayBacke
|
|
|
1660
1675
|
void Display::clearNoFlush() { gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().clearNoFlush(); }
|
|
1661
1676
|
void Display::print(const char *) {}
|
|
1662
1677
|
void Display::flush() { gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().flush(); }
|
|
1678
|
+
void Display::rebindCanvasToFramebuffer() { gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().rebindCanvasToFramebuffer(); }
|
|
1663
1679
|
void Display::flushRects(const DisplayFlushRect *rects, int count, bool) { gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().flushRects(rects, count); }
|
|
1664
1680
|
bool Display::streamRect(int x, int y, int w, int h, DisplayStreamRasterFn raster, void *user) { return gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().streamRect(x, y, w, h, raster, user); }
|
|
1665
1681
|
bool Display::present(const DisplayPresentCommand *commands, int command_count) { return gea::platform::esp32_p4_waveshare::display::DisplayBackend::instance().presentCommands(commands, command_count); }
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
7
|
esp_video:
|
|
5
8
|
version: '0.8.*'
|
|
6
9
|
public: true
|
|
7
|
-
espressif/esp_codec_dev: '
|
|
8
|
-
espressif/esp_lcd_st7796: '
|
|
9
|
-
espressif/esp_lcd_touch_ft5x06: '
|
|
10
|
-
espressif/esp_websocket_client: '
|
|
11
|
-
espressif/esp_peer: '
|
|
10
|
+
espressif/esp_codec_dev: '==1.5.10'
|
|
11
|
+
espressif/esp_lcd_st7796: '==1.4.0'
|
|
12
|
+
espressif/esp_lcd_touch_ft5x06: '==1.1.0~1'
|
|
13
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
14
|
+
espressif/esp_peer: '==1.4.1'
|
|
12
15
|
idf:
|
|
13
16
|
version: '>=5.5'
|
|
@@ -317,6 +317,8 @@ idf_component_register(
|
|
|
317
317
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
|
|
318
318
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
|
|
319
319
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp"
|
|
320
|
+
# ota.cpp stages the image through ota_image.cpp (and its debug hooks).
|
|
321
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp"
|
|
320
322
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
|
|
321
323
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
|
|
322
324
|
${APP_GENERATED_SOURCES}
|
|
@@ -337,6 +339,8 @@ idf_component_register(
|
|
|
337
339
|
esp_http_client
|
|
338
340
|
${GEA_EMBEDDED_HTTPS_REQUIRES}
|
|
339
341
|
app_update
|
|
342
|
+
# esp32/services/ota.cpp reads the flash through esp_flash.h.
|
|
343
|
+
spi_flash
|
|
340
344
|
esp_mm
|
|
341
345
|
esp_netif
|
|
342
346
|
esp_event
|
|
@@ -40,6 +40,20 @@ namespace gea::platform::esp32_p4_waveshare::display {
|
|
|
40
40
|
|
|
41
41
|
namespace {
|
|
42
42
|
|
|
43
|
+
// Floor square root, the one engine/canvas.cpp's CanvasMath uses for a circle
|
|
44
|
+
// row's half width, so a batched circle covers the pixels the canvas would.
|
|
45
|
+
int integerSqrt(int n)
|
|
46
|
+
{
|
|
47
|
+
if (n <= 0) return 0;
|
|
48
|
+
int x = n;
|
|
49
|
+
int y = (x + 1) / 2;
|
|
50
|
+
while (y < x) {
|
|
51
|
+
x = y;
|
|
52
|
+
y = (x + n / x) / 2;
|
|
53
|
+
}
|
|
54
|
+
return x;
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
constexpr const char *kTag = "waveshare_p4_display";
|
|
44
58
|
constexpr int kNativeWidth = platform_display::kNativeWidth;
|
|
45
59
|
constexpr int kNativeHeight = platform_display::kNativeHeight;
|
|
@@ -87,6 +101,7 @@ constexpr lcd_color_format_t lcdColorFormat(pixel::Format format)
|
|
|
87
101
|
case pixel::Format::Rgb888:
|
|
88
102
|
return LCD_COLOR_FMT_RGB888;
|
|
89
103
|
case pixel::Format::Rgba8888:
|
|
104
|
+
case pixel::Format::Argb8888:
|
|
90
105
|
break;
|
|
91
106
|
}
|
|
92
107
|
return LCD_COLOR_FMT_RGB565;
|
|
@@ -1486,11 +1501,7 @@ public:
|
|
|
1486
1501
|
if (cy + dy1 >= height) dy1 = height - 1 - cy;
|
|
1487
1502
|
if (dy0 > dy1) continue;
|
|
1488
1503
|
for (int dy = dy0; dy <= dy1; ++dy) {
|
|
1489
|
-
const int
|
|
1490
|
-
const int halfWidth =
|
|
1491
|
-
spanIndex >= 0 && spanIndex < static_cast<int>(command.spans.halfWidths.size())
|
|
1492
|
-
? command.spans.halfWidths[static_cast<std::size_t>(spanIndex)]
|
|
1493
|
-
: present::integerSqrt(r * r - dy * dy);
|
|
1504
|
+
const int halfWidth = integerSqrt(r * r - dy * dy);
|
|
1494
1505
|
int x0 = cx - halfWidth;
|
|
1495
1506
|
int x1 = cx + halfWidth;
|
|
1496
1507
|
if (x0 < 0) x0 = 0;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
7
|
esp_video:
|
|
5
8
|
version: '0.8.*'
|
|
6
9
|
public: true
|
|
7
|
-
espressif/esp_codec_dev: '
|
|
10
|
+
espressif/esp_codec_dev: '==1.5.10'
|
|
8
11
|
esp_lcd_ili9881c: '*'
|
|
9
12
|
esp_lcd_touch_gt911: '^1'
|
|
10
|
-
espressif/esp_websocket_client: '
|
|
11
|
-
espressif/esp_peer: '
|
|
13
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
14
|
+
espressif/esp_peer: '==1.4.1'
|
|
12
15
|
# ESP32-P4 has no native WiFi MAC: WiFi runs on the onboard ESP32-C6
|
|
13
16
|
# co-processor over SDIO via esp_hosted, with esp_wifi_remote providing the
|
|
14
17
|
# standard esp_wifi API on the host. Gated to esp32p4 so other targets keep
|
|
15
18
|
# their native radio. (Canonical versions per IDF 6.0.1 wifi/station example.)
|
|
16
19
|
espressif/esp_wifi_remote:
|
|
17
|
-
version: '
|
|
20
|
+
version: '==1.6.1'
|
|
18
21
|
rules:
|
|
19
22
|
- if: 'target in [esp32p4]'
|
|
20
23
|
espressif/esp_hosted:
|
|
21
|
-
version: '
|
|
24
|
+
version: '==2.12.9'
|
|
22
25
|
rules:
|
|
23
26
|
- if: 'target in [esp32p4]'
|
|
24
27
|
idf:
|
|
@@ -246,9 +246,9 @@ set(GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS "")
|
|
|
246
246
|
# missing esp_bt.h.
|
|
247
247
|
if(DEFINED ENV{GEA_EMBEDDED_BLE_OTA} AND "$ENV{GEA_EMBEDDED_BLE_OTA}" STREQUAL "1")
|
|
248
248
|
set(GEA_EMBEDDED_CAPABILITY_BLE 1)
|
|
249
|
-
elseif(DEFINED
|
|
250
|
-
AND NOT "$
|
|
251
|
-
set(GEA_EMBEDDED_CAPABILITY_BLE "$
|
|
249
|
+
elseif(DEFINED GEA_EMBEDDED_CAPABILITY_BLE
|
|
250
|
+
AND NOT "${GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
251
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE "${GEA_EMBEDDED_CAPABILITY_BLE}")
|
|
252
252
|
elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_BLE}
|
|
253
253
|
AND NOT "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
254
254
|
set(GEA_EMBEDDED_CAPABILITY_BLE "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}")
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_websocket_client: '
|
|
5
|
-
espressif/esp_peer: '
|
|
7
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
8
|
+
espressif/esp_peer: '==1.4.1'
|
|
6
9
|
idf:
|
|
7
10
|
version: '>=5.3'
|
|
@@ -318,9 +318,9 @@ set(GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS "")
|
|
|
318
318
|
# The board command passes these after analyzing the active app plus every
|
|
319
319
|
# application. Direct idf.py builds fall back to the same analyzer data
|
|
320
320
|
# collected above, so linkage is capability-driven on both entry paths.
|
|
321
|
-
if(DEFINED
|
|
322
|
-
AND NOT "$
|
|
323
|
-
set(GEA_EMBEDDED_CAPABILITY_NETWORK "$
|
|
321
|
+
if(DEFINED GEA_EMBEDDED_CAPABILITY_NETWORK
|
|
322
|
+
AND NOT "${GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "")
|
|
323
|
+
set(GEA_EMBEDDED_CAPABILITY_NETWORK "${GEA_EMBEDDED_CAPABILITY_NETWORK}")
|
|
324
324
|
elseif(NOT DEFINED GEA_EMBEDDED_CAPABILITY_NETWORK OR "${GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "")
|
|
325
325
|
set(GEA_EMBEDDED_CAPABILITY_NETWORK 0)
|
|
326
326
|
if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)(wifi|fetch|http|websocket|rtc)($|;)"
|
|
@@ -328,18 +328,18 @@ elseif(NOT DEFINED GEA_EMBEDDED_CAPABILITY_NETWORK OR "${GEA_EMBEDDED_CAPABILITY
|
|
|
328
328
|
set(GEA_EMBEDDED_CAPABILITY_NETWORK 1)
|
|
329
329
|
endif()
|
|
330
330
|
endif()
|
|
331
|
-
if(DEFINED
|
|
332
|
-
AND NOT "$
|
|
333
|
-
set(GEA_EMBEDDED_CAPABILITY_BLE "$
|
|
331
|
+
if(DEFINED GEA_EMBEDDED_CAPABILITY_BLE
|
|
332
|
+
AND NOT "${GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
333
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE "${GEA_EMBEDDED_CAPABILITY_BLE}")
|
|
334
334
|
elseif(NOT DEFINED GEA_EMBEDDED_CAPABILITY_BLE OR "${GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
335
335
|
set(GEA_EMBEDDED_CAPABILITY_BLE 0)
|
|
336
336
|
if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)ble($|;)")
|
|
337
337
|
set(GEA_EMBEDDED_CAPABILITY_BLE 1)
|
|
338
338
|
endif()
|
|
339
339
|
endif()
|
|
340
|
-
if(DEFINED
|
|
341
|
-
AND NOT "$
|
|
342
|
-
set(GEA_EMBEDDED_CAPABILITY_AUDIO "$
|
|
340
|
+
if(DEFINED GEA_EMBEDDED_CAPABILITY_AUDIO
|
|
341
|
+
AND NOT "${GEA_EMBEDDED_CAPABILITY_AUDIO}" STREQUAL "")
|
|
342
|
+
set(GEA_EMBEDDED_CAPABILITY_AUDIO "${GEA_EMBEDDED_CAPABILITY_AUDIO}")
|
|
343
343
|
elseif(NOT DEFINED GEA_EMBEDDED_CAPABILITY_AUDIO OR "${GEA_EMBEDDED_CAPABILITY_AUDIO}" STREQUAL "")
|
|
344
344
|
set(GEA_EMBEDDED_CAPABILITY_AUDIO 0)
|
|
345
345
|
if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)audio($|;)")
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_lcd_touch_ft5x06: '
|
|
5
|
-
espressif/esp_codec_dev: '
|
|
6
|
-
espressif/esp_websocket_client: '
|
|
7
|
-
espressif/esp_peer: '
|
|
7
|
+
espressif/esp_lcd_touch_ft5x06: '==1.1.0~1'
|
|
8
|
+
espressif/esp_codec_dev: '==1.5.10'
|
|
9
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
10
|
+
espressif/esp_peer: '==1.4.1'
|
|
8
11
|
idf:
|
|
9
12
|
version: '>=5.3'
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_lcd_axs15231b: '
|
|
5
|
-
espressif/esp_websocket_client: '
|
|
6
|
-
espressif/esp_peer: '
|
|
7
|
-
espressif/esp_tinyusb: '
|
|
7
|
+
espressif/esp_lcd_axs15231b: '==2.1.0'
|
|
8
|
+
espressif/esp_websocket_client: '==1.8.0'
|
|
9
|
+
espressif/esp_peer: '==1.5.3'
|
|
10
|
+
espressif/esp_tinyusb: '==2.2.1'
|
|
8
11
|
idf:
|
|
9
12
|
version: '>=6.0'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
|
-
espressif/esp_lcd_touch_gt911: '
|
|
5
|
+
espressif/esp_lcd_touch_gt911: '==1.2.0~2'
|
|
3
6
|
idf:
|
|
4
7
|
version: '>=5.3'
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_websocket_client: '
|
|
7
|
+
espressif/esp_websocket_client: '==1.8.0'
|
|
5
8
|
# 1.5.0 requires LWIP IPv6 (sockaddr_in6); this target disables IPv6.
|
|
6
|
-
espressif/esp_peer: '
|
|
7
|
-
espressif/esp_lcd_touch_gt911: '
|
|
9
|
+
espressif/esp_peer: '==1.4.2'
|
|
10
|
+
espressif/esp_lcd_touch_gt911: '==1.2.0~2'
|
|
8
11
|
# Required even though this board has no speaker: the shared e-paper recipe
|
|
9
12
|
# appends esp_codec_dev to the audio REQUIRES whenever the APP declares an
|
|
10
13
|
# audio capability (button-tetris does). Without it the build fails at CMake
|
|
11
14
|
# with "Failed to resolve component 'esp_codec_dev'". The M5Paper target
|
|
12
15
|
# declares it for the same reason; audio itself stays stubbed out via
|
|
13
16
|
# GEA_EMBEDDED_AUDIO_DISABLED / audio_stub.cpp.
|
|
14
|
-
espressif/esp_codec_dev: '
|
|
17
|
+
espressif/esp_codec_dev: '==1.6.1'
|
|
15
18
|
idf:
|
|
16
19
|
version: '>=5.3'
|
|
@@ -31,7 +31,8 @@ set(GEA_EMBEDDED_TARGET_PIXEL_PANEL_ENDIAN 1)
|
|
|
31
31
|
# spi_flash/esp_psram: put esp_flash.h/esp_psram.h on the include path so the
|
|
32
32
|
# diagnostics deviceInfo facade (app native/device_info.cpp) can report the 8MB
|
|
33
33
|
# flash + 8MB PSRAM instead of degrading to 0 (mirrors the m5paper target).
|
|
34
|
-
|
|
34
|
+
# esp_driver_i2s: board.h names the speaker and microphone pins with driver/i2s_types.h.
|
|
35
|
+
set(GEA_EMBEDDED_TARGET_EXTRA_REQUIRES bootloader_support esp_driver_ledc spi_flash esp_psram esp_driver_i2c esp_driver_i2s)
|
|
35
36
|
|
|
36
37
|
# IMU: BMI270 (6-axis accel+gyro) on the shared primary I2C bus at 0x68, driving
|
|
37
38
|
# gea::platform::sensors::Accelerometer (tilt/level tool, air-mouse, etc.).
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
# Registry versions are pinned to the ones dependencies.lock records. The build
|
|
2
|
+
# solves into its build directory (esp32/app_project.cmake), so a range would let
|
|
3
|
+
# a re-solve for another app's capabilities move them.
|
|
1
4
|
dependencies:
|
|
2
5
|
# PCM <-> Opus at the WebRTC media-track boundary.
|
|
3
6
|
78/esp-opus: '^1.0.5'
|
|
4
|
-
espressif/esp_codec_dev: '
|
|
5
|
-
espressif/esp_websocket_client: '
|
|
7
|
+
espressif/esp_codec_dev: '==1.5.11'
|
|
8
|
+
espressif/esp_websocket_client: '==1.7.0'
|
|
6
9
|
# 1.5.0 requires LWIP IPv6 (sockaddr_in6); stay on 1.4.x like the other
|
|
7
10
|
# boards since this target builds with CONFIG_LWIP_IPV6 off.
|
|
8
|
-
espressif/esp_peer: '
|
|
11
|
+
espressif/esp_peer: '==1.4.2'
|
|
9
12
|
idf:
|
|
10
13
|
version: '>=5.3'
|