Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

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.

Dependencies

This driver depends on:

  • Adafruit CircuitPython with mipidsi.Display.pixel_clock_frequency and low_power_blanking, and mipidsi.Bus.minimum_frequency, frequency and num_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

Installing from PyPI

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-lt8912b

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-lt8912b

To 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-lt8912b

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install adafruit_lt8912b

Or the following command to update an existing version:

circup update

Usage Example

LT8912B 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.

Bridge Control

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.

EDID Timing

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.

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Credits and License

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.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for adafruit-circuitpython-lt8912b 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adafruit-circuitpython-lt8912b 1.0.0
File Size Uploaded Provenance Actions
adafruit_circuitpython_lt8912b-1.0.0.tar.gz 36.5 kB Without provenance Details for adafruit_circuitpython_lt8912b-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-lt8912b 1.0.0
File Interpreter ABI Platform Actions
adafruit_circuitpython_lt8912b-1.0.0-py3-none-any.whl Python 3 none any Details for adafruit_circuitpython_lt8912b-1.0.0-py3-none-any.whl

Total release size: 47.0 kB

Release files / adafruit_circuitpython_lt8912b-1.0.0.tar.gz

Download URL adafruit_circuitpython_lt8912b-1.0.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d616e970f07d8cb4745266df28cafd04657e3fe500e9d03ede07cda9cc3710aa
BLAKE2b-256 checksum
How to use checksums
cf6960ad179fcfe12b14b7bca6697fecc276315cc0016e6d04f237966f111bd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / adafruit_circuitpython_lt8912b-1.0.0-py3-none-any.whl

Download URL adafruit_circuitpython_lt8912b-1.0.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49a8086015bdb6b92408cfa266a58d326c62cf8ae34e264af68a33bdf4aae5d3
BLAKE2b-256 checksum
How to use checksums
297e96829231fef9797024bc22aa9230c6f4ff43f4ee4cb3c389ec2cb8e4aa63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for adafruit-circuitpython-lt8912b 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page