The ST7735 Matrix Display Class.
More...
#include <st7735_matrix.h>
Inherits Adafruit_ST7735.
|
| St7735Matrix (uint8_t csPin, uint8_t dcPin, uint8_t rsPin, uint8_t hardware, uint8_t rotation) |
|
void | begin () |
|
bool | getTextWrap () const |
|
int16_t | getCursorX () const |
|
int16_t | getCursorY () const |
|
uint16_t | getTextColor () const |
|
uint16_t | getTextBackground () const |
|
void | getCharBounds (unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy) |
|
bool | printFormatted (int16_t x, int16_t y, int16_t w, int16_t align, String content, uint8_t baseLine, uint8_t yAdvance=0) |
|
The ST7735 Matrix Display Class.
This class derived from Adafruit's ST7735 TFT driver class provides an implementation of a TFT dot matrix display based on the Sitronix ST7735 color single-chip TFT controller connected via SPI.
◆ St7735Matrix()
ustd::St7735Matrix::St7735Matrix |
( |
uint8_t |
csPin, |
|
|
uint8_t |
dcPin, |
|
|
uint8_t |
rsPin, |
|
|
uint8_t |
hardware, |
|
|
uint8_t |
rotation |
|
) |
| |
|
inline |
Instantiate Adafruit ST7735 driver with default hardware SPI
- Parameters
-
csPin | Chip select pin # |
dcPin | Data/Command pin # |
rsPin | Reset pin # (optional, pass -1 if unused) |
hardware | Hardware type (one of INITR_GREENTAB, INITR_REDTAB, INITR_BLACKTAB, INITR_MINI160x80 or INITR_HALLOWING) |
rotation | Define if and how the display is rotated. rotation can be a numeric value from 0 to 3 representing respectively no rotation, 90 degrees clockwise, 180 degrees and 90 degrees counter clockwise. |
◆ begin()
void ustd::St7735Matrix::begin |
( |
| ) |
|
|
inline |
◆ getCharBounds()
void ustd::St7735Matrix::getCharBounds |
( |
unsigned char |
c, |
|
|
int16_t * |
x, |
|
|
int16_t * |
y, |
|
|
int16_t * |
minx, |
|
|
int16_t * |
miny, |
|
|
int16_t * |
maxx, |
|
|
int16_t * |
maxy |
|
) |
| |
|
inline |
Calculates the bounding box of a character
- Parameters
-
c | The ASCII character in question |
x | Pointer to x location of character. Value is modified by this function to advance to next character. |
y | Pointer to y location of character. Value is modified by this function to advance to next character. |
minx | Pointer to minimum X coordinate, passed in to AND returned by this function – this is used to incrementally build a bounding rectangle for a string. |
miny | Pointer to minimum Y coord, passed in AND returned. |
maxx | Pointer to maximum X coord, passed in AND returned. |
maxy | Pointer to maximum Y coord, passed in AND returned. |
◆ getCursorX()
int16_t ustd::St7735Matrix::getCursorX |
( |
| ) |
const |
|
inline |
Get text cursor X location
- Returns
- X coordinate in digit positions
◆ getCursorY()
int16_t ustd::St7735Matrix::getCursorY |
( |
| ) |
const |
|
inline |
Get text cursor Y location
- Returns
- Y coordinate in digit positions
◆ getTextBackground()
uint16_t ustd::St7735Matrix::getTextBackground |
( |
| ) |
const |
|
inline |
Get text background color value
- Returns
- Text background color value
◆ getTextColor()
uint16_t ustd::St7735Matrix::getTextColor |
( |
| ) |
const |
|
inline |
Get text color value
- Returns
- Text color value
◆ getTextWrap()
bool ustd::St7735Matrix::getTextWrap |
( |
| ) |
const |
|
inline |
Returns if too long text will be wrapped to the next line
- Returns
- Wrapping mode
◆ printFormatted()
bool ustd::St7735Matrix::printFormatted |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
align, |
|
|
String |
content, |
|
|
uint8_t |
baseLine, |
|
|
uint8_t |
yAdvance = 0 |
|
) |
| |
|
inline |
Prints a text at a specified location with a specified formatting
This method prints a text at the specified location with the specified length using left, right or centered alignment. All parameters are checked for plasibility and will be adapted to the current display size.
- Parameters
-
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in digit positions |
align | Alignment of the string to display: 0 = left, 1 = center, 2 = right |
content | The string to print |
baseLine | The distance between baseline and topline |
yAdvance | The newline distance - If specified, the height of the calculated bounding box is adjusted to a multiple of this value |
- Returns
true
if the string fits the defined space, false
if output was truncated
The documentation for this class was generated from the following file: