GC9A01 Display Driver
This crate provides an async driver for the GC9A01 display controller, implementing the Panel trait to be used with the display-driver crate.
This driver is commonly used for round LCD displays (often 240x240).
Usage
This driver is designed to work with the display-driver crate. You can use the DisplayDriver struct to drive the display.
1. Choose a Spec
The GC9A01 panels typically come in 240x240 resolution, but 128x128 variants also exist. This crate provides Generic types that map to these common variations.
2. Implementation Example
use ;
// The `Spec` (Generic240x240Type1) defines the hardware-specific constants (Gamma, Voltage).
use ;
// 1. Configure Reset
let reset_opt = new_pin;
// 2. Create the Panel instance using a Generic Spec
let panel = new;
// 3. Bind Bus and Panel, Configure, and Initialize
// The driver orchestrates the logic, delegating transport to 'bus' and commands to 'panel'.
let mut display = builder
.with_color_format
// This framework automatically handles offsets.
.with_orientation
.init.await.unwrap;
// Now you can use `display` to draw:
display.write_frame.await.unwrap;
Full examples can be found at examples
Specs
We use a Spec trait to handle resolution and offset differences.
- Generic Specs: Pre-defined configurations for common panel variations (found in
spec).
| Generic Type | Resolution | Description |
|---|---|---|
Generic240x240Type1 |
240x240 | Common round display |
Generic128x128Type1 |
128x128 | Smaller variant |
Implementing a Custom Spec
If the built-in Generic specs don't match your display, you can define your own by implementing the Gc9a01Spec trait.
use ;
// 1. Define your type
;
// 2. Configure Resolution & Offsets
// 3. Implement Gc9a01Spec marker trait
License
This project is under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).