Expand description
Sitronix ST7789 TFT controller (4-wire SPI, RGB565).
Small ST7789 panels expose only a window of the controller’s 240×320
frame memory, so every panel has a native size, a memory offset and a
rotation-dependent MADCTL. Panel captures that once, and
Panel::geometry derives the window for any Rotation at compile
time.
The driver streams pixel bytes as given. It does no conversion and keeps no buffer, so a framebuffer that already stores big-endian RGB565 can be sent with zero copies (and, on ESP32 targets, straight from RAM via DMA).
Modules§
Structs§
- Geometry
- The drawable window for one panel + rotation.
- Init
Step - One step of a controller initialisation script.
- Panel
- How a physical panel sits inside the controller’s frame memory.
- St7789
- ST7789 driver.
Enums§
- Error
- Driver error: either the SPI device or the
DCpin failed. - Rotation
- Screen rotation, clockwise from the panel’s native portrait orientation.
Constants§
- M5_
ST7789 V2_ INIT - Power, voltage and gamma settings for the ST7789V2 panels M5Stack ships
(Cardputer, StickC Plus family). Values are from M5GFX’s
Panel_ST7789(MIT, © M5Stack); porch and frame-rate registers are left at reset defaults, as M5GFX does, because they differ between panel lots.
Functions§
- hard_
reset - Pulses a hardware reset line (active low) and waits for the controller.