Adafruit ST77XX Display Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Adafruit_ST77xx Class Reference

Subclass of SPITFT for ST77xx displays (lots in common!) More...

#include <Adafruit_ST77xx.h>

Inheritance diagram for Adafruit_ST77xx:
Adafruit_ST7735 Adafruit_ST7789 Adafruit_ST7796S

Public Member Functions

 Adafruit_ST77xx (uint16_t w, uint16_t h, int8_t _CS, int8_t _DC, int8_t _MOSI, int8_t _SCLK, int8_t _RST=-1, int8_t _MISO=-1)
 Instantiate Adafruit ST77XX driver with software SPI. More...
 
 Adafruit_ST77xx (uint16_t w, uint16_t h, int8_t CS, int8_t RS, int8_t RST=-1)
 Instantiate Adafruit ST77XX driver with hardware SPI. More...
 
 Adafruit_ST77xx (uint16_t w, uint16_t h, SPIClass *spiClass, int8_t CS, int8_t RS, int8_t RST=-1)
 Instantiate Adafruit ST77XX driver with selectable hardware SPI. More...
 
void setAddrWindow (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 SPI displays set an address window rectangle for blitting pixels. More...
 
void setRotation (uint8_t r)
 Set origin of (0,0) and orientation of TFT display. More...
 
void enableDisplay (boolean enable)
 Change whether display is on or off. More...
 
void enableTearing (boolean enable)
 Change whether TE pin output is on or off. More...
 
void enableSleep (boolean enable)
 Change whether sleep mode is on or off. More...
 

Protected Member Functions

void begin (uint32_t freq=0)
 Initialize ST77xx chip. Connects to the ST77XX over SPI and sends initialization procedure commands. More...
 
void commonInit (const uint8_t *cmdList)
 Initialization code common to all ST77XX displays. More...
 
void displayInit (const uint8_t *addr)
 Companion code to the initiliazation tables. Reads and issues a series of LCD commands stored in PROGMEM byte array. More...
 
void setColRowStart (int8_t col, int8_t row)
 Set origin of (0,0) of display with offsets. More...
 

Protected Attributes

uint8_t _colstart = 0
 Some displays need this changed to offset.
 
uint8_t _rowstart = 0
 Some displays need this changed to offset.
 
uint8_t spiMode = SPI_MODE0
 Certain display needs MODE3 instead.
 

Detailed Description

Subclass of SPITFT for ST77xx displays (lots in common!)

Constructor & Destructor Documentation

◆ Adafruit_ST77xx() [1/3]

Adafruit_ST77xx::Adafruit_ST77xx ( uint16_t  w,
uint16_t  h,
int8_t  cs,
int8_t  dc,
int8_t  mosi,
int8_t  sclk,
int8_t  rst = -1,
int8_t  miso = -1 
)

Instantiate Adafruit ST77XX driver with software SPI.

Parameters
wDisplay width in pixels at default rotation setting (0)
hDisplay height in pixels at default rotation setting (0)
csChip select pin #
dcData/Command pin #
mosiSPI MOSI pin #
sclkSPI Clock pin #
rstReset pin # (optional, pass -1 if unused)
misoSPI MISO pin # (optional, pass -1 if unused)

◆ Adafruit_ST77xx() [2/3]

Adafruit_ST77xx::Adafruit_ST77xx ( uint16_t  w,
uint16_t  h,
int8_t  cs,
int8_t  dc,
int8_t  rst = -1 
)

Instantiate Adafruit ST77XX driver with hardware SPI.

Parameters
wDisplay width in pixels at default rotation setting (0)
hDisplay height in pixels at default rotation setting (0)
csChip select pin #
dcData/Command pin #
rstReset pin # (optional, pass -1 if unused)

◆ Adafruit_ST77xx() [3/3]

Adafruit_ST77xx::Adafruit_ST77xx ( uint16_t  w,
uint16_t  h,
SPIClass *  spiClass,
int8_t  cs,
int8_t  dc,
int8_t  rst = -1 
)

Instantiate Adafruit ST77XX driver with selectable hardware SPI.

Parameters
wDisplay width in pixels at default rotation setting (0)
hDisplay height in pixels at default rotation setting (0)
spiClassA pointer to an SPI device to use (e.g. &SPI1)
csChip select pin #
dcData/Command pin #
rstReset pin # (optional, pass -1 if unused)

Member Function Documentation

◆ setAddrWindow()

void Adafruit_ST77xx::setAddrWindow ( uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)

SPI displays set an address window rectangle for blitting pixels.

Parameters
xTop left corner x coordinate
yTop left corner y coordinate
wWidth of window
hHeight of window

◆ setRotation()

void Adafruit_ST77xx::setRotation ( uint8_t  m)

Set origin of (0,0) and orientation of TFT display.

Parameters
mThe index for rotation, from 0-3 inclusive

◆ enableDisplay()

void Adafruit_ST77xx::enableDisplay ( boolean  enable)

Change whether display is on or off.

Parameters
enableTrue if you want the display ON, false OFF

◆ enableTearing()

void Adafruit_ST77xx::enableTearing ( boolean  enable)

Change whether TE pin output is on or off.

Parameters
enableTrue if you want the TE pin ON, false OFF

◆ enableSleep()

void Adafruit_ST77xx::enableSleep ( boolean  enable)

Change whether sleep mode is on or off.

Parameters
enableTrue if you want sleep mode ON, false OFF

◆ begin()

void Adafruit_ST77xx::begin ( uint32_t  freq = 0)
protected

Initialize ST77xx chip. Connects to the ST77XX over SPI and sends initialization procedure commands.

Parameters
freqDesired SPI clock frequency

◆ commonInit()

void Adafruit_ST77xx::commonInit ( const uint8_t *  cmdList)
protected

Initialization code common to all ST77XX displays.

Parameters
cmdListFlash memory array with commands and data to send

◆ displayInit()

void Adafruit_ST77xx::displayInit ( const uint8_t *  addr)
protected

Companion code to the initiliazation tables. Reads and issues a series of LCD commands stored in PROGMEM byte array.

Parameters
addrFlash memory array with commands and data to send

◆ setColRowStart()

void Adafruit_ST77xx::setColRowStart ( int8_t  col,
int8_t  row 
)
protected

Set origin of (0,0) of display with offsets.

Parameters
colThe offset from 0 for the column address
rowThe offset from 0 for the row address

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