Skip to content

Add LILYGO T-Deck Max variant#10680

Draft
h3lix1 wants to merge 1 commit into
meshtastic:developfrom
h3lix1:codex/add-t-deck-max-variant
Draft

Add LILYGO T-Deck Max variant#10680
h3lix1 wants to merge 1 commit into
meshtastic:developfrom
h3lix1:codex/add-t-deck-max-variant

Conversation

@h3lix1

@h3lix1 h3lix1 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a LILYGO T-Deck Max ESP32-S3 variant that follows the T-Deck Pro shape where the hardware matches, then wires in the Max-specific power expander, CST328/HynTouch touch controller, SY6970 charger, frontlight, ES8311 audio path, DRV2605 haptics rail, SD, GPS, keyboard, and internal antenna default.

This firmware PR depends on the protobuf hardware-model PR: meshtastic/protobufs#942

Why this is necessary

The T-Deck Max is close enough to T-Deck Pro to reuse its e-ink/keyboard behavior, but its board control is materially different. The Max routes core peripherals through an XL9555 expander, uses SY6970 charging instead of BQ25896 on the tested hardware, adds an e-paper frontlight, exposes three capacitive bezel keys, and needs the LoRa antenna select pinned to the internal antenna for the first implementation.

Without a dedicated variant, the firmware either reports the wrong hardware model or leaves important rails and reset lines in vendor-default states.

What changed

  • Add env:t-deck-max with hardware model 139, T-Deck Pro e-ink geometry, 16 MB flash, PSRAM, SD, GPS, TCA8418 keyboard, DRV2605 haptics, ES8311 audio, and the local HynTouch driver sources.
  • Add T_DECK_MAX architecture mapping to meshtastic_HardwareModel_T_DECK_MAX.
  • Add T-Deck Max pin definitions from the vendor pinmap and board header.
  • Initialize the XL9555 early, keep the LTE modem rail off, enable LoRa/GPS/IMU/touch/keyboard/haptics rails, and select the internal antenna.
  • Reuse T-Deck Pro keyboard handling and GDEQ031T10 e-ink model.
  • Add a guarded e-ink frontlight capability using DeviceUIConfig.screen_brightness.
  • Add SY6970 support to the existing HAS_PPM charger path while preserving the BQ25896 path.
  • Add ES8311 setup and only enable the external amplifier around audio playback.
  • Add CST328/HynTouch coordinate touch plus three bezel-key events.
  • Add T-Deck-Max-gated deep-sleep wake setup for the keyboard interrupt.
flowchart LR
    A["ESP32-S3"] --> B["XL9555 expander"]
    B --> C["LoRa rail + internal antenna"]
    B --> D["GPS / IMU / haptics rails"]
    B --> E["Touch + keyboard reset"]
    B --> F["ES8311 select + amp enable"]
    A --> G["E-ink + PWM frontlight"]
    A --> H["TCA8418 keyboard"]
    A --> I["CST328/HynTouch"]
    A --> J["SY6970 + BQ27220"]
Loading

How it works

variants/esp32s3/t-deck-max/variant.cpp runs before the normal board bring-up. It parks chip-select lines high, starts the XL9555, enables only the rails needed for Meshtastic runtime, and leaves the A7682E modem power off. src/platform/extra_variants/t_deck_max/variant.cpp then finishes touch and audio setup after the base platform is initialized.

The touch driver keeps coordinate touch separate from the three bezel keys. The current key mapping is vendor-order based: heart -> user/action, circle -> select, paper airplane -> send ping.

The frontlight path is opt-in through HAS_EINK_FRONTLIGHT so existing boards that use PIN_EINK_BL as panel power are not affected.

Validation

  • trunk fmt on all touched source and variant files.
  • git diff --check
  • platformio project config --json-output shows env:t-deck-max.
  • ~/.platformio/penv/bin/platformio run -e t-deck-max

Reviewer notes

The generated firmware header contains T_DECK_MAX = 139 so this draft can compile once the protobuf change lands or the generated outputs are refreshed from that protobuf commit. The protobufs submodule pointer is intentionally not moved to a fork-only commit.

Known dependency: until meshtastic/protobufs#942 lands and firmware regenerates from that protobuf source, protobufs/meshtastic/mesh.proto in this checkout will not contain T_DECK_MAX. That is expected for this draft split; the final firmware PR should update the submodule/generated outputs after the protobuf PR is merged upstream.

LTE/A7682E runtime support is intentionally out of scope. The modem pins and expander controls are named, but the modem rail stays off by default.

@github-actions github-actions Bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant