Skip to content

Add LILYGO T5 4.7 Inch E-Paper S3 - #668

Open
AdaSzi wants to merge 4 commits into
TactilityProject:mainfrom
AdaSzi:lilygo-t5-epd47-s3
Open

AdaSzi wants to merge 4 commits into
TactilityProject:mainfrom
AdaSzi:lilygo-t5-epd47-s3

Conversation

@AdaSzi

@AdaSzi AdaSzi commented Oct 1, 2026 •

Copy link
Copy Markdown

Adds the LILYGO T5 4.7 Inch E-Paper S3 as an incubating device: ESP32-S3-WROOM-1-N16R8, ED047TC1 960x540 panel, GT911 touch, PCF8563 RTC, SD card, battery sense. Product page: https://www.lilygo.cc/products/t5-4-7-inch-e-paper-v2-3 (PCB marking "Screen-4.7-S3 V2.4").

This board drives latch, start, output enable, mode and the panel power rails through a 74HCT4094 shift register. epdiy only has a render engine for that on the original ESP32 (I2S), not on the ESP32-S3, and its maintainers decided not to support this board (martinberlin/lv_port_esp32-epaper#11 (comment)).

So the device has its own minimal engine for this one panel in the device folder, as discussed in the review. It only contains what the display driver uses: the shift register control and power sequence, the CKV gate clock (RMT), the row transfer (LCD peripheral in i80 mode), the row by row update loop and the clear sequence. There is no dependency change: Tactility/idf_component.yml is the same as upstream and PaperS3 keeps using epdiy as before.

Display

  • t5s3_epd.cpp/.h (about 600 lines), t5s3_epd_rows.h (row conversion, no hardware access) and t5s3_epd_waveform.h (waveform table). The static RAM of the engine is about 1.3 KB.
  • t5s3_display.cpp is the Tactility driver (derived from the PaperS3 one) with the same quality/fast policy.
  • Three update modes: fast (black and white, for typing and scrolling), quality (16 levels, partial updates) and full (16 levels with flashing of white pixels, used for the clear and the refresh).
  • The pixel clock is a devicetree property (pixel-clock-hz, default 10 MHz).

Licensing

The four engine files are derived from epdiy (LGPL v3.0) and are marked LGPL-3.0-or-later, with an entry in THIRD-PARTY-NOTICES.md. The display driver, devicetree and binding are Apache-2.0.

Testing

  • Builds with ESP-IDF 6.1.
  • Tested on a LILYGO T5 4.7 Inch E-Paper S3 (V2.4): boots, display, touch, scrolling, WiFi screens and typing on the keyboard. A fast update of a tile takes 30 to 60 ms and a full quality refresh about 1.2 s.
  • The row conversion and the register writes, pulses and row transfers of the engine were also compared with epdiy's own code on a PC. Those host tests are not part of this PR.
  • PaperS3: remains unchanged

Known gaps

  • Fullscreen dashboard apps will be useful even if Tactility itself is not really optimised for E-Ink displays yet.
  • Fast updates are black and white only, so grays come back with the next quality update or the refresh Tactility does after a few seconds without input.
  • The blinking text cursor causes a fast update every 500 ms.
  • Battery reading is uncalibrated, no buttons are mapped, and user data is on internal flash.

Summary by CodeRabbit

  • New Features
    • Added support for the LILYGO T5 4.7-inch E-Paper S3 display, including grayscale rendering with fast and quality update modes.
    • Added device support for Wi-Fi, Bluetooth, touch input, an SD card, a real-time clock, and battery sensing.

ESP32-S3 e-paper board (V2.3/V2.4, ED047TC1 960x540) with GT911 touch, PCF8563 RTC, SD card and battery sense. The display driver is derived from the PaperS3 one and uses epdiy's LILYGO T5 4.7 S3 board with the row-by-row render engine on the S3. That engine is not in upstream epdiy, so the epdiy dependency points at AdaSzi's fork of 2.1.3 (tag 2.1.3-t5s3.1). The new option is disabled by default and other boards build the same as before.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

Adds device configuration and module support for the LILYGO T5 4.7-inch E-Paper S3. Adds an ED047TC1 driver with a 4-bit framebuffer, fast and quality update modes, and panel power and clear operations. The display adapter converts luminance for the panel and selects refresh behavior based on update area and refresh state.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to e14e9

A failed initial clear can leave the display in an incorrect state while startup reports success. Propagate that failure before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for the LILYGO T5 4.7 Inch E-Paper S3 device.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8e9664de-f825-42ac-98bc-10a657c7f6d0

📥 Commits

Reviewing files that changed from the base of the PR and between 5bac1ad and dce08f4.

📒 Files selected for processing (11)
  • Devices/lilygo-t5-epd47-s3/CMakeLists.txt
  • Devices/lilygo-t5-epd47-s3/LICENSE-Apache-2.0.md
  • Devices/lilygo-t5-epd47-s3/bindings/lilygo,t5s3-display.yaml
  • Devices/lilygo-t5-epd47-s3/device.properties
  • Devices/lilygo-t5-epd47-s3/lilygo,t5-epd47-s3.dts
  • Devices/lilygo-t5-epd47-s3/module.yaml
  • Devices/lilygo-t5-epd47-s3/source/bindings/t5s3_display.h
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.cpp
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.h
  • Devices/lilygo-t5-epd47-s3/source/module.cpp
  • Tactility/idf_component.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.cpp Outdated
AdaSzi added 2 commits October 2, 2026 00:21
The hold deadline was compared with a plain less-than, so a deadline left
from just before the 32 bit tick counter wraps kept every update in
quality mode. Compare the signed difference, treat 0 as no hold and clear
the deadline when the session cap is reached.
Use a built-in e-paper engine in the T5 4.7 Inch E-Paper S3 device Replaces the epdiy dependency with a minimal engine in the device folder. It only has what the display driver uses: the shift register control, the CKV pulses (RMT), the row transfer (LCD peripheral in i80 mode), the row by row update loop and the clear sequence.

There are three update modes. Fast draws black and white only. Quality draws 16 levels and leaves white pixels that stay white alone, which is used for partial updates. Full also flashes those white pixels, which is used for the clear and the refresh. Without that split, partial quality updates left faint vertical lines on the screen.

A fast update of a tile takes about 30 to 60 ms and a full quality refresh about 1.2 s. The two driver files are built with -O2, rows are converted 8 pixels at a time and rows without changes are skipped with one train of pulses.

The row conversion has no hardware access. The pixel clock is a devicetree property (default 10 MHz). The engine and the quality waveform are derived from epdiy and are marked LGPL v3.0 or later, with a notice in THIRD-PARTY-NOTICES.md.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 63d4c784-91c7-496b-8d34-18ac93877087

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffd807 and 6453487.

📒 Files selected for processing (11)
  • Devices/lilygo-t5-epd47-s3/CMakeLists.txt
  • Devices/lilygo-t5-epd47-s3/bindings/lilygo,t5s3-display.yaml
  • Devices/lilygo-t5-epd47-s3/device.properties
  • Devices/lilygo-t5-epd47-s3/lilygo,t5-epd47-s3.dts
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.cpp
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.h
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.cpp
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.h
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd_rows.h
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd_waveform.h
  • THIRD-PARTY-NOTICES.md
💤 Files with no reviewable changes (1)
  • Devices/lilygo-t5-epd47-s3/device.properties

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.cpp Outdated
Comment thread Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.cpp Outdated
A timeout while waiting for a transfer or a pulse only set a flag, so the rest of the update still waited for the full limit on every row. The row, phase and clear loops and the wait itself now stop once an update has failed, so a lost interrupt costs one timeout.

A failed update no longer copies its rows to the back buffer, so the next update draws them again.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Propagate a failed panel clear from start(). · t5s3_display.cpp:271-278

Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_display.cpp:271-278
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Propagate a failed panel clear from start().

t5s3_epd_clear() can return false when the engine fails during the full clear update. start() ignores that result, logs successful initialization, and returns ERROR_NONE. The driver can therefore report successful startup while the panel clear did not complete.

Suggested fix
     power_on(internal);
-    t5s3_epd_clear();
+    if (!t5s3_epd_clear()) {
+        t5s3_epd_deinit();
+        device_set_driver_data(device, nullptr);
+        free(internal);
+        return ERROR_RESOURCE;
+    }

     LOG_I(TAG, "Initialized (%dx%d)", T5S3_EPD_WIDTH, T5S3_EPD_HEIGHT);

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ed350322-91b1-4074-9029-6771b42ae599

📥 Commits

Reviewing files that changed from the base of the PR and between 6453487 and e14e95b.

📒 Files selected for processing (1)
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • Devices/lilygo-t5-epd47-s3/source/drivers/t5s3_epd.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

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.

1 participant