8000 [mipi_spi] New display driver for MIPI DBI devices by clydebarrow · Pull Request #8383 · esphome/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[mipi_spi] New display driver for MIPI DBI devices #8383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 74 commits into from
May 13, 2025

Conversation

clydebarrow
Copy link
Contributor
@clydebarrow clydebarrow commented Mar 10, 2025

What does this implement/fix?

This driver brings together 3 kinds of MIPI-DBI (Data Bus Interface) display panels. All these panels implement the MIPI DCS (Display Command Set) and have on-board LCD refresh ram.

The interfaces supported are:

  • 1 bit SPI - as per the existing ili9xxx driver
  • Quad SPI - as per the existing qspi_dbi driver
  • I80 bus, implemented as octal SPI. New to ESPHome

Features of this driver are:

  • The driver includes all the models supported by the existing single and quad spi drivers, plus new ones, plus some I80 bus displays.
  • Configuration is all handled in Python - no embedded init sequences. Adding a new model only requires a few extra lines of Python.
  • Pin assignments and data rate are defaulted by the model where it relates to an board with integrated ESP and display.. This means for those boards the display config may be just two lines.
  • Multiple enable pins can be assigned where boards have more than one pin to set for the display to operate.
  • Hardware rotation is handled automatically by the rotation option if possible, falling back to software rotation only if needed.
  • Custom init sequences including delays can be specified for the CUSTOM model.
  • 16 and 18 bit pixel format displays are supported
  • The display buffer supports 16 and 8 bit color depths, orthogonal to the controller format.
  • 16 bit spi data mode for certain Waveshare models is supported.
  • Color inversion supported
  • AMOLED brightness setting supported.
  • MADCTL alternate x/y mirror bits supported
  • SLPOUT delays are handled automatically and kept to a minimum
  • 18 bit output has been optimised from the ili9xxx driver.

List of supported driver chips:

  • RM690B0
  • ILI9341
  • ILI9481
  • ILI9486
  • ILI9488
  • ILI9488_A
  • ST7796
  • ST7789V
  • GC9A01A
  • GC9D01N
  • AXS15231
  • ST7735
  • CUSTOM

List of so far supported integrated boards:

  • M5STACK
  • M5CORE
  • S3BOX
  • S3BOXLITE
  • WAVESHARE-4-TFT
  • Pico-ResTouch-LCD-3.5
  • WT32-SC01-PLUS
  • ESP32-2432S028
  • JC3248W535
  • JC3636W518
  • LANBON_L8
  • T4-S3
  • T-EMBED
  • T-DISPLAY
  • T-DISPLAY-S3
  • T-DISPLAY-S3-PRO
  • T-DISPLAY-S3-AMOLED
  • T-DISPLAY-S3-AMOLED-PLUS

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

Pull request in esphome-docs with documentation (if applicable):

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml

display:
  - platform: mipi_spi
    model: t-display-s3-pro

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@h3ndrik
Copy link
Contributor
h3ndrik commented Apr 6, 2025

Nice one. This is a still WiP, right? I've had a look at this and it seems the pinout for the T-Display-S3 (with a simple IPS display, no touch) doesn't match my board or the official documentation, nor the previous attempts. And I can't make it work on that board, even by changing the SPI config.

@clydebarrow
Copy link
Contributor Author

This is a still WiP, right? I've had a look at this and it seems the pinout for the T-Display-S3 (with a simple IPS display, no touch) doesn't match my board or the official documentation

Well, everything is a WIP but all the display configs are tested, and the T-Display S3 certainly works:

[19:07:34][C][display.mipi_spi:450]: MIPI_SPI Display
[19:07:34][C][display.mipi_spi:451]:   Model: T-DISPLAY-S3
[19:07:34][C][display.mipi_spi:452]:   Width: 320
[19:07:34][C][display.mipi_spi:453]:   Height: 170
[19:07:34][C][display.mipi_spi:457]:   Offset height: 35
[19:07:34][C][display.mipi_spi:458]:   Swap X/Y: YES
[19:07:34][C][display.mipi_spi:459]:   Mirror X: NO
[19:07:34][C][display.mipi_spi:460]:   Mirror Y: YES
[19:07:34][C][display.mipi_spi:461]:   Color depth: 16 bits
[19:07:34][C][display.mipi_spi:462]:   Invert colors: YES
[19:07:34][C][display.mipi_spi:463]:   Color order: BGR
[19:07:34][C][display.mipi_spi:464]:   Pixel mode: 16bit
[19:07:34][C][display.mipi_spi:469]:   Draw rounding: 1
[19:07:34][C][display.mipi_spi:472]:   CS Pin: GPIO6
[19:07:34][C][display.mipi_spi:473]:   Reset Pin: GPIO5
[19:07:34][C][display.mipi_spi:474]:   DC Pin: GPIO7
[19:07:34][C][display.mipi_spi:475]:   SPI Mode: 3
[19:07:34][C][display.mipi_spi:476]:   SPI Data rate: 10MHz
[19:07:34][C][display.mipi_spi:477]:   SPI Bus width: 8
[19:07:34][C][lvgl:086]: LVGL:
[19:07:34][C][lvgl:087]:   Display width/height: 320 x 170
[19:07:34][C][lvgl:088]:   Rotation: 0
[19:07:34][C][lvgl:089]:   Draw rounding: 2

Quick Camera Image 2025-04-06 at 7 08 14 PM

@clydebarrow
Copy link
Contributor Author

Full config:

esphome:
  name: t-display-s3

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

external_components:
  - source: github://pr#8383
    components: [const, lvgl, mipi_spi, qspi_dbi, spi]
    refresh: 1h

logger:

output:
  - platform: ledc
    frequency: 9765Hz
    pin: GPIO38
    id: backlight_output

light:
  - platform: monochromatic
    output: backlight_output
    name: LCD Backlight
    id: led
    restore_mode: ALWAYS_ON
    default_transition_length: 0s

spi:
  type: octal
  clk_pin: 8
  data_pins:
    - 39
    - 40
    - 41
    - 42
    - ignore_strapping_warning: true
      number: 45
    - ignore_strapping_warning: true
      number: 46
    - 47
    - 48

psram:
  speed: 80MHz
  mode: octal

display:
  - platform: mipi_spi
    model: t-display-s3
    rotation: 270

lvgl:

@h3ndrik
Copy link
Contributor
h3ndrik commented Apr 6, 2025

Thank you very much. Indeed, that config works fine. I think I had the CLK pin wrong. I got a bit confused by the mipi_spi's test.xxx.yaml files which all contain the same pin numbers for all boards. Looks like these kinds of displays are finally going to be supported, that's really nice.

Edit: Yes, tinkered around a bit with it and both the display commands and lvgl work. And I can even step up the speed to 20MHz.

@clydebarrow clydebarrow modified the milestones: 2025.4.0b1, 2025.5.0b1 Apr 23, 2025
Copy link
Member
@jesserockz jesserockz left a comment
67E6

Choose a reason for hiding this comment

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

One small thing, otherwise good to go

@jesserockz jesserockz merged commit 183659f into esphome:dev May 13, 2025
70 checks passed
@jesserockz jesserockz mentioned this pull request May 13, 2025
@jesserockz jesserockz mentioned this pull request May 21, 2025
andre68723 added a commit to andre68723/esphome that referenced this pull request May 25, 2025
sa-crespo pushed a commit to sa-crespo/esphome that referenced this pull request May 26, 2025
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
@clydebarrow clydebarrow deleted the mipi-spi branch June 16, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for the new LilyGO T-Display-S3
4 participants
0