TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DisplayDriverParallel8ESP32< RGB_T > Class Template Reference

Hardware-accelerated 8-bit parallel ("Intel 8080"-style) TFT display driver for ESP32-family targets, built on ESP-IDF's esp_lcd panel-IO layer - the same layer DisplayDriverQSPI.h uses for QSPI, just pointed at a different underlying peripheral. Where DisplayDriverSPI.h's hardware-parallel counterpart (DisplayDriverParallel8.h) bit-bangs D0-D7 one digitalWrite() per bit, this class drives the bus via DMA through whichever peripheral the target actually has: More...

#include <DisplayDriverParallel8ESP32.h>

Inheritance diagram for DisplayDriverParallel8ESP32< RGB_T >:
Inheritance graph
[legend]
Collaboration diagram for DisplayDriverParallel8ESP32< RGB_T >:
Collaboration graph
[legend]

Public Member Functions

 DisplayDriverParallel8ESP32 (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, size_t width=240, size_t height=320, uint32_t pclkHz=20000000)
 
void end () override
 
 ~DisplayDriverParallel8ESP32 () 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

bool beginBus ()
 
bool writeCommand (uint8_t cmd, const uint8_t *param=nullptr, size_t len=0)
 
bool writeCommand (uint8_t cmd, std::initializer_list< uint8_t > data)
 
bool setAddressWindow (size_t x, size_t y, size_t w, size_t h) override
 
virtual bool setAddressWindow (size_t x, size_t y, size_t w, size_t h)=0
 

Protected Attributes

int8_t d_ [8]
 
int8_t wr_
 
int8_t dc_
 
int8_t cs_
 
size_t width_
 
size_t height_
 
uint32_t pclkHz_
 
esp_lcd_panel_io_handle_t io_ = nullptr
 
esp_lcd_i80_bus_handle_t bus_ = nullptr
 
uint8_t * scratch_ = nullptr
 
size_t scratchCapacity_ = 0
 
volatile bool colorTransPending_ = false
 
- Protected Attributes inherited from DisplayDriver< RGB_T >
Font5x7< RGB_T > defaultFont
 

Static Protected Attributes

static constexpr uint8_t kCmdRamWrite = 0x2C
 

Detailed Description

template<typename RGB_T = RGB565>
class tinygpu::DisplayDriverParallel8ESP32< RGB_T >

Hardware-accelerated 8-bit parallel ("Intel 8080"-style) TFT display driver for ESP32-family targets, built on ESP-IDF's esp_lcd panel-IO layer - the same layer DisplayDriverQSPI.h uses for QSPI, just pointed at a different underlying peripheral. Where DisplayDriverSPI.h's hardware-parallel counterpart (DisplayDriverParallel8.h) bit-bangs D0-D7 one digitalWrite() per bit, this class drives the bus via DMA through whichever peripheral the target actually has:

Which backend compiles is decided automatically from the target's soc_caps.h (TINYGPU_PARALLEL8_BACKEND_I80 / _PARLIO, set above) - the public API (constructor, writeCommand()/writeData()/setAddressWindow()) is identical either way, so concrete panel drivers below don't need to know or care which peripheral is underneath.

Build-verified (compiles and links) for the I80 backend via arduino-cli against esp32:esp32 3.3.10 on an ESP32-S3 target (esp32:esp32:adafruit_metro_esp32s3). The PARLIO backend's source compiles cleanly against the same core/version on an ESP32-C6 target (esp32:esp32:esp32c6), but fails to link there: esp_lcd_new_panel_io_parl is declared in that core's esp_lcd headers but missing from its prebuilt esp32-arduino-libs static libraries for C6 - an SDK-packaging gap in that specific core version, not a bug in this file. Verify linking against whatever core version you actually build with before relying on the PARLIO path; a plain ESP-IDF build (rather than arduino-esp32) may not have this gap.

Subclasses call the inherited beginBus() first thing in their begin() (setting up the bus/panel-IO), then send their chip's own init register sequence via writeCommand() - the same division of labor DisplayDriverQSPI.h's beginBus()/writeCommand() split uses.

Constructor & Destructor Documentation

◆ DisplayDriverParallel8ESP32()

DisplayDriverParallel8ESP32 ( 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,
size_t  width = 240,
size_t  height = 320,
uint32_t  pclkHz = 20000000 
)
inline
Parameters
d0..d7the 8 data lines, D0 = least significant bit.
wrwrite-strobe pin (WR on I80, wired to PARLIO's clk_gpio_num on PARLIO targets - PARLIO calls the same physical strobe line "clk").
dcdata/command ("RS") select pin.
cschip-select pin, or -1 to declare exclusive bus ownership (I80 backend only - the PARLIO backend always wants a real CS pin).
width/heightthe panel's addressable resolution - subclasses with a rotation concept (e.g. ILI9341Driver8080ESP32) override width()/height() themselves instead and can ignore these.

◆ ~DisplayDriverParallel8ESP32()

~DisplayDriverParallel8ESP32 ( )
inlineoverride

Member Function Documentation

◆ beginBus()

bool beginBus ( )
inlineprotected

Sets up the bus (I80 or PARLIO, picked at compile time above) and the panel-IO layer. Subclasses call this first thing in their begin(), then send their chip's own init register sequence via writeCommand() before returning.

◆ end()

void end ( )
inlineoverridevirtual

Reimplemented from DisplayDriver< RGB_T >.

◆ height()

size_t height ( ) const
inlineoverridevirtual

◆ setAddressWindow()

bool setAddressWindow ( size_t  x,
size_t  y,
size_t  w,
size_t  h 
)
inlineoverrideprotectedvirtual

◆ width()

size_t width ( ) const
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 ILI9341Driver8080ESP32< RGB_T >.

◆ writeCommand() [1/2]

bool writeCommand ( uint8_t  cmd,
const uint8_t *  param = nullptr,
size_t  len = 0 
)
inlineprotected

◆ writeCommand() [2/2]

bool writeCommand ( uint8_t  cmd,
std::initializer_list< uint8_t >  data 
)
inlineprotected

Convenience for an init sequence's fixed, short parameter lists - mirrors DisplayDriverSPI::writeDataN()/DisplayDriverQSPI's inline {data} calls, just spelled as one call instead of N.

◆ 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

Member Data Documentation

◆ bus_

esp_lcd_i80_bus_handle_t bus_ = nullptr
protected

◆ colorTransPending_

volatile bool colorTransPending_ = false
protected

◆ cs_

int8_t cs_
protected

◆ d_

int8_t d_[8]
protected

◆ dc_

int8_t dc_
protected

◆ height_

size_t height_
protected

◆ io_

esp_lcd_panel_io_handle_t io_ = nullptr
protected

◆ kCmdRamWrite

constexpr uint8_t kCmdRamWrite = 0x2C
staticconstexprprotected

◆ pclkHz_

uint32_t pclkHz_
protected

◆ scratch_

uint8_t* scratch_ = nullptr
protected

◆ scratchCapacity_

size_t scratchCapacity_ = 0
protected

◆ width_

size_t width_
protected

◆ wr_

int8_t wr_
protected

The documentation for this class was generated from the following file: