FabGL
ESP32 Display Controller and Graphics Library

◆ begin() [1/4]

void begin ( SPIClass *  spi,
gpio_num_t  DC,
gpio_num_t  RESX = GPIO_UNUSED,
gpio_num_t  CS = GPIO_UNUSED 
)

Initializes TFT display controller with Arduino style SPIClass object.

Parameters
spiSPIClass object.
DCGPIO of D/C signal (Data/Command).
RESXGPIO of Reset signal (can be GPIO_UNUSED).
CSGPIO of Optional select signal (can be GPIO_UNUSED). Without CS signal it is impossible to share SPI channel with other devices.

Example:

fabgl::ST7789Controller DisplayController;

// SCK = 18, MOSI = 23, D/C = 22, RESX = 21
SPI.begin(18, -1, 23);
DisplayController.begin(&SPI, GPIO_NUM_22, GPIO_NUM_21);
DisplayController.setResolution(TFT_240x240);
Examples:
ST7789_TFT/240x240/DoubleBuffer/DoubleBuffer.ino, ST7789_TFT/240x240/FileBrowser/FileBrowser.ino, ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino, and ST7789_TFT/240x240/Sprites/Sprites.ino.

Definition at line 146 of file TFTControllerGeneric.cpp.