Port the firmware to a second Waveshare AMOLED board variant alongside
the original 2.16" / 480×480. Selection is at build time via a board
macro; both envs continue to build and flash independently.
Hardware delta vs AMOLED-2.16:
* Display: SH8601 QSPI (vs CO5300), 368×448 portrait (vs 480² square),
SCLK on GPIO 11 (vs 38), RST routed through an XCA9554 I/O expander
(vs direct GPIO).
* Touch: FT3168 @ 0x38 (vs CST9220 @ 0x5A). Driven by a ~30-line
inline FocalTech-protocol reader in main.cpp — Waveshare's
Arduino_DriveBus library is GPLv3 and would force the project's
license, which the README explicitly avoids.
* I/O expander: new XCA9554/PCA9554 @ I2C 0x20 gates LCD_RST, TP_RST,
audio amp enable, and the PWR button. Wrapped in io_expander.{h,cpp}.
Must initialize BEFORE display/touch or both stay in reset.
* PMU + IMU: same AXP2101 + QMI8658 as 2.16, so power.cpp/imu.cpp
largely reuse. IMU is initialized for I2C bus health but rotation
is fixed at 0° (the portrait panel doesn't benefit from auto-rotate
and the strip-rotation CPU path is excluded entirely).
* Buttons: only BOOT (GPIO 0) is a direct GPIO; PWR is read via
XCA9554 EXIO4 polling. No third button — the AMOLED-2.16's
Shift+Tab key (GPIO 18) is dropped for this board.
* Flash: 16MB (vs 8MB), partition table set to default_16MB.csv.
Code structure:
* display_cfg.h hosts a #ifdef BOARD_AMOLED_18 / #else / #endif split
with a PlatformDisplay typedef so call sites elsewhere stay clean.
* main.cpp, power.cpp, ui.cpp, splash.cpp gate board-specific bits on
the same macro. Layout constants (panel heights, content Y, font
choices on the Bluetooth screen) compress for the 368×448 portrait
footprint so two usage panels + bottom animation label fit without
horizontal overflow.
* Splash scales the 20×20 pixel-art grid to 360×360 (CELL=18 vs 24)
and centers in the portrait canvas.
* Old AMOLED-2.16 env is unchanged at the source level (gated under
#ifndef BOARD_AMOLED_18) and continues to compile + flash on the
original hardware.
CLAUDE.md updated with the two-board pin maps, build/flash commands
for both envs (macOS + Linux device paths), and the per-board gotchas.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
98 lines
2.9 KiB
INI
98 lines
2.9 KiB
INI
[env:waveshare_amoled_216]
|
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.38-1/platform-espressif32.zip
|
|
board = esp32-s3-devkitc-1
|
|
framework = arduino
|
|
board_build.arduino.memory_type = qio_opi
|
|
upload_speed = 921600
|
|
monitor_speed = 115200
|
|
|
|
build_flags =
|
|
-DBOARD_AMOLED_216
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
|
-DBOARD_HAS_PSRAM
|
|
; AXP2101 PMU
|
|
-DXPOWERS_CHIP_AXP2101
|
|
; NimBLE config — peripheral, 2 simultaneous connections so the OS can
|
|
; hold the HID link (Space key from BOOT button) while the daemon holds
|
|
; its own connection for the custom data service.
|
|
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER=1
|
|
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL=1
|
|
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL=0
|
|
-DCONFIG_BT_NIMBLE_ROLE_OBSERVER=0
|
|
-DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
|
|
; LVGL config via build flags
|
|
-DLV_CONF_SKIP
|
|
-DLV_COLOR_DEPTH=16
|
|
-DLV_USE_LOG=0
|
|
-DLV_USE_BAR=1
|
|
-DLV_USE_LABEL=1
|
|
-DLV_USE_ARC=1
|
|
-DLV_USE_BTN=1
|
|
-DLV_USE_LINE=1
|
|
-DLV_USE_OBJ=1
|
|
-DLV_USE_IMG=1
|
|
-DLV_USE_IMAGE=1
|
|
-DLV_USE_ANIMIMG=0
|
|
-DLV_TICK_CUSTOM=1
|
|
-DLV_USE_SNAPSHOT=1
|
|
|
|
lib_deps =
|
|
moononournation/GFX Library for Arduino@^1.5.6
|
|
lewisxhe/SensorLib@^0.2.6
|
|
lewisxhe/XPowersLib@^0.2.7
|
|
lvgl/lvgl@^9.2.0
|
|
bblanchon/ArduinoJson@^7.0.0
|
|
h2zero/NimBLE-Arduino@^2.1.1
|
|
|
|
|
|
[env:waveshare_amoled_18]
|
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.38-1/platform-espressif32.zip
|
|
board = esp32-s3-devkitc-1
|
|
framework = arduino
|
|
board_build.arduino.memory_type = qio_opi
|
|
board_upload.flash_size = 16MB
|
|
board_upload.maximum_size = 16777216
|
|
board_build.partitions = default_16MB.csv
|
|
upload_speed = 921600
|
|
monitor_speed = 115200
|
|
|
|
build_flags =
|
|
-DBOARD_AMOLED_18
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
|
-DBOARD_HAS_PSRAM
|
|
; AXP2101 PMU is present on the AMOLED-1.8 board too (battery is optional kit add-on)
|
|
-DXPOWERS_CHIP_AXP2101
|
|
; NimBLE config — peripheral, 2 simultaneous connections so the OS can
|
|
; hold the HID link (Space key from BOOT button) while the daemon holds
|
|
; its own connection for the custom data service.
|
|
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER=1
|
|
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL=1
|
|
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL=0
|
|
-DCONFIG_BT_NIMBLE_ROLE_OBSERVER=0
|
|
-DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
|
|
; LVGL config via build flags
|
|
-DLV_CONF_SKIP
|
|
-DLV_COLOR_DEPTH=16
|
|
-DLV_USE_LOG=0
|
|
-DLV_USE_BAR=1
|
|
-DLV_USE_LABEL=1
|
|
-DLV_USE_ARC=1
|
|
-DLV_USE_BTN=1
|
|
-DLV_USE_LINE=1
|
|
-DLV_USE_OBJ=1
|
|
-DLV_USE_IMG=1
|
|
-DLV_USE_IMAGE=1
|
|
-DLV_USE_ANIMIMG=0
|
|
-DLV_TICK_CUSTOM=1
|
|
-DLV_USE_SNAPSHOT=1
|
|
|
|
lib_deps =
|
|
; 1.6.4+ ships Arduino_SH8601 in mainline
|
|
moononournation/GFX Library for Arduino@^1.6.4
|
|
; SensorLib still used for QMI8658 IMU on AMOLED-1.8
|
|
lewisxhe/SensorLib@^0.2.6
|
|
lewisxhe/XPowersLib@^0.2.7
|
|
lvgl/lvgl@^9.2.0
|
|
bblanchon/ArduinoJson@^7.0.0
|
|
h2zero/NimBLE-Arduino@^2.1.1
|