CircuitPython¶
pydisplay works with CircuitPython using Adafruit bus drivers and framebufferio.
Getting started¶
- Confirm your display works with Adafruit CircuitPython libraries and DisplayIO first.
- Copy needed directories from
src/lib/to your board (displaysys,eventsys, etc.). - Create or adapt a
board_config.py— use existing configs as templates:
| Config | Use case |
|---|---|
board_configs/fbdisplay/cp_usb_video/ |
USB Video (webcam-style output) |
board_configs/fbdisplay/cp_qualia_tl040hds20/ |
Qualia RGB display |
board_configs/busdisplay/spi/cp_esp32_pico_eyespi_ili9341/ |
SPI ILI9341 |
There is no top-level board_configs/circuitpython/ directory; per-board configs live alongside MicroPython ones under board_configs/.
BusDisplay on CircuitPython¶
SPI and I80 displays use displaysys.busdisplay.BusDisplay with Adafruit FourWire / ParallelBus drivers.
To prefer pydisplay's BusDisplay over a local shim, patch the graphics driver import:
try:
from displaysys.busdisplay import BusDisplay
except ImportError:
from busdisplay import BusDisplay
Framebuffer displays¶
RGB666 (parallel), USB Video, and RGB Matrix devices use displaysys.fbdisplay.FBDisplay with CircuitPython's framebufferio.FramebufferDisplay. No special patching is needed once CircuitPython sees the hardware.
framebuf shim¶
CircuitPython lacks MicroPython-compatible framebuf. Install add_ons/framebuf.py or copy it to your lib/ folder.
Installers¶
CircuitPython circup packages are not published yet. Copy files manually from a full clone.
USB Video note¶
board_configs/fbdisplay/cp_usb_video/ lets a board appear as a USB webcam streaming the framebuffer. Works on some hosts (e.g. ChromeOS); Windows may not recognize the device. See screenshots/circuitpython_usb_video_chromebook.gif in the repo.