CircuitPython driver for the LT8912B MIPI DSI to HDMI/DVI bridge. The bridge is
configured over I2C and then fed video through a MIPI DSI host, such as the
ESP32-P4. Pixel data is sent by the mipidsi module; the LT8912B cannot send
pixels over I2C.
This driver depends on:
- Adafruit CircuitPython with
mipidsi.Display.pixel_clock_frequencyandlow_power_blanking, andmipidsi.Bus.minimum_frequency,frequencyandnum_lanes - Bus Device
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
This driver works with Adafruit's LT8912B MIPI DSI to HDMI/DVI adapter.
Purchase one from the Adafruit shop
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-lt8912bTo install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-lt8912bTo install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install adafruit-circuitpython-lt8912bMake sure that you have circup installed in your Python environment.
Install it with the following command if necessary:
pip3 install circupWith circup installed and your CircuitPython device connected use the
following command to install:
circup install adafruit_lt8912bOr the following command to update an existing version:
circup updateLT8912B is a mipidsi.Display. It configures the bridge over I2C and
then starts RGB888 video on the DSI bus with the same timing. The constructor
raises ValueError if the bridge does not respond on I2C. Create the bus
with a minimum_frequency of at least 24 times the pixel clock divided by
the number of lanes. The PHY may run faster than that minimum, so the bridge
checks the rate the bus actually uses, available as bus.frequency.
import board
import busio
import framebufferio
import mipidsi
import adafruit_lt8912b
i2c = busio.I2C(board.SCL, board.SDA)
bus = mipidsi.Bus(minimum_frequency=480_000_000, num_lanes=2)
bridge = adafruit_lt8912b.LT8912B(
bus,
i2c,
width=800,
height=480,
hsync_pulse_width=48,
hsync_back_porch=310,
hsync_front_porch=112,
vsync_pulse_width=3,
vsync_back_porch=29,
vsync_front_porch=13,
pixel_clock_frequency=40_000_000,
)
display = framebufferio.FramebufferDisplay(bridge)See examples/lt8912b_simpletest.py for a fixed-timing color-bar example,
examples/lt8912b_720p.py and examples/lt8912b_1080p30.py for standard
CEA-861 modes, examples/lt8912b_640x480.py for a low-bandwidth mode, and
examples/lt8912b_edid.py for one that uses the monitor's preferred EDID
timing.
The constructor resets and configures the bridge. It pulses the reset pin
when one is given and otherwise sends a software reset.
hot_plug_detected is True when a monitor is connected.
examples/lt8912b_edid.py reads the monitor's preferred timing from its
EDID EEPROM at 0x50 and passes it to mipidsi.Display and LT8912B, with
an 800x480 fallback. If the adapter has a DDC switch, turn it on before reading
EDID. The example also folds the DPI clock rounding into the horizontal back
porch so the monitor's refresh rate survives the 240/N divider.
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
The register initialization tables are adapted from Espressif's esp_lcd_lt8912b driver and Adafruit's Arduino LT8912B library. Those portions remain under the Apache License, Version 2.0. See NOTICE and LICENSES/Apache-2.0.txt. The Python interface is MIT licensed. Dependencies retain their own licenses.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.