mipidsi – Low-level routines for interacting with MIPI DSI

Available on these boards
  • Adafruit P4 GPIO
  • ESP32-P4 Stamp XL
  • ESP32-P4-Function-EV
  • ESP32-P4X-Function-EV
  • M5Stack Tab5

class mipidsi.Bus(*, frequency: int = 500000000, num_lanes: int = 2)

Create a MIPI DSI Bus object.

This creates a DSI bus interface. The specific pins used are determined by the board. DSI supports 1-4 data lanes.

Parameters:
  • frequency (int) – the high speed clock frequency in Hz (default 500 MHz)

  • num_lanes (int) – the number of data lanes to use (default 2, range 1-4)

deinit() → None

Free the resources (pins, timers, etc.) associated with this mipidsi.Bus instance. After deinitialization, no further operations may be performed.

class mipidsi.Display(bus: Bus, init_sequence: circuitpython_typing.ReadableBuffer, *, width: int, height: int, hsync_pulse_width: int, hsync_back_porch: int, hsync_front_porch: int, vsync_pulse_width: int, vsync_back_porch: int, vsync_front_porch: int, pixel_clock_frequency: int, virtual_channel: int = 0, rotation: int = 0, color_depth: int = 16, backlight_pin: microcontroller.Pin | None = None, brightness: float = 1.0, native_frames_per_second: int = 60, backlight_on_high: bool = True)

Create a MIPI DSI Display object connected to the given bus.

This allocates a framebuffer and configures the DSI display to use the specified virtual channel for communication.

The framebuffer pixel format varies depending on color_depth:

  • 16 - Each two bytes is a pixel in RGB565 format.

  • 24 - Each three bytes is a pixel in RGB888 format.

A Display is often used in conjunction with a framebufferio.FramebufferDisplay.

Parameters:
  • bus (Bus) – the DSI bus to use

  • init_sequence (ReadableBuffer) – Byte-packed initialization sequence for the display

  • width (int) – the width of the framebuffer in pixels

  • height (int) – the height of the framebuffer in pixels

  • hsync_pulse_width (int) – horizontal sync pulse width in pixel clocks

  • hsync_back_porch (int) – horizontal back porch in pixel clocks

  • hsync_front_porch (int) – horizontal front porch in pixel clocks

  • vsync_pulse_width (int) – vertical sync pulse width in lines

  • vsync_back_porch (int) – vertical back porch in lines

  • vsync_front_porch (int) – vertical front porch in lines

  • pixel_clock_frequency (int) – pixel clock frequency in Hz

  • virtual_channel (int) – the DSI virtual channel (0-3)

  • rotation (int) – the rotation of the display in degrees clockwise (0, 90, 180, 270)

  • color_depth (int) – the color depth of the framebuffer in bits (16 or 24)

  • backlight_pin (microcontroller.Pin) – Pin connected to the display’s backlight

  • brightness (float) – Initial display brightness (0.0 to 1.0)

  • native_frames_per_second (int) – Number of display refreshes per second

  • backlight_on_high (bool) – If True, pulling the backlight pin high turns the backlight on

deinit() → None

Free the resources (pins, timers, etc.) associated with this mipidsi.Display instance. After deinitialization, no further operations may be performed.

width: int

The width of the framebuffer, in pixels.

height: int

The height of the framebuffer, in pixels.

color_depth: int

The color depth of the framebuffer.