@geastack/targets 0.1.78 → 0.1.80
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/package.json +2 -2
- package/targets/esp32/chip_bindings/README.md +15 -0
- package/targets/esp32/chip_bindings/displays/rgb_panel.cpp +1275 -0
- package/targets/esp32/chip_bindings/expanders/ch422g.cpp +141 -0
- package/targets/esp32/chip_bindings/expanders/io_expander.h +29 -0
- package/targets/esp32/chip_bindings/touch/gt911.cpp +355 -0
- package/targets/esp32/chip_bindings/touch/gt911_controller.h +84 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +41 -3
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +8 -2
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +25 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +1 -1
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +27 -3
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +8 -1
- package/targets/esp32-s3-waveshare-touch-lcd-7.json +61 -0
- package/targets.json +10 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#include "gea_embedded_app_config.h"
|
|
2
2
|
|
|
3
|
+
#include "sdkconfig.h"
|
|
4
|
+
|
|
3
5
|
#include "apps/app_manager.h"
|
|
6
|
+
#if CONFIG_BT_ENABLED && defined(GEA_EMBEDDED_APP_USES_BLE)
|
|
4
7
|
#include "connectivity/ble_hid.h"
|
|
8
|
+
#endif
|
|
5
9
|
#include "display.h"
|
|
6
10
|
|
|
7
11
|
// Forward-declare here instead of through a header — there's already a
|
|
@@ -173,9 +177,11 @@ extern "C" void app_main(void)
|
|
|
173
177
|
// We can't just define the macro unconditionally either — it also gates
|
|
174
178
|
// `gea_init`'s SPIRAM-vs-DRAM placement in `app_runner.cpp`, and forcing
|
|
175
179
|
// DRAM there fails (64 KB stack > 32 KB largest contiguous block at
|
|
176
|
-
// init time).
|
|
177
|
-
// macro narrow.
|
|
180
|
+
// init time). The board build's independently resolved BLE capability controls
|
|
181
|
+
// whether this driver is linked and registered; the analyzer macro stays narrow.
|
|
182
|
+
#if CONFIG_BT_ENABLED && defined(GEA_EMBEDDED_APP_USES_BLE)
|
|
178
183
|
gea::targets::esp32::ble::registerHidDriver();
|
|
184
|
+
#endif
|
|
179
185
|
|
|
180
186
|
BaseType_t created = createRuntimeTask();
|
|
181
187
|
if (created != pdPASS) {
|
|
@@ -492,6 +492,22 @@ void replayPresentCommand(const gea::platform::display::DisplayPresentCommand &c
|
|
|
492
492
|
command.fillTriangleRgb565.y2,
|
|
493
493
|
command.fillTriangleRgb565.color);
|
|
494
494
|
break;
|
|
495
|
+
case Type::FillTrianglesRgb565: {
|
|
496
|
+
// Depth-ordered batch (farthest-first). Opaque batches take the span-occlusion
|
|
497
|
+
// path so each pixel is written once; translucent ones must stay painter's order.
|
|
498
|
+
const auto &batch = command.fillTrianglesRgb565;
|
|
499
|
+
if (!batch.entries) break;
|
|
500
|
+
g_canvas.setGlobalAlpha(batch.alpha);
|
|
501
|
+
if (batch.alpha == 255) {
|
|
502
|
+
g_canvas.fillTrianglesOpaqueOccluded(batch.entries, batch.count, 0, 0);
|
|
503
|
+
} else {
|
|
504
|
+
for (int i = 0; i < batch.count; i++) {
|
|
505
|
+
const auto &t = batch.entries[i];
|
|
506
|
+
g_canvas.fillTriangle(t.x0, t.y0, t.x1, t.y1, t.x2, t.y2, t.color);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
495
511
|
case Type::FillCircleRgb565:
|
|
496
512
|
g_canvas.setGlobalAlpha(command.fillCircleRgb565.alpha);
|
|
497
513
|
g_canvas.fillCircle(command.fillCircleRgb565.x,
|
|
@@ -1080,6 +1096,15 @@ bool Display::start()
|
|
|
1080
1096
|
// dirty accumulator over the same framebuffer. On the main core this is g_canvas.
|
|
1081
1097
|
gea::framework::graphics::Canvas *Display::canvas() { return &replayCanvas(); }
|
|
1082
1098
|
|
|
1099
|
+
// The render layer binds canvas() onto a scratch buffer (retained snapshots for
|
|
1100
|
+
// screenshots/OTA, fused rasterized flushes) and calls this to point it back at
|
|
1101
|
+
// the draw framebuffer. bindPixels resets the dirty tracker, which is right
|
|
1102
|
+
// here: the union it held describes the scratch buffer, not the framebuffer.
|
|
1103
|
+
void Display::rebindCanvasToFramebuffer()
|
|
1104
|
+
{
|
|
1105
|
+
replayCanvas().bindPixels(g_drawFramebuffer, kWidth, kHeight);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1083
1108
|
bool Display::copySnapshotRgb565(std::uint16_t *dst, int pixelCapacity, int *width, int *height, bool)
|
|
1084
1109
|
{
|
|
1085
1110
|
if (width) *width = kWidth;
|
|
@@ -59,6 +59,6 @@ direct_dependencies:
|
|
|
59
59
|
- espressif/esp_lcd_co5300
|
|
60
60
|
- espressif/esp_lcd_panel_io_additions
|
|
61
61
|
- idf
|
|
62
|
-
manifest_hash:
|
|
62
|
+
manifest_hash: 4251b5a6af848c92c5fbc8b9dbb076a8b2a53c265de5eadaa6d4357945f77209
|
|
63
63
|
target: esp32s3
|
|
64
64
|
version: 3.0.0
|
|
@@ -8,6 +8,13 @@ include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_framework.cmake")
|
|
|
8
8
|
include("${GEA_EMBEDDED_ROOT}/targets/cmake/geatsc_generated_archive.cmake")
|
|
9
9
|
|
|
10
10
|
set(GEA_CUSTOM_TARGET_ACTIVE 0)
|
|
11
|
+
# The gea CLI passes the definition as -DGEA_BOARD_DEFINITION and also in the
|
|
12
|
+
# environment: IDF's requirement-extraction pass (cmake -P) runs before the -D
|
|
13
|
+
# arguments reach the cache, and a composed chip's own REQUIRES (the LEDC
|
|
14
|
+
# driver for an RGB panel's backlight, say) have to be visible in that pass.
|
|
15
|
+
if(NOT GEA_BOARD_DEFINITION AND DEFINED ENV{GEA_BOARD_DEFINITION})
|
|
16
|
+
set(GEA_BOARD_DEFINITION "$ENV{GEA_BOARD_DEFINITION}")
|
|
17
|
+
endif()
|
|
11
18
|
if(GEA_BOARD_DEFINITION)
|
|
12
19
|
# board.h and target.cmake for a custom board are generated by the gea CLI
|
|
13
20
|
# (gea build --board <alias>) into the build directory before configure.
|
|
@@ -513,7 +520,10 @@ if(GEA_CUSTOM_TARGET_ACTIVE)
|
|
|
513
520
|
# A composed board with no `chips.display` has none of that to drive, so
|
|
514
521
|
# GEA_CUSTOM_TARGET_DISPLAY_SOURCES carries display_headless.cpp instead:
|
|
515
522
|
# the same canvas-backed Display, flushing to memory rather than a panel.
|
|
516
|
-
|
|
523
|
+
# A parallel RGB panel is a different layer altogether: the LCD peripheral
|
|
524
|
+
# scans the framebuffer out and the rgb_panel binding IS the Display, so
|
|
525
|
+
# display.cpp (QSPI transport, chunked flush, TE) stays out of that build.
|
|
526
|
+
if(GEA_CUSTOM_TARGET_HAS_DISPLAY AND NOT GEA_CUSTOM_TARGET_DISPLAY_INTERFACE STREQUAL "rgb")
|
|
517
527
|
list(APPEND GEA_EMBEDDED_BOARD_SOURCES "${GEA_EMBEDDED_ROOT}/targets/esp32/display.cpp")
|
|
518
528
|
endif()
|
|
519
529
|
list(APPEND GEA_EMBEDDED_BOARD_SOURCES ${GEA_CUSTOM_TARGET_DISPLAY_SOURCES})
|
|
@@ -586,7 +596,10 @@ else()
|
|
|
586
596
|
# touch.cpp routes Touchscreen to the FT3168 controller. A board with no
|
|
587
597
|
# `chips.touch` gets touch_absent.cpp through the peripheral sources instead,
|
|
588
598
|
# so this only has to stop compiling the FT3168-bound file.
|
|
589
|
-
|
|
599
|
+
# touch.cpp is FT3168 glue specifically. A composed board with another
|
|
600
|
+
# controller (gt911) links a binding that answers Touchscreen itself; an
|
|
601
|
+
# older generated target.cmake names no driver and means FT3168.
|
|
602
|
+
if(NOT GEA_CUSTOM_TARGET_ACTIVE OR (GEA_CUSTOM_TARGET_HAS_TOUCH AND (NOT GEA_CUSTOM_TARGET_TOUCH_DRIVER OR GEA_CUSTOM_TARGET_TOUCH_DRIVER STREQUAL "ft3168")))
|
|
590
603
|
list(APPEND GEA_EMBEDDED_BOARD_SOURCES "touch.cpp")
|
|
591
604
|
endif()
|
|
592
605
|
if(GEA_EMBEDDED_CAPABILITY_NETWORK)
|
|
@@ -609,6 +622,9 @@ else()
|
|
|
609
622
|
endif()
|
|
610
623
|
if(GEA_CUSTOM_TARGET_ACTIVE)
|
|
611
624
|
list(APPEND GEA_EMBEDDED_BOARD_SOURCES ${GEA_CUSTOM_TARGET_PERIPHERAL_SOURCES})
|
|
625
|
+
# Components the composed chips' bindings include from (the catalog's
|
|
626
|
+
# per-adapter `requires`), beyond what this base links for its own.
|
|
627
|
+
list(APPEND GEA_EMBEDDED_TARGET_REQUIRES ${GEA_CUSTOM_TARGET_REQUIRES})
|
|
612
628
|
else()
|
|
613
629
|
list(APPEND GEA_EMBEDDED_BOARD_SOURCES
|
|
614
630
|
"${GEA_CHIPS}/power/axp2101/axp2101.cpp"
|
|
@@ -746,9 +762,17 @@ if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
|
|
|
746
762
|
set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
|
|
747
763
|
endif()
|
|
748
764
|
|
|
765
|
+
# The QSPI panels store byte-swapped RGB565 (panel endian); a composed board
|
|
766
|
+
# with a parallel RGB panel scans native order and says so in its own defines,
|
|
767
|
+
# which must not then meet a second definition on the same command line.
|
|
768
|
+
set(GEA_EMBEDDED_PIXEL_PANEL_ENDIAN_DEFINE GEA_EMBEDDED_PIXEL_PANEL_ENDIAN=1)
|
|
769
|
+
if("${GEA_CUSTOM_TARGET_COMPILE_DEFINITIONS}" MATCHES "GEA_EMBEDDED_PIXEL_PANEL_ENDIAN=")
|
|
770
|
+
set(GEA_EMBEDDED_PIXEL_PANEL_ENDIAN_DEFINE "")
|
|
771
|
+
endif()
|
|
772
|
+
|
|
749
773
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE
|
|
750
774
|
${GEA_CUSTOM_TARGET_COMPILE_DEFINITIONS}
|
|
751
|
-
|
|
775
|
+
${GEA_EMBEDDED_PIXEL_PANEL_ENDIAN_DEFINE}
|
|
752
776
|
GEA_CPP_ENABLE_REGEX=0
|
|
753
777
|
GEA_CPP_USE_TO_CHARS_DOUBLE=0
|
|
754
778
|
GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=${GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE}
|
|
@@ -22,6 +22,13 @@ namespace {
|
|
|
22
22
|
constexpr const char *kTag = "launcher_button";
|
|
23
23
|
constexpr gpio_num_t kGpio = gea::platform::board::launcherButton.pin;
|
|
24
24
|
constexpr int kActiveLevel = gea::platform::board::launcherButton.activeLevel;
|
|
25
|
+
// A board with no button leaves the pin GPIO_NUM_NC (-1); `1ULL << kGpio` on
|
|
26
|
+
// that constant is a negative shift the compiler rejects even though start()
|
|
27
|
+
// returns before using it, so the mask is formed behind a branch.
|
|
28
|
+
constexpr std::uint64_t pinMask(gpio_num_t pin)
|
|
29
|
+
{
|
|
30
|
+
return pin < 0 ? 0ULL : (1ULL << static_cast<unsigned>(pin));
|
|
31
|
+
}
|
|
25
32
|
constexpr int kDebounceMs = 50;
|
|
26
33
|
constexpr int kPollMs = 25;
|
|
27
34
|
constexpr int kLongPressMs = 800;
|
|
@@ -78,7 +85,7 @@ public:
|
|
|
78
85
|
gpio_reset_pin(kGpio);
|
|
79
86
|
|
|
80
87
|
gpio_config_t config = {
|
|
81
|
-
.pin_bit_mask =
|
|
88
|
+
.pin_bit_mask = pinMask(kGpio),
|
|
82
89
|
.mode = GPIO_MODE_INPUT,
|
|
83
90
|
.pull_up_en = GPIO_PULLUP_ENABLE,
|
|
84
91
|
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "esp32-s3-waveshare-touch-lcd-7",
|
|
3
|
+
"extends": "esp32-s3",
|
|
4
|
+
"adapter": "esp32-idf",
|
|
5
|
+
"mcu": "esp32s3",
|
|
6
|
+
|
|
7
|
+
"_comment": "Waveshare ESP32-S3-Touch-LCD-7: an ESP32-S3-WROOM-1-N16R8 (16MB quad flash, 8MB octal PSRAM) behind a 7-inch 800x480 parallel RGB panel with a GT911 touch controller. Pins and timings are the vendor's ESP-IDF demo (examples/ESP-IDF/09_lvgl_v9_demo/components/waveshare_rgb_lcd_port.h). Composed from the chip catalog; not yet verified on hardware.",
|
|
8
|
+
|
|
9
|
+
"flashSize": "16MB",
|
|
10
|
+
|
|
11
|
+
"_console": "The board has no USB-UART bridge on its USB-C port: that is the S3's native USB-Serial/JTAG, which is the base target's default. UART0 (TX GPIO43 / RX GPIO44) is also brought out on the header.",
|
|
12
|
+
|
|
13
|
+
"_psram": "N16R8 is 8MB octal PSRAM; the RGB panel's framebuffer (800x480x2 = 768KB, plus a back buffer) lives there.",
|
|
14
|
+
"psram": { "mode": "octal", "speed": 80 },
|
|
15
|
+
|
|
16
|
+
"buses": { "i2c": { "sda": 8, "scl": 9 } },
|
|
17
|
+
|
|
18
|
+
"chips": {
|
|
19
|
+
"display": {
|
|
20
|
+
"driver": "rgb_panel",
|
|
21
|
+
"interface": "rgb",
|
|
22
|
+
"width": 800,
|
|
23
|
+
"height": 480,
|
|
24
|
+
"pclkHz": 16000000,
|
|
25
|
+
"hsyncPulseWidth": 4, "hsyncBackPorch": 8, "hsyncFrontPorch": 8,
|
|
26
|
+
"vsyncPulseWidth": 4, "vsyncBackPorch": 8, "vsyncFrontPorch": 8,
|
|
27
|
+
"pclkActiveNeg": true,
|
|
28
|
+
"_pins": "data0-4 = B3-B7, data5-10 = G2-G7, data11-15 = R3-R7. The backlight is EXIO2 on the CH422G, so no GPIO is named here.",
|
|
29
|
+
"pins": {
|
|
30
|
+
"de": 5, "hsync": 46, "vsync": 3, "pclk": 7,
|
|
31
|
+
"data0": 14, "data1": 38, "data2": 18, "data3": 17, "data4": 10,
|
|
32
|
+
"data5": 39, "data6": 0, "data7": 45, "data8": 48, "data9": 47, "data10": 21,
|
|
33
|
+
"data11": 1, "data12": 2, "data13": 42, "data14": 41, "data15": 40
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"touch": {
|
|
37
|
+
"driver": "gt911",
|
|
38
|
+
"interface": "i2c",
|
|
39
|
+
"_pins": "Reset is EXIO1 on the CH422G; INT is GPIO4, which the binding also drives low across reset to fix the controller's I2C address at 0x5d.",
|
|
40
|
+
"pins": { "interrupt": 4 }
|
|
41
|
+
},
|
|
42
|
+
"expander": {
|
|
43
|
+
"driver": "ch422g",
|
|
44
|
+
"interface": "i2c",
|
|
45
|
+
"_outputs": "EXIO1 touch reset, EXIO2 backlight, EXIO3 panel reset, EXIO4 microSD chip-select, EXIO5 USB/CAN switch. initialOutputs 0x1e matches the vendor demo's steady state: resets released, backlight on, card deselected, USB selected.",
|
|
46
|
+
"initialOutputs": 30,
|
|
47
|
+
"outputs": { "touchReset": 1, "backlight": 2, "displayReset": 3 }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
"_controls": "The BOOT button is GPIO0, which the RGB bus uses as data6 (G3) on this board, so there is no launcher button.",
|
|
52
|
+
|
|
53
|
+
"partitions": {
|
|
54
|
+
"nvs": { "type": "data", "subtype": "nvs", "offset": "0x9000", "size": "0x6000" },
|
|
55
|
+
"otadata": { "type": "data", "subtype": "ota", "offset": "0xf000", "size": "0x2000" },
|
|
56
|
+
"phy_init": { "type": "data", "subtype": "phy", "offset": "0x11000", "size": "0x1000" },
|
|
57
|
+
"ota_0": { "type": "app", "subtype": "ota_0", "offset": "0x20000", "size": "0x600000" },
|
|
58
|
+
"ota_1": { "type": "app", "subtype": "ota_1", "offset": "0x620000","size": "0x600000" },
|
|
59
|
+
"storage": { "type": "data", "subtype": "spiffs", "offset": "0xC20000","size": "0x3E0000" }
|
|
60
|
+
}
|
|
61
|
+
}
|
package/targets.json
CHANGED
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
"esptoolChip": "esp32s3",
|
|
20
20
|
"ipcTaskStackSize": "4096"
|
|
21
21
|
},
|
|
22
|
+
"esp32-s3-waveshare-touch-lcd-7": {
|
|
23
|
+
"adapter": "esp32-idf",
|
|
24
|
+
"targetPath": "targets/esp32-s3-touch-amoled-2.06",
|
|
25
|
+
"definition": "targets/esp32-s3-waveshare-touch-lcd-7.json",
|
|
26
|
+
"flashSize": "16MB",
|
|
27
|
+
"appPlatform": "esp32",
|
|
28
|
+
"idfTarget": "esp32s3",
|
|
29
|
+
"esptoolChip": "esp32s3",
|
|
30
|
+
"ipcTaskStackSize": "4096"
|
|
31
|
+
},
|
|
22
32
|
"esp32-s3-touch-amoled-2.06": {
|
|
23
33
|
"adapter": "esp32-idf",
|
|
24
34
|
"targetPath": "targets/esp32-s3-touch-amoled-2.06",
|