Platform-agnostic Rust support for the Chipone CO5300 AMOLED display controller, over SPI, Quad-SPI or MIPI-DSI.
Status: tested against a command-level model of the chip (host tests and Wokwi), not yet verified on real hardware.
| Crate | Description |
|---|---|
co5300-registers |
A typed map of the CO5300's commands and parameters. |
co5300 |
A transport-agnostic driver (blocking and async), embedded-graphics target. |
co5300-sim |
A command-level model with a frame memory for tests and emulation. |
Everything follows the Chipone CO5300 datasheet,
V0.01 (24 July 2023), the
newest revision found. Facts the datasheet lacks, such as the 4-wire SPI byte layout and
SetSPIMode on SPI hosts, come from Espressif's Apache-2.0
esp_lcd_co5300
component (v2.2.0) and Zephyr's Apache-2.0 CO5300 driver and bindings. No code was taken
from them or from other drivers. Each crate README has a Sources table.
The datasheet documents MIPI-DSI and a Quad-SPI interface with Standard (one line), Dual and
Quad modes, including the instruction/address framing. For a 4-wire SPI mode with a D/C
pin it only names the D/CX pin and its timing; the byte layout comes from
esp_lcd_co5300.
The driver is written against an Interface trait (write_command, write_pixels), so the
transport lives outside it:
SpiInterface: 4-wire SPI with a D/C pin onembedded-hal;FramedSpiInterface: single-line SPI with the02hframing;co5300::qspi: the Quad-SPI framing as plain data, for HAL-specific adapters;- MIPI-DSI: an adapter on ESP-IDF's
esp_lcd_panel_io_tx_param/tx_color, shown in the crate documentation, for boards such as the Kode Dot.
Behavior the datasheet leaves open, and what these crates assume:
- In 4-wire SPI mode,
CSXmay go high between a command and its parameters. - Pixel data is sent with
RAMWRonce andRAMWRCfor every further chunk. - Windows that break the even start/length rule are widened by the
embedded-graphicstarget, repeating the edge pixels; the plain API rejects them. - The panel-specific initialization (manufacturer pages, gamma, timing) is up to the user;
initsends only chip-level commands.
The model's own assumptions (mirroring, window wrap-around, idle mode colors, reset pulse
length) are listed in the co5300-sim crate docs.
The Kode Dot (ESP32-P4) has the CO5300 on MIPI-DSI; ESP-IDF keeps the DSI bus, DPI and the
frame buffer. The panel is 410 × 502 (KODE_DOT screen constant).
- The panel supply
VCI_ENcomes from TCA6408A pin P7: latch P7 high before making it an output, then hold 20 ms. - Reset is shared with touch on GPIO7: low for 10 ms, then high, then wait 120 ms.
- The DSI PHY LDO runs at 2.5 V.
The model in co5300-sim is used both behind fake embedded-hal buses in host tests and
as a Wokwi custom chip with a frame buffer (sim/wokwi-chip), driven
over 4-wire SPI since Wokwi has no Quad-SPI. The ESP32-C3 firmware in examples/esp32c3
draws a test pattern; its scenario checks the serial output and compares the chip's
display with a reference screenshot using wokwi-cli.
Try it in the browser: an ESP32-C3 drawing a test pattern on the emulated CO5300 on wokwi.com; the chip shows its frame buffer as a display.
Every GitHub Release carries the chip as
chip.zip. Add a chip-co5300 part and this dependency to your diagram.json, with the
latest release version written without the tag's v (@v0.1.0 fails to load):
"dependencies": { "chip-co5300": "github:sunsided/co5300@0.1.0" }This works on wokwi.com, in the Wokwi VS Code extension and with
wokwi-cli; nothing needs to be built.
For a browser demo, examples/arduino-esp32c3 has an
Arduino sketch and diagram.json to paste into a new wokwi.com project.
Needs wokwi-cli and a
WOKWI_CLI_TOKEN from the Wokwi CI dashboard:
task wokwi:testsim/wokwi-chip describes building the chip and its pins;
examples/esp32c3 the wiring and the scenario.
Both crates share one version. From main, with the changes listed under
## [Unreleased] in each crate's CHANGELOG.md:
cargo release <patch|minor|major> # dry run
cargo release <patch|minor|major> --executeThis commits Release X.Y.Z and pushes the tag vX.Y.Z. The tag runs the release workflow,
which publishes co5300-registers and co5300 to crates.io via
trusted publishing (no API token in the
repository; versions already on crates.io are skipped, and then no token is requested) and
then creates a GitHub Release named X.Y.Z with the changelog sections as notes.
Each GitHub Release carries the packaged .crate files and the Wokwi chip as chip.zip,
all with build provenance attestations:
gh attestation verify chip.zip -R sunsided/co5300We abide by the Contributor Covenant and ask that you do as well.
Copyright © 2026 Markus Mayer
Triple licensed under your choice of either of:
- European Union Public Licence, Version 1.2, (LICENSE-EUPL or https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)