feat: rework GxEPDDisplay for rotation support and integrate e-ink build

- Remove fixed 128×128 virtual space and scaling; use 1:1 pixel mapping
- Display dimensions derived from panel native size + DISPLAY_ROTATION
- setCursor compensates for GFX font baseline offset (ascender per font size)
- Add getLineHeight() / getCharWidth() overrides for FreeSans fonts
- New envs: landscape (250×122) and portrait (122×250), BLE and dual variants
- Integrate all wio-tracker-l1-improvements features into e-ink build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-20 19:12:17 +02:00
parent 67bccd3dd4
commit cffe960f3f
3 changed files with 120 additions and 102 deletions

View File

@@ -1,12 +1,14 @@
[WioTrackerL1Eink]
extends = nrf52_base
board = seeed-wio-tracker-l1
board_build.ldscript = boards/nrf52840_s140_v7.ld
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
board_upload.maximum_size = 708608
build_flags = ${nrf52_base.build_flags}
${sensor_base.build_flags}
-I lib/nrf52/s140_nrf52_7.3.0_API/include
-I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52
-I variants/wio-tracker-l1
-I examples/companion_radio/ui-new
-D WIO_TRACKER_L1
-D WIO_TRACKER_L1_EINK
-D USE_SX1262
@@ -15,57 +17,68 @@ build_flags = ${nrf52_base.build_flags}
-D LORA_TX_POWER=22
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D PIN_OLED_RESET=-1
-D EINK_DISPLAY_MODEL=GxEPD2_213_B74
-D EINK_SCALE_X=1.953125f
-D EINK_SCALE_Y=1.28f
-D EINK_X_OFFSET=0
-D EINK_Y_OFFSET=10
-D DISPLAY_ROTATION=1
-D DISABLE_DIAGNOSTIC_OUTPUT
-D AUTO_OFF_MILLIS=0
-D GPS_BAUD_RATE=9600
-D ENV_PIN_SDA=PIN_WIRE1_SDA
-D ENV_PIN_SCL=PIN_WIRE1_SCL
-D DISABLE_DIAGNOSTIC_OUTPUT
-D AUTO_OFF_MILLIS=0
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D DISPLAY_CLASS=GxEPDDisplay
-D UI_HAS_JOYSTICK=1
-D UI_HAS_JOYSTICK_UPDOWN=1
-D PIN_BUZZER=12
-D QSPIFLASH=1
-D FIRMWARE_PLUS_BUILD=1
-D UI_SENSORS_PAGE=1
-D BLE_PIN_CODE=123456
build_src_filter = ${nrf52_base.build_src_filter}
+<WioTrackerL1Board.cpp>
+<../variants/wio-tracker-l1>
+<helpers/ui/GxEPDDisplay.cpp>
+<helpers/sensors>
lib_deps= ${nrf52_base.lib_deps}
${sensor_base.lib_deps}
adafruit/Adafruit GFX Library @ ^1.12.1
zinggjm/GxEPD2 @ 1.6.2
bakercp/CRC32 @ ^2.0.0
[env:WioTrackerL1Eink_companion_radio_ble]
extends = WioTrackerL1Eink
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
board_upload.maximum_size = 708608
build_flags = ${WioTrackerL1Eink.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
-D DISPLAY_CLASS=GxEPDDisplay
-D UI_HAS_JOYSTICK=1
-D PIN_BUZZER=12
-D QSPIFLASH=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D UI_RECENT_LIST_SIZE=6
-D UI_SENSORS_PAGE=1
-D DUAL_SERIAL
build_src_filter = ${WioTrackerL1Eink.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<helpers/nrf52/SerialBLEInterface.cpp>
+<helpers/sensors>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${WioTrackerL1Eink.lib_deps}
lib_deps = ${nrf52_base.lib_deps}
${sensor_base.lib_deps}
adafruit/Adafruit GFX Library @ ^1.12.1
adafruit/RTClib @ ^2.1.3
zinggjm/GxEPD2 @ 1.6.2
bakercp/CRC32 @ ^2.0.0
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0
debug_tool=stlink
; Landscape: 250×122 px (physical panel rotated 90°)
[env:WioTrackerL1Eink_companion_radio_ble_landscape]
extends = WioTrackerL1Eink
build_flags = ${WioTrackerL1Eink.build_flags}
-D DISPLAY_ROTATION=1
extra_scripts = post:create-uf2.py
; Portrait: 122×250 px (physical panel in native orientation)
[env:WioTrackerL1Eink_companion_radio_ble_portrait]
extends = WioTrackerL1Eink
build_flags = ${WioTrackerL1Eink.build_flags}
-D DISPLAY_ROTATION=0
extra_scripts = post:create-uf2.py
; Dual BLE+USB — landscape
[env:WioTrackerL1Eink_companion_radio_dual_landscape]
extends = WioTrackerL1Eink
build_flags = ${WioTrackerL1Eink.build_flags}
-D DISPLAY_ROTATION=1
-D DUAL_SERIAL=1
extra_scripts = post:create-uf2.py
; Dual BLE+USB — portrait
[env:WioTrackerL1Eink_companion_radio_dual_portrait]
extends = WioTrackerL1Eink
build_flags = ${WioTrackerL1Eink.build_flags}
-D DISPLAY_ROTATION=0
-D DUAL_SERIAL=1
extra_scripts = post:create-uf2.py