Adafruit HX8357 Arduino Library
Public Member Functions | List of all members
Adafruit_HX8357 Class Reference

Class to manage hardware interface with HX8357 chipset. More...

#include <Adafruit_HX8357.h>

Inheritance diagram for Adafruit_HX8357:

Public Member Functions

 Adafruit_HX8357 (int8_t _CS, int8_t _DC, int8_t _MOSI, int8_t _SCLK, int8_t _RST, int8_t _MISO, uint8_t type=HX8357D)
 Constructor for Adafruit_HX8357 displays, using software (bitbang) SPI. More...
 
 Adafruit_HX8357 (int8_t _CS, int8_t _DC, int8_t _RST=-1, uint8_t type=HX8357D)
 Constructor for Adafruit_HX8357 displays, using the default hardware SPI interface. More...
 
 Adafruit_HX8357 (SPIClass *spi, int8_t _CS, int8_t _DC, int8_t _RST=-1, uint8_t type=HX8357D)
 Constructor for Adafruit_HX8357 displays, using an arbitrary SPI interface. More...
 
 Adafruit_HX8357 (tftBusWidth busWidth, int8_t d0, int8_t wr, int8_t dc, int8_t cs=-1, int8_t rst=-1, int8_t rd=-1)
 Constructor for Adafruit_HX8357 displays, using parallel interface. More...
 
 ~Adafruit_HX8357 (void)
 Destructor for Adafruit_HX8357 object. More...
 
void begin (uint32_t freq=0)
 Initialize HX8357 chip. Connects to the HX8357 over SPI and sends initialization commands. More...
 
void setRotation (uint8_t r)
 Set origin of (0,0) and orientation of TFT display. More...
 
void invertDisplay (boolean i)
 Enable/Disable display color inversion. More...
 
void setAddrWindow (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 Set the "address window" - the rectangle we will write to graphics RAM with the next chunk of SPI data writes. The HX8357 will automatically wrap the data as each row is filled. More...
 

Detailed Description

Class to manage hardware interface with HX8357 chipset.

Constructor & Destructor Documentation

◆ Adafruit_HX8357() [1/4]

Adafruit_HX8357::Adafruit_HX8357 ( int8_t  cs,
int8_t  dc,
int8_t  mosi,
int8_t  sclk,
int8_t  rst,
int8_t  miso,
uint8_t  type = HX8357D 
)

Constructor for Adafruit_HX8357 displays, using software (bitbang) SPI.

Parameters
csChip select pin (using Arduino pin numbering).
dcData/Command pin (using Arduino pin numbering).
mosiSPI MOSI pin (using Arduino pin numbering).
sclkSPI Clock pin (using Arduino pin numbering).
rstReset pin (Arduino pin numbering, optional, pass -1 if unused).
misoSPI MISO pin (Arduino pin #, optional, pass -1 if unused).
typeDisplay type, HX8357D (default if unspecified) or HX8357B.
Returns
Adafruit_HX8357 object.
Note
Call the object's begin() function before use.

◆ Adafruit_HX8357() [2/4]

Adafruit_HX8357::Adafruit_HX8357 ( int8_t  cs,
int8_t  dc,
int8_t  rst = -1,
uint8_t  type = HX8357D 
)

Constructor for Adafruit_HX8357 displays, using the default hardware SPI interface.

Parameters
csChip select pin (using Arduino pin numbering).
dcData/Command pin (using Arduino pin numbering).
rstReset pin (Arduino pin numbering, optional, pass -1 if unused).
typeDisplay type, HX8357D (default if unspecified) or HX8357B.
Returns
Adafruit_HX8357 object.
Note
Call the object's begin() function before use.

◆ Adafruit_HX8357() [3/4]

Adafruit_HX8357::Adafruit_HX8357 ( SPIClass *  spi,
int8_t  cs,
int8_t  dc,
int8_t  rst = -1,
uint8_t  type = HX8357D 
)

Constructor for Adafruit_HX8357 displays, using an arbitrary SPI interface.

Parameters
spiSPI peripheral to use.
csChip select pin (using Arduino pin numbering).
dcData/Command pin (using Arduino pin numbering).
rstReset pin (Arduino pin numbering, optional, pass -1 if unused).
typeDisplay type, HX8357D (default if unspecified) or HX8357B.
Returns
Adafruit_HX8357 object.
Note
Call the object's begin() function before use.

◆ Adafruit_HX8357() [4/4]

Adafruit_HX8357::Adafruit_HX8357 ( tftBusWidth  busWidth,
int8_t  d0,
int8_t  wr,
int8_t  dc,
int8_t  cs = -1,
int8_t  rst = -1,
int8_t  rd = -1 
)

Constructor for Adafruit_HX8357 displays, using parallel interface.

Parameters
busWidthIf tft16 (enumeration in Adafruit_SPITFT.h), is a 16-bit interface, else 8-bit.
d0Data pin 0 (MUST be a byte- or word-aligned LSB of a PORT register – pins 1-n are extrapolated from this).
wrWrite strobe pin # (required).
dcData/Command pin # (required).
csChip select pin # (optional, pass -1 if unused and CS is tied to GND).
rstReset pin # (optional, pass -1 if unused).
rdRead strobe pin # (optional, pass -1 if unused).

◆ ~Adafruit_HX8357()

Adafruit_HX8357::~Adafruit_HX8357 ( void  )

Destructor for Adafruit_HX8357 object.

Returns
None (void).

Member Function Documentation

◆ begin()

void Adafruit_HX8357::begin ( uint32_t  freq = 0)

Initialize HX8357 chip. Connects to the HX8357 over SPI and sends initialization commands.

Parameters
freqSPI bitrate – default of 0 will use a (usually) platform- optimized value, e.g. 8 MHz on AVR, 12 MHz on M0.
Returns
None (void).

◆ setRotation()

void Adafruit_HX8357::setRotation ( uint8_t  m)

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

Parameters
mThe index for rotation, from 0-3 inclusive
Returns
None (void).

◆ invertDisplay()

void Adafruit_HX8357::invertDisplay ( boolean  invert)

Enable/Disable display color inversion.

Parameters
invertTrue to invert display, False for normal color.
Returns
None (void).

◆ setAddrWindow()

void Adafruit_HX8357::setAddrWindow ( uint16_t  x1,
uint16_t  y1,
uint16_t  w,
uint16_t  h 
)

Set the "address window" - the rectangle we will write to graphics RAM with the next chunk of SPI data writes. The HX8357 will automatically wrap the data as each row is filled.

Parameters
x1Leftmost column of rectangle (screen pixel coordinates).
y1Topmost row of rectangle (screen pixel coordinates).
wWidth of rectangle.
hHeight of rectangle.
Returns
None (void).

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