Skip to content

feat: add support for Waveshare 3.52" EPD (EPD3IN52)#254

Closed
cogwheel886 wants to merge 3 commits intorust-embedded-community:mainfrom
cogwheel886:feat/epd3in52
Closed

feat: add support for Waveshare 3.52" EPD (EPD3IN52)#254
cogwheel886 wants to merge 3 commits intorust-embedded-community:mainfrom
cogwheel886:feat/epd3in52

Conversation

@cogwheel886
Copy link
Copy Markdown

Waveshare 3.52" E-Paper Display (EPD3IN52)

Adds driver support for the Waveshare 3.52" e-paper display (360×240px, UC8179 controller).

Display characteristics

This display has an unusual refresh sequence not seen in other supported displays — display_frame() must explicitly send LUT waveform tables before triggering refresh. Most Waveshare displays handle this internally; the 3.52" does not. Additionally, the waveform tables alternate between two configurations (R22/R23) on each refresh cycle via a lut_flag: bool field on the driver struct.

Hardware verification

  • Tested on Raspberry Pi 5 (RP1 GPIO controller, lgpio backend)
  • IS_BUSY_LOW: true confirmed empirically
  • LUT waveform tables transcribed from Waveshare Python reference driver and verified against hardware
  • Init sequence register values verified against hardware

What's included

  • command.rs: 17 SPI commands for the UC8179 controller
  • constants.rs: 10 LUT waveform tables (5× GC global clear, 5× DU differential update)
  • mod.rs: Full driver implementation with alternating waveform logic
  • Display3in52 type alias under #[cfg(feature = "graphics")]
  • 2 new tests: epd_size and command_addr
  • All 56 tests passing (54 original + 2 new)

Not yet implemented

  • update_partial_frame() — marked todo!(), hardware validation pending
  • DU (differential update) LUT path — tables are present in constants.rs but not yet wired into a fast-refresh code path

References

Hardware validation ongoing — opening as draft pending display refresh test on target hardware.

cogwheel886 added 3 commits April 11, 2026 01:53
- 240x360 resolution, UC8179 controller
- Hardware-verified LUT waveform tables (GC and DU)
- Alternating R22/R23 waveform tables in display_frame()
- IS_BUSY_LOW: true, verified on Raspberry Pi 5 with lgpio
- Includes Display3in52 type alias for graphics feature
- 56 unit tests passing (54 original + 2 new)
- Fix clear_frame() sending 8x too many bytes (WIDTH*HEIGHT → buffer_len)
- Fix refresh command: 0x12 → 0x17 + 0xA5 matching Python reference
- Rename EPD3in52 → Epd3in52 (naming convention)
@cogwheel886 cogwheel886 marked this pull request as ready for review April 12, 2026 01:31
@cogwheel886
Copy link
Copy Markdown
Author

Consolidating into #255 which now includes the UC8253 (3.52") driver alongside the SSD1680 (2.13" V4) driver. Both share interface.rs changes and have been through the same hardware-verified fix passes. Keeping them in separate PRs risks divergence — the 3.52" driver fixes in #255 are not present on this branch.

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