Common base class for 8-bit parallel ("Intel 8080"-style) TFT display drivers: 8 data lines (D0-D7), WR (write strobe), RD (read strobe, unused - this class only writes), RS/DC (command vs. data) and CS. This is the bus MCUFRIEND-style shields and many 40-pin parallel TFT breakout boards use, wired straight to 8 GPIOs rather than through SPI/QSPI - no dedicated bus peripheral is assumed, every data line and the WR strobe is bit-banged via digitalWrite(), the same portable approach TinyGPU/Input/TouchDriverArduino.h's TouchDriverBitBang uses for a resistive touch panel's four GPIO pins. This trades throughput (one digitalWrite() per bit, per byte) for working unmodified on any Arduino core - a hardware-accelerated 8080 driver (e.g. ESP32's LCD_CAM/ esp_lcd_panel_io_i80) would be faster but ties the implementation to one platform's peripheral, the same tradeoff DisplayDriverQSPI.h already makes explicitly for ESP32-only QSPI.
More...
#include <DisplayDriverParallel8.h>
|
| | DisplayDriverParallel8 (int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t d4, int8_t d5, int8_t d6, int8_t d7, int8_t wr, int8_t dc, int8_t cs=-1, int8_t rd=-1, int8_t rst=-1, size_t xOffset=0, size_t yOffset=0, size_t width=240, size_t height=320) |
| |
| size_t | width () const override |
| |
| size_t | height () const override |
| |
| bool | writeData (ISurface< RGB_T > &surface) override |
| |
| bool | writeData (ISurface< RGB_T > &surface, size_t x, size_t y) override |
| |
| virtual | ~DisplayDriver ()=default |
| |
| virtual bool | begin ()=0 |
| |
| virtual void | end () |
| |
| virtual bool | writeData (ISurface< RGB_T > &surface)=0 |
| |
| virtual bool | writeData (ISurface< RGB_T > &surface, size_t x, size_t y)=0 |
| |
| virtual void | setRotation (DisplayRotation rotation) |
| |
| virtual size_t | width () const =0 |
| |
| virtual size_t | height () const =0 |
| |
| void | writeColor (size_t width, size_t height, RGB_T color) |
| |
|
| void | setColumnRowAddress (size_t x, size_t y, size_t w, size_t h) |
| |
| bool | setAddressWindow (size_t x, size_t y, size_t w, size_t h) override |
| |
| void | setupPinsAndReset () |
| |
| void | writeCommand (uint8_t cmd) |
| |
| void | writeData16 (uint16_t d1, uint16_t d2) |
| |
| void | writeData8 (uint8_t data) |
| |
| void | writeDataN (std::initializer_list< uint8_t > bytes) |
| |
| virtual bool | setAddressWindow (size_t x, size_t y, size_t w, size_t h)=0 |
| |
template<typename RGB_T = RGB565>
class tinygpu::DisplayDriverParallel8< RGB_T >
Common base class for 8-bit parallel ("Intel 8080"-style) TFT display drivers: 8 data lines (D0-D7), WR (write strobe), RD (read strobe, unused - this class only writes), RS/DC (command vs. data) and CS. This is the bus MCUFRIEND-style shields and many 40-pin parallel TFT breakout boards use, wired straight to 8 GPIOs rather than through SPI/QSPI - no dedicated bus peripheral is assumed, every data line and the WR strobe is bit-banged via digitalWrite(), the same portable approach TinyGPU/Input/TouchDriverArduino.h's TouchDriverBitBang uses for a resistive touch panel's four GPIO pins. This trades throughput (one digitalWrite() per bit, per byte) for working unmodified on any Arduino core - a hardware-accelerated 8080 driver (e.g. ESP32's LCD_CAM/ esp_lcd_panel_io_i80) would be faster but ties the implementation to one platform's peripheral, the same tradeoff DisplayDriverQSPI.h already makes explicitly for ESP32-only QSPI.
The command/parameter protocol on the wire (0x2A/0x2B/0x2C column/row/ RAM-write, 0x36 MADCTL, 0x3A pixel format, ...) is identical to the SPI wiring of the same controller families (see DisplayDriverSPI.h) - only how each command/data byte reaches the panel differs, so concrete drivers here mirror DisplayDriverSPI.h's ILI9341Driver/ST7789Driver/... init sequences byte-for-byte.
◆ DisplayDriverParallel8()
| DisplayDriverParallel8 |
( |
int8_t |
d0, |
|
|
int8_t |
d1, |
|
|
int8_t |
d2, |
|
|
int8_t |
d3, |
|
|
int8_t |
d4, |
|
|
int8_t |
d5, |
|
|
int8_t |
d6, |
|
|
int8_t |
d7, |
|
|
int8_t |
wr, |
|
|
int8_t |
dc, |
|
|
int8_t |
cs = -1, |
|
|
int8_t |
rd = -1, |
|
|
int8_t |
rst = -1, |
|
|
size_t |
xOffset = 0, |
|
|
size_t |
yOffset = 0, |
|
|
size_t |
width = 240, |
|
|
size_t |
height = 320 |
|
) |
| |
|
inline |
- Parameters
-
| d0..d7 | the 8 data lines, D0 = least significant bit. |
| wr | write-strobe pin: data is latched by the panel on WR's rising edge. |
| dc | data/command ("RS") select pin: LOW selects command, HIGH selects data - same polarity/role as DisplayDriverSPI's dc pin. |
| cs | chip-select pin, or -1 if the panel has CS permanently tied low (common on single-panel parallel shields). |
| rd | read-strobe pin, or -1 if unused - this class never reads from the panel, so it only needs to hold RD in its idle (HIGH, inactive) state so the panel doesn't drive the (shared, bidirectional on some boards) data bus back. |
| rst | reset pin, or -1 if not wired up (e.g. tied to the MCU's own reset). |
| width/height | the panel's addressable resolution, as reported by width()/height() - subclasses with a rotation concept (e.g. ILI9341Driver8080) override width()/height() themselves instead and can ignore these. |
◆ height()
◆ setAddressWindow()
| bool setAddressWindow |
( |
size_t |
x, |
|
|
size_t |
y, |
|
|
size_t |
w, |
|
|
size_t |
h |
|
) |
| |
|
inlineoverrideprotectedvirtual |
◆ setColumnRowAddress()
| void setColumnRowAddress |
( |
size_t |
x, |
|
|
size_t |
y, |
|
|
size_t |
w, |
|
|
size_t |
h |
|
) |
| |
|
inlineprotected |
◆ setupPinsAndReset()
| void setupPinsAndReset |
( |
| ) |
|
|
inlineprotected |
◆ width()
Current addressable panel width/height in pixels - for a driver that supports setRotation(), these reflect the current rotation (landscape vs portrait swaps them; see isLandscapeFamily()), not necessarily the panel's native/physical orientation. Callers that need to lay out content (e.g. OutputTinyGPU's scale_to_fit target, or clearScreen()'s band loop) should read these fresh rather than caching their own copy, so a setRotation() call is picked up automatically without needing separate bookkeeping.
Implements DisplayDriver< RGB_T >.
Reimplemented in ILI9341Driver8080< RGB_T >.
◆ writeCommand()
| void writeCommand |
( |
uint8_t |
cmd | ) |
|
|
inlineprotected |
◆ writeData() [1/2]
| bool writeData |
( |
ISurface< RGB_T > & |
surface | ) |
|
|
inlineoverridevirtual |
◆ writeData() [2/2]
| bool writeData |
( |
ISurface< RGB_T > & |
surface, |
|
|
size_t |
x, |
|
|
size_t |
y |
|
) |
| |
|
inlineoverridevirtual |
◆ writeData16()
| void writeData16 |
( |
uint16_t |
d1, |
|
|
uint16_t |
d2 |
|
) |
| |
|
inlineprotected |
◆ writeData8()
| void writeData8 |
( |
uint8_t |
data | ) |
|
|
inlineprotected |
◆ writeDataN()
| void writeDataN |
( |
std::initializer_list< uint8_t > |
bytes | ) |
|
|
inlineprotected |
◆ cs_
◆ d_
◆ dc_
◆ height_
◆ rd_
◆ rst_
◆ width_
◆ wr_
◆ xOffset_
◆ yOffset_
The documentation for this class was generated from the following file: