|
TinyGPU
|
RP2040 PIO/DMA-accelerated 8-bit parallel ("Intel 8080"-style) TFT display driver. D0-D7 and WR are driven by one PIO state machine (see kLcd8080WriteProgram above) instead of bit-banged via digitalWrite() - see DisplayDriverParallel8.h for the portable bit-banged version this mirrors, and DisplayDriverParallel8ESP32.h for the equivalent ESP32 LCD_CAM/PARLIO-peripheral version. DC/CS/RST stay on plain GPIO (Arduino pinMode()/digitalWrite()), same as those two. More...
#include <DisplayDriverParallel8RP2040.h>


Public Member Functions | |
| DisplayDriverParallel8RP2040 (int8_t d0, int8_t wr, int8_t dc, int8_t cs=-1, int8_t rst=-1, size_t width=240, size_t height=320, float clockDiv=8.0f, PIO pio=pio0) | |
| void | end () override |
| ~DisplayDriverParallel8RP2040 () override | |
| 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 |
Public Member Functions inherited from DisplayDriver< RGB_T > | |
| 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) |
Protected Member Functions | |
| 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 |
| bool | beginBus () |
| 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 |
Protected Attributes | |
| int8_t | d0_ |
| int8_t | wr_ |
| int8_t | dc_ |
| int8_t | cs_ |
| int8_t | rst_ |
| size_t | width_ |
| size_t | height_ |
| float | clockDiv_ |
| PIO | pio_ |
| uint | sm_ = 0 |
| uint | offset_ = 0 |
| int | dma_ = -1 |
| bool | busInitialized_ = false |
Protected Attributes inherited from DisplayDriver< RGB_T > | |
| Font5x7< RGB_T > | defaultFont |
RP2040 PIO/DMA-accelerated 8-bit parallel ("Intel 8080"-style) TFT display driver. D0-D7 and WR are driven by one PIO state machine (see kLcd8080WriteProgram above) instead of bit-banged via digitalWrite() - see DisplayDriverParallel8.h for the portable bit-banged version this mirrors, and DisplayDriverParallel8ESP32.h for the equivalent ESP32 LCD_CAM/PARLIO-peripheral version. DC/CS/RST stay on plain GPIO (Arduino pinMode()/digitalWrite()), same as those two.
Bulk pixel data (writeData()) is fed to the state machine via a DMA channel reading directly out of the surface's buffer - the CPU issues one DMA transfer and waits for it (and the state machine's own FIFO) to drain, rather than looping a pio_sm_put_blocking() call per byte.
Hardware constraint (PIO's out pins/side-set addressing): D0-D7 must be 8 consecutive GPIOs, D0 being the lowest-numbered - this isn't a software choice, it's how the PIO block maps its 32 general-purpose output-mapped pins. WR must be a separate GPIO outside that D0-D7 range.
|
inline |
| d0 | the first (lowest-numbered) of 8 consecutive data-line GPIOs - see the class comment's hardware constraint. |
| wr | write-strobe pin - the PIO program's side-set pin. |
| dc | data/command ("RS") select pin. |
| cs | chip-select pin, or -1 if the panel has CS permanently tied low. |
| rst | reset pin, or -1 if not wired up. |
| width/height | the panel's addressable resolution - subclasses with a rotation concept (e.g. ILI9341Driver8080RP2040) override width()/height() themselves instead and can ignore these. |
| clockDiv | PIO state machine clock divider - the program runs at 2 PIO-clock cycles/byte, so the WR toggle rate is (clock_sys_hz / clockDiv) / 2. Default (8.0) gives roughly 7.8MHz at a stock 125MHz system clock - comfortably inside most 8080 panels' timing spec; lower it for a faster panel/wiring, raise it if data looks corrupted (a symptom of the panel not keeping up). |
| pio | which PIO block to use (pio0/pio1) - pick one not already fully claimed by another peripheral (e.g. an RP2040 audio driver using PIO for I2S). |
|
inlineoverride |
|
inlineprotected |
Claims a state machine + DMA channel and starts the PIO program. Subclasses call this first thing in their begin() (after setupPinsAndReset()), then send their chip's own init register sequence via writeCommand()/writeDataN() before returning.
|
inlineoverridevirtual |
Reimplemented from DisplayDriver< RGB_T >.
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
Reimplemented in ILI9341Driver8080RP2040< RGB_T >.
|
inlineoverrideprotectedvirtual |
Implements DisplayDriver< RGB_T >.
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
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 ILI9341Driver8080RP2040< RGB_T >.
|
inlineprotected |
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Writes each byte as a separate writeData8() call - a convenience for sending a command's multi-byte parameter list during init sequences, matching DisplayDriverSPI::writeDataN()/DisplayDriverParallel8's writeDataN().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |