Skip to content

Conversation

@tannewt
Copy link
Member

@tannewt tannewt commented Nov 3, 2025

Adds support for MIPI DSI (Display Serial Interface) displays via a new mipidsi module. This enables high-speed serial communication with DSI displays using differential signaling.

The module provides:

  • Bus class: Manages DSI bus with 1-4 data lanes
  • Display class: Handles display configuration and framebuffer

Module is:

  • Disabled by default globally
  • Enabled only for ESP32-P4 (has hardware MIPI-DSI support)

🤖 Initial code generated with Claude Code and then hand improved.

Adds support for MIPI DSI (Display Serial Interface) displays via a new mipidsi module. This enables high-speed serial communication with DSI displays using differential signaling.

The module provides:
- Bus class: Manages DSI bus with 1-4 data lanes
- Display class: Handles display configuration and framebuffer

Module is:
- Disabled by default globally
- Enabled only for ESP32-P4 (has hardware MIPI-DSI support)

🤖 Initial code generated with [Claude Code](https://claude.com/claude-code) and then hand improved.

Co-Authored-By: Claude <noreply@anthropic.com>
@tannewt
Copy link
Member Author

tannewt commented Nov 3, 2025

Depends on espressif/usb-pids#274 for M5Stack Tab5 PID.

@tannewt
Copy link
Member Author

tannewt commented Nov 4, 2025

No luck getting the M5Stack Tab5 going with this yet. The USB C is connected to GPIO24/25 which is connected to the serial/jtag peripheral. The USB A is the high speed OTG. We can switch the USB C to the FS OTG with an eFuse edit but then we cannot access the serial/jtag peripheral for bootloading.

CIRCUITPY_ESP_USB_SERIAL_JTAG doesn't enable it for some reason either. More debugging will be needed for this.

@RetiredWizard
Copy link

RetiredWizard commented Nov 4, 2025

When I run the mipidsi init code you posted to discord the bottom two lines (23 & 24) are overwritten/corrupted by some combination with lines 21 and 22.

Edit: I ran a program to display an animated gif and it didn't seem to have any trouble at the bottom of the display so perhaps the issue has to do with Terminalio?

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Looks clean! I pushed a commit to fix up the pins.c formatting, and have a couple of other comments. I won't get a board to test until tomorrow.

@dhalbert
Copy link
Collaborator

dhalbert commented Nov 4, 2025

Temporary build failures due to

This is a scheduled macos-13 brownout. The macOS-13 based runner images are being deprecated. For more details, see https://github.com/actions/runner-images/issues/13046.
The macOS-13 based runner images are being deprecated, consider switching to macOS-15 (macos-15-intel) or macOS 15 arm64 (macos-latest) instead. For more details see https://github.com/actions/runner-images/issues/13046

so maybe we should update the .github/...

@tannewt tannewt marked this pull request as ready for review November 5, 2025 00:36
@tannewt
Copy link
Member Author

tannewt commented Nov 5, 2025

Temporary build failures due to

This is a scheduled macos-13 brownout. The macOS-13 based runner images are being deprecated. For more details, see https://github.com/actions/runner-images/issues/13046.
The macOS-13 based runner images are being deprecated, consider switching to macOS-15 (macos-15-intel) or macOS 15 arm64 (macos-latest) instead. For more details see https://github.com/actions/runner-images/issues/13046

so maybe we should update the .github/...

Opened #10706 for this.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Good on the allocation fixup. If this works for you, fine to merge. Or I could test tomorrow when my board arrives.

@RetiredWizard
Copy link

I don't know if this is something that should be addressed in this PR or if it's a separate issue but I worked up some code that demonstrates the bottom of the screen refresh issue I'm seeing.

when I run this code.py the program stops at the first input prompt but the MIPI DSI display doesn't show the correct output at the bottom of the screen, then when you press enter, the screen is updated and when it stops at the second input prompt (which inserts a display.refresh() while waiting for input) the entire display is properly updated.

from sys import stdin
import supervisor
import mipidsi
import displayio
import digitalio
import framebufferio
import board
import time

displayio.release_displays()
bus = mipidsi.Bus(frequency=1000000000)
init_sequence = (
    b"\xb2\x01\x10"
    b"\x80\x01\x8b"
    b"\x81\x01\x78"
    b"\x82\x01\x84"
    b"\x83\x01\x88"
    b"\x84\x01\xa8"
    b"\x85\x01\xe3"
    b"\x86\x01\x88"
    b"\x11\x80\x78"
)

reset_pin = digitalio.DigitalInOut(board.IO27)
reset_pin.direction = digitalio.Direction.OUTPUT
reset_pin.value = False
time.sleep(0.1)
reset_pin.value = True
time.sleep(0.2)

fb = mipidsi.Display(
    bus,
    init_sequence=init_sequence,
    width=1024,
    height=600,
    color_depth=24,
    pixel_clock_frequency=52000000,
    hsync_pulse_width=10,
    hsync_front_porch=160,
    hsync_back_porch=160,
    vsync_pulse_width=1,
    vsync_front_porch=12,
    vsync_back_porch=23,
    backlight_pin=board.IO26,
)
display = framebufferio.FramebufferDisplay(fb)
supervisor.runtime.display=display

for i in range(23):
    print(i)
n = input('[input] waiting for input: ')
print(chr(27)+'[2J')
time.sleep(.5)

for i in range(23):
    print(i)
print('[stdin] waiting for input: ',end="")
key = ''
keys = ''
while key != '\n':
    display.refresh()
    if supervisor.runtime.serial_bytes_available:
        key = stdin.read(1)
        keys = keys + key

Putting time.sleep(.1) after the print statements in the for loops caused both loops to have display issues.

@dhalbert
Copy link
Collaborator

dhalbert commented Nov 5, 2025

Merging so we can get a version to test into a beta. I created #10708 to address the problem @RetiredWizard found.

@dhalbert dhalbert merged commit 52377b4 into adafruit:main Nov 5, 2025
634 checks passed
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.

3 participants