LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
docs/controller_matrix.md
1 # Controller Capability Matrix
2 
3 This page documents the per-controller capabilities of every display driver
4 shipped with lcdgfx. It is generated from the code-generator templates in
5 `tools/templates/lcd/<controller>/<controller>.json` (`functions.interface_list`
6 field) and verified against the auto-generated drivers in
7 `src/v2/lcd/<controller>/`.
8 
9 ## Legend
10 
11 - **BPP**: native bits-per-pixel of the controller's frame data.
12 - **Resolutions**: panel resolutions for which an init sequence is shipped.
13 - **Bus**: data bus types supported by the HAL (`SPI`, `I2C`, `custom`).
14 - **Rotation**: software (`sw`) or hardware (`hw`) rotation. `sw` means the
15  library rotates pixel coordinates before sending; `hw` means the controller
16  has a memory-access-control register that handles the transform itself.
17 - **Invert**: `normalMode()` / `invertMode()` colour-inversion API available.
18 - **Contrast**: `setContrast()` API available.
19 - **HW scroll**: hardware vertical-scroll register exposed (`setStartLine`).
20 - **Flip H/V**: `flipHorizontal()` / `flipVertical()` API available.
21 - **FB needed**: a software framebuffer (NanoCanvas) is *required* to use this
22  controller efficiently in some modes (e.g. SH1107 landscape).
23 - **Status**: `stable` (well-tested, no known correctness bugs);
24  `limited` (works but has documented constraints);
25  `buggy` (has open known issues — see notes).
26 
27 ## Monochrome OLED / LCD (1 bpp)
28 
29 | Controller | BPP | Resolutions | Bus | Rotation | Invert | Contrast | HW scroll | Flip H/V | FB needed | Status | Notes |
30 |---|---|---|---|---|---|---|---|---|---|---|---|
31 | SSD1306 | 1 | 64x32, 64x48, 128x32, 128x64 | SPI, I2C, custom | sw | ✅ | ✅ | ✅ | ✅ | no | stable | The reference driver for this library. |
32 | SH1106 | 1 | 128x64 | SPI, I2C | sw | ✅ | ✅ | ✅ | ✅ | no | stable | SSD1306-compatible command set with column offset. |
33 | SH1107 | 1 | 128x64, 64x128 | SPI, I2C | sw | ✅ | ✅ | ✅ | ✅ | yes (landscape) | limited | 64x128 landscape rotation requires a software framebuffer (memory layout is page-based on the long axis). |
34 | PCD8544 | 1 | 84x48 | SPI | sw | — | — | — | — | no | stable | Nokia 5110. No invert / contrast API. |
35 
36 ## Greyscale OLED (4 bpp)
37 
38 | Controller | BPP | Resolutions | Bus | Rotation | Invert | Contrast | HW scroll | Flip H/V | FB needed | Status | Notes |
39 |---|---|---|---|---|---|---|---|---|---|---|---|
40 | SSD1325 | 4 | 128x64 | SPI, I2C | sw | — | ✅ | — | — | no | buggy | `fillRect` has a known nibble-packing issue at odd column boundaries with `setColor(0x0F)` — see `unittest/canvas_tests.cpp`. |
41 | SSD1327 | 4 | 128x128 | SPI, I2C | sw | — | ✅ | — | — | no | limited | `printFixedN` with `BOLD` / `SIZE_2X` is not supported (architectural — the renderer assumes 1-bpp glyphs at this scale). |
42 
43 ## Colour OLED (8 / 16 bpp)
44 
45 | Controller | BPP | Resolutions | Bus | Rotation | Invert | Contrast | HW scroll | Flip H/V | FB needed | Status | Notes |
46 |---|---|---|---|---|---|---|---|---|---|---|---|
47 | SSD1331 | 8, 16 | 96x64 | SPI | hw (`setRotation`) | — | ✅ | — | — | no | stable | Hardware-accelerated `drawLine` and `copyBlock`. |
48 | SSD1351 | 16 | 96x96, 128x128 | SPI | hw (`setRotation`) | — | ✅ | — | — | no | stable | `setOffset()` and `setRgbMode()` available. |
49 
50 ## Colour TFT (16 bpp, RGB565)
51 
52 | Controller | BPP | Resolutions | Bus | Rotation | Invert | Contrast | HW scroll | Flip H/V | FB needed | Status | Notes |
53 |---|---|---|---|---|---|---|---|---|---|---|---|
54 | IL9163 | 16 | 128x128, 128x160 | SPI | hw (`setRotation`) | ✅ | — | — | — | no | stable | Backlight control is the user's responsibility. |
55 | ST7735 | 16 | 80x160, 128x128, 128x160 | SPI | hw (`setRotation`) | — | — | — | — | no | stable | `setOffset()` and `setRgbMode()` available. |
56 | ST7789 | 16 | 135x240, 170x320, 240x240 | SPI | hw (`setRotation`) | ✅ | — | — | — | no | stable | Many panels need `INVON` for correct colour — the init sequence sets it by default; toggle with `normalMode()` / `invertMode()`. |
57 | ILI9341 | 16 | 128x160, 240x320 | SPI | hw (`setRotation` + `rotateOutput`) | ✅ | — | — | — | no | stable | SDL emulator rotation fixed in v1.2.0. |
58 | ILI9488 | 16 | 320x480 | SPI | hw | — | — | — | — | no | limited | Shipped via custom interface — see `examples/`. |
59 
60 ## Caveats and conventions
61 
62 - All controllers expose a 1-bit "pixel" API (`putPixel`, `drawLine`, etc.) as
63  well as the native-depth API. On greyscale / colour controllers the
64  monochrome API maps "black" to 0 and "white" to the maximum native value.
65 - Rotation: `sw` rotation costs CPU on every draw call; `hw` rotation costs
66  one register write at setup. Mixed-mode rotation is not supported.
67 - "Bus" lists what the HAL templates emit. Adding a new bus to a stable
68  controller is usually a matter of editing the JSON template — see
69  `tools/templates/lcd/<controller>/<controller>.json`.
70 - Files in `src/v2/lcd/<controller>/` are auto-generated. Edit the templates
71  in `tools/templates/lcd/<controller>/` and re-run
72  `cd tools && python3 lcd_code_generator.py -c <controller>` to regenerate.
73 
74 ## How to read this matrix when picking a controller
75 
76 - **Need rotation in firmware?** Pick a colour TFT or SSD1331 / SSD1351 — they
77  have hardware rotation. Mono OLED rotation is software-only and slower.
78 - **Need contrast control?** All OLEDs support it. TFTs do not (use the
79  backlight PWM instead).
80 - **Need hardware vertical scroll?** Only mono OLEDs (SSD1306, SH1106, SH1107)
81  expose `setStartLine`.
82 - **Tightest flash / RAM budget (e.g. ATtiny)?** Stick with SSD1306 / SH1106.
83  4-bpp and 16-bpp drivers carry larger init sequences and pixel paths.