Skip to content
Get started

Parallel E-Paper

The epaper_parallel display platform drives e-paper panels that have no controller chip: the ESP32-S3 sends each row of pixel commands to the panel’s source drivers over a parallel bus and steps its gate drivers itself, in the way the epdiy project does. The panels show 16 gray levels.

The platform needs:

  • an ESP32-S3, as it uses the S3’s LCD peripheral,
  • PSRAM, which holds the image and the frames sent to the panel,
  • a TPS65185 component, which powers the panel during each update.

The platform sets the ESP32-S3 data cache to 64 KB with 64-byte lines; with the default cache size the panel data cannot be copied out of PSRAM fast enough.

display:
- platform: epaper_parallel
model: lilygo-t5-s3-pro
lambda: |-
it.filled_circle(it.get_width() / 2, it.get_height() / 2, 100, Color::BLACK);
ModelBoardPanelSize
lilygo-t5-s3-proLilyGo T5 E-Paper S3 ProED047TC1960x540

A model sets the size and all LCD pins, which can each be changed in the configuration.

An update takes about half a second. A full update first drives the whole panel dark and then light to clear any ghost of the earlier image, so the panel flashes. The other updates change only the pixels whose gray level changes, with no flash. Every full_update_every updates, a full update is done; the first update after boot is always full. A partial update is skipped when the image has not changed, and it is not counted toward full_update_every.

Black, white and grays are taken from the brightness of the drawing color: Color::BLACK is black, Color::WHITE is white, and gray colors give the 14 gray levels between them. The display is cleared to white.

Draw only from the display’s lambda or pages, which run before an update starts. Anything drawn while an update runs changes the image half way through it, and those pixels are not redrawn by the following partial updates. With LVGL, set update_when_display_idle: true on the lvgl component and update_interval: never on the display, so LVGL draws only between updates:

display:
- platform: epaper_parallel
model: lilygo-t5-s3-pro
update_interval: never
lvgl:
update_when_display_idle: true
  • model (Required): The model of the panel. See the table above.
  • tps65185_id (Optional, ID): The ID of the TPS65185 that powers the panel.
  • oe_pin (Optional, Pin Schema): The pin that enables the panel’s driver outputs. It is high during an update.
  • mode_pin (Optional, Pin Schema): The panel’s MODE pin. It is high during an update.
  • full_update_every (Optional, int): The number of updates from one full update to the next, from 1 to 1000. Defaults to 10.
  • update_interval (Optional, Time): The interval to redraw the screen. Defaults to 60s; an update that falls due while the previous one is still running is done when that one ends.
  • lambda (Optional, lambda): The lambda to use for rendering the content on the display. See Display Rendering Engine for more information.
  • pages (Optional, list): Show pages instead of a single lambda. See Display Pages.
  • rotation (Optional): Rotate the display presentation in software. Choose one of 0°, 90°, 180°, or 270°. Every rotation draws at the same speed.
  • transform (Optional): Mirror the image, for a panel mounted the other way round. The rotation is applied after it.
    • mirror_x (Optional, boolean): Mirror the image left to right. Defaults to false.
    • mirror_y (Optional, boolean): Mirror the image top to bottom. Defaults to false.
  • id (Optional, ID): Manually specify the ID used for code generation.

Advanced options, set by the model:

  • width and height (Optional, int): The size of the panel in pixels. The width must be a multiple of 16 from 32 to 2048, and the height from 8 to 1004.
  • data_pins (Optional, list of 8 pins): The panel’s D0 to D7 data lines.
  • pclk_pin (Optional, internal pin): The source driver clock (CKH, XCL).
  • le_pin (Optional, internal pin): The source driver latch (LE, XLE).
  • sph_pin (Optional, internal pin): The source driver start pulse (SPH, XSTL).
  • ckv_pin (Optional, internal pin): The gate driver clock (CKV).
  • stv_pin (Optional, internal pin): The gate driver start pulse (STV, SPV).
  • pclk_frequency (Optional, frequency): The pixel clock, from 1MHz to 40MHz. Defaults to 20MHz.
  • ckv_high_clocks (Optional, int): How long, in pixel clocks, each row is driven in each frame. A larger value makes gray levels darker. A multiple of 4, at most a quarter of the width minus 4; defaults to 60.
  • clear_frames (Optional, int): The number of frames that drive the panel dark, and then light, at the start of a full update. Changed pixels are also lightened for this number of frames in the other updates. From 1 to 50; defaults to 8.

The board needs these other components:

  • PSRAM with mode: octal.
  • An I²C bus on SDA GPIO39 and SCL GPIO40.
  • The PCA9535 I/O expander, set up with the PCA9554 component and device: PCA9535, interrupt on GPIO38. The examples here give it the ID io_expander.
  • A TPS65185 with WAKEUP, PWRUP, VCOM_CTRL and PWR_GOOD on expander pins 13, 11, 12 and 14; its page has the configuration for this board.

The panel’s output enable and mode pins are expander pins 8 and 9. The front light is on GPIO11; turn it off to judge contrast, as it makes black look gray.

display:
- platform: epaper_parallel
id: my_display
model: lilygo-t5-s3-pro
oe_pin:
pca9554: io_expander
number: 8
mode_pin:
pca9554: io_expander
number: 9
lambda: |-
it.filled_circle(it.get_width() / 2, it.get_height() / 2, 100, Color::BLACK);

To make the next update a full one, call request_full_update() from a lambda:

button:
- platform: template
name: "Full refresh"
on_press:
- lambda: id(my_display).request_full_update();
- component.update: my_display