TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LCDBoardTFTeSPI Class Reference

LCDBoard wrapping a single TFT_eSPI instance, shared between its DisplayDriverTFTeSPI and (optional) TouchDriverTFTeSPI. More...

#include <LCDBoardsTFTeSPI.h>

Inheritance diagram for LCDBoardTFTeSPI:
Inheritance graph
[legend]
Collaboration diagram for LCDBoardTFTeSPI:
Collaboration graph
[legend]

Public Member Functions

 LCDBoardTFTeSPI (size_t width, size_t height, bool hasTouch=false, uint16_t touchThreshold=600)
 
bool begin () override
 
size_t width () const override
 Panel width in pixels, as passed to the constructor.
 
size_t height () const override
 Panel height in pixels, as passed to the constructor.
 
DisplayDriverTFTeSPI< RGB565 > & display () override
 The board's display driver.
 
TouchDriver * touch () override
 The board's touch controller, or nullptr if hasTouch was false.
 
const I2SPins & i2s () const override
 No I2S bus tracked here - every field is -1.
 
const LEDPins & led () const override
 No LED tracked here - every field is -1.
 
TFT_eSPI & tft ()
 
- Public Member Functions inherited from LCDBoard
virtual ~LCDBoard ()=default
 
virtual bool begin ()=0
 
virtual size_t width () const =0
 Panel width in pixels.
 
virtual size_t height () const =0
 Panel height in pixels.
 
virtual DisplayDriver< RGB565 > & display ()=0
 The board's display driver.
 
virtual TouchDriver * touch ()=0
 The board's touch controller, or nullptr if none is wired up.
 
virtual const I2SPins & i2s () const =0
 The board's I2S/PA pin assignment.
 
virtual const LEDPins & led () const =0
 The board's LED pin assignment.
 
virtual int8_t backlightPin () const
 
template<typename I2SConfig >
void setI2SPins (I2SConfig &cfg)
 

Detailed Description

LCDBoard wrapping a single TFT_eSPI instance, shared between its DisplayDriverTFTeSPI and (optional) TouchDriverTFTeSPI.

All panel-specific configuration (controller, pins, SPI frequency, ...) is TFT_eSPI's own User_Setup.h/User_Setup_Select.h job, same as any other TFT_eSPI sketch - width/height are still passed to the constructor (rather than read from TFT_eSPI) because, like every other LCDBoard here, callers may need them before begin() runs.

Touch is opt-in via the constructor's hasTouch flag (many TFT_eSPI panels have no touch hardware at all) - touch() returns nullptr when disabled. When enabled, use tft() to reach TFT_eSPI's own touch calibration (tft().setTouch(calData), from tft().calibrateTouch(...) or a hardcoded panel-specific array) before calling begin() - TFT_eSPI owns touch calibration entirely, the same "driver does not own bus/calibration setup, the application does" split TouchDriverArduino.h's drivers use for their own SPI/I2C buses.

No backlight/I2S/LED pin handling here - TFT_eSPI's own User_Setup.h covers the backlight pin (TFT_BL) if your panel needs one driven manually; i2s()/led() report "not present" (every field -1) and backlightPin() is -1, the same as LCDBoardDesktopSDL.

Constructor & Destructor Documentation

◆ LCDBoardTFTeSPI()

LCDBoardTFTeSPI ( size_t  width,
size_t  height,
bool  hasTouch = false,
uint16_t  touchThreshold = 600 
)
inlineexplicit

Member Function Documentation

◆ begin()

bool begin ( )
inlineoverridevirtual

Initializes TFT_eSPI (via DisplayDriverTFTeSPI::begin()) and, if hasTouch was set, the touch driver.

Implements LCDBoard.

◆ display()

DisplayDriverTFTeSPI< RGB565 > & display ( )
inlineoverridevirtual

The board's display driver.

Implements LCDBoard.

◆ height()

size_t height ( ) const
inlineoverridevirtual

Panel height in pixels, as passed to the constructor.

Implements LCDBoard.

◆ i2s()

const I2SPins & i2s ( ) const
inlineoverridevirtual

No I2S bus tracked here - every field is -1.

Implements LCDBoard.

◆ led()

const LEDPins & led ( ) const
inlineoverridevirtual

No LED tracked here - every field is -1.

Implements LCDBoard.

◆ tft()

TFT_eSPI & tft ( )
inline

Direct access to the underlying TFT_eSPI instance - e.g. for touch calibration (see class comment) or any TFT_eSPI feature this driver doesn't wrap.

◆ touch()

TouchDriver * touch ( )
inlineoverridevirtual

The board's touch controller, or nullptr if hasTouch was false.

Implements LCDBoard.

◆ width()

size_t width ( ) const
inlineoverridevirtual

Panel width in pixels, as passed to the constructor.

Implements LCDBoard.


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