Skip to content

H752: original LilyGO T5 E-Paper S3 Pro (v1.0-240810) board support#14

Closed
jrdntnnr wants to merge 1 commit into
clackups:copilot/implement-hebrew-language-supportfrom
jrdntnnr:h752-wip
Closed

H752: original LilyGO T5 E-Paper S3 Pro (v1.0-240810) board support#14
jrdntnnr wants to merge 1 commit into
clackups:copilot/implement-hebrew-language-supportfrom
jrdntnnr:h752-wip

Conversation

@jrdntnnr

Copy link
Copy Markdown
Contributor

What this adds

Support for the original LilyGO T5 E-Paper S3 Pro — the H752 / v1.0-240810 revision (4.7" ED047TC1, 960×540). This pre-H752-01 board has no PCA9535/TPS65185, so it can't use epdiy's epd_board_v7 path. Hardware-verified on the board: ink, partial local refresh, touch, side-key menu, power-off, RTL/Hebrew typing.

Everything is behind a new model + display-backend Kconfig (DRAFTLING_MODEL_LILYGO_T5_EPD_S3_PRO_H752 / DRAFTLING_DISPLAY_H752_EPD), selected only by sdkconfig.h752 — existing boards are unaffected.

Highlights

  • FastEPD display backend (vendored components/fastepd + display_h752.cpp): full 960×540 1-bit plane, partialUpdate local refresh for typing/deletes (no flash), full refresh on demand / every N partials. Includes a fix for a FastEPD bbepPartialUpdate DMA ping-pong bug (must clear both neutral row halves) that otherwise causes full-height vertical streaks under edited text.
  • Touch: GT911 calibrated for this panel (540×960 portrait reported, swap_xy + mirror_x); front capacitive touch-key wired to Back/Esc.
  • Power/keys: GPIO48 side key = Menu (injects F1). GPIO48 isn't an RTC IO on the S3, so standby uses light-sleep + gpio_wakeup + esp_restart (mirrors the reader firmware) instead of EXT0 deep sleep.
  • Editor: Esc auto-saves (named file in place, else a generated draft) instead of the discard prompt; RTL/Hebrew alignment + cursor via LV_BASE_DIR_AUTO and kb_layout_is_rtl().
  • Cross-board fix: sync_battery_labels() no-op stub for battery-less boards (was a latent build break on e.g. JC3248W535).

Why this targets the Hebrew branch (stacked PR)

This builds on the RTL/Hebrew/font work in #12, so it's stacked on copilot/implement-hebrew-language-support and shows only the single H752 commit. Once #12 merges I'll retarget this to main.

Rebasing onto current main is low-risk — a dry run showed #12 rebases onto main cleanly, and the H752 commit conflicts in only 3 files (touchscreen.cpp, main/main.cpp, main/Kconfig.projbuild), one hunk each, all trivial "keep both" against #11's GT911/wake changes (editor_ui.cpp auto-merges).

Known issue (does not block display/input)

A BLE HID esp_hidh_dev_open watchdog → LoadProhibited crash after a connect timeout exists on this board path; tracked separately. #13's conn-param fix may help and is independent of this diff.

Marked draft until #12 lands.

Throwaway snapshot of the original-H752 (v1.0-240810, 4.7" ED047TC1
960x540) port so the work is in git before rebasing onto main. Built
and hardware-verified on this board; NOT yet rebased.

What this adds (all behind the new H752 model/backend Kconfig, so the
existing boards are unaffected):
- New model DRAFTLING_MODEL_LILYGO_T5_EPD_S3_PRO_H752 + display backend
  DRAFTLING_DISPLAY_H752_EPD; selected only by sdkconfig.h752 /
  sdkconfig.defaults.h752. Original H752 has no PCA9535/TPS65185, so it
  cannot use epdiy's epd_board_v7 path.
- FastEPD display backend (components/fastepd vendored, +
  components/display/display_h752.cpp): full 960x540 1-bit plane,
  partialUpdate for local refresh (typing/deletes, no flash), GC16-style
  full refresh on force/huge/every-N partials. Patched a FastEPD
  bbepPartialUpdate DMA ping-pong bug (must clear BOTH neutral row
  halves) that caused full-height vertical streaks under edited text.
- Touch: GT911 calibrated for this panel (540x960 portrait reported,
  swap_xy=1 mirror_x=1), plus a GT911 touch-key callback wired to Esc
  (front "Back" button).
- Power: GPIO48 side key = Menu (injects F1); front touch key = Back.
  GPIO48 is not an RTC IO on the S3, so standby uses light-sleep +
  gpio_wakeup + esp_restart (mirrors the reader firmware) instead of
  EXT0 deep sleep.
- Editor: Esc auto-saves (named file in place, else generated draft)
  instead of the discard prompt; RTL/Hebrew alignment + cursor via
  LV_BASE_DIR_AUTO and kb_layout_is_rtl().
- Cross-board fix: sync_battery_labels() no-op stub for battery-less
  boards (was a latent build break on e.g. JC3248W535).

REBASE PLAN (this branch -> origin/main):
  Topology: this branch = PR clackups#12 head (8473be1) + the above, on
  fork-point d8ca6f2. origin/main is 14 commits ahead and does NOT yet
  contain PR clackups#12, so the rebase carries PR clackups#12 (Hebrew/fonts/RTL) AND
  this H752 work onto main.

  Conflict surface (4 files both sides touch):
    - components/touchscreen/touchscreen.cpp  HIGH: main's PR clackups#11
      reworked the same gt911_write_reg/poll_gt911/touchscreen_init that
      our touch-key callback touches. Real manual merge; keep BOTH our
      key callback AND main's GT911 normal-scan / address-drift recovery.
    - main/main.cpp  MODERATE: both edit app_main near the T5 sleep/wake
      path (main = gpio_hold/rtc latch release on wake; ours = H752
      pre-sleep + key init).
    - main/Kconfig.projbuild  LOW-MOD: mostly additive blocks; one shared
      region near EPD_BLACK_BACKGROUND / NO_KEYBOARD_SLEEP_SEC.
    - components/editor/editor_ui.cpp  LOW: main only touched
      apply_pending_connect_state (LVGL indev reset); our edits are in
      disjoint functions, should auto-merge.

  Free from main (no conflict, wanted): ble_keyboard.cpp PR clackups#13
  conn-param serialization fix (relevant to the open H752 BLE-HID
  open-watchdog crash), display_epdiy.cpp PR clackups#11, and PR clackups#11 GT911
  robustness.

Known-open issues (not addressed here):
- H752 BLE HID esp_hidh_dev_open watchdog -> LoadProhibited crash.
- M5 PaperS3 reboot-loops on stock main (epdiy epd_prep wedges both
  cores after BLE init); reproduced on pristine origin/main, so it is an
  upstream/epdiy issue, independent of this work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@clackups clackups deleted the branch clackups:copilot/implement-hebrew-language-support June 11, 2026 12:46
@clackups clackups closed this Jun 11, 2026
@jrdntnnr

Copy link
Copy Markdown
Contributor Author

Superseded by two focused PRs, both rebased onto current main: #15 (RTL alignment/cursor follow-up to #12) and #16 (original LilyGO T5 H752 board support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants