feat(boards): Add Waveshare ESP32-C6-Touch-AMOLED-2.16 support

- Add complete board support for Waveshare ESP32-C6-Touch-AMOLED-2.16 with SH8601 display driver
- Implement board initialization with AXP2101 PMU rail configuration for LCD and touch power
- Add display driver for SH8601 QSPI panel (480×480 resolution)
- Add CST9217 touch controller support via I2C
- Add QMI8658 IMU initialization and sensor reading
- Add AXP2101 power management and battery monitoring
- Add input handling for BOOT button (GPIO 9)
- Configure PlatformIO environment with C6-specific build flags and 16 MB flash layout
- Update capability flags documentation to clarify BOARD_HAS_PSRAM build-flag macro usage
- C6 has no external PSRAM; shared code gates on this flag to use internal SRAM and reduce LVGL buffer sizes
- Screenshot capture disabled on this board due to internal SRAM constraints
This commit is contained in:
Alexander Wennerstrøm
2026-05-24 08:36:53 +02:00
parent c25e89672a
commit ab8b64d949
12 changed files with 479 additions and 5 deletions
+16 -2
View File
@@ -103,11 +103,25 @@ void splash_init(lv_obj_t *parent) {
int min_dim = (c.width < c.height) ? c.width : c.height;
cell = min_dim / GRID; // fits within the smaller display dimension
if (cell < 4) cell = 4;
#ifdef BOARD_HAS_PSRAM
const uint32_t canvas_caps = MALLOC_CAP_SPIRAM;
#else
// Without PSRAM the full 480×480 RGB565 canvas (460 KB) won't fit. Cap
// the canvas so the buffer stays under ~80 KB, leaving the rest of
// internal SRAM free for LVGL, NimBLE, and the audio/PMU stacks. The
// canvas is centered, so the cost is extra black border around the
// pixel art — not cropping.
const uint32_t canvas_caps = MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT;
const int MAX_CELL_NO_PSRAM = 10; // 10*20=200; 200*200*2=78 KB
if (cell > MAX_CELL_NO_PSRAM) cell = MAX_CELL_NO_PSRAM;
#endif
canvas_w = GRID * cell;
canvas_h = GRID * cell;
canvas_buf = (uint16_t*)heap_caps_malloc(canvas_w * canvas_h * 2, MALLOC_CAP_SPIRAM);
row_buf = (uint16_t*)heap_caps_malloc(canvas_w * 2, MALLOC_CAP_SPIRAM);
canvas_buf = (uint16_t*)heap_caps_malloc(canvas_w * canvas_h * 2, canvas_caps);
row_buf = (uint16_t*)heap_caps_malloc(canvas_w * 2, canvas_caps);
if (!canvas_buf || !row_buf) {
Serial.println("splash: failed to alloc canvas buffer");
return;