Peritoneal Dialysis Capstone
Controlling catheter for peritoneal dialysis
Loading...
Searching...
No Matches
AdafruitTFTDriver Class Reference

An implementation of TFTDriver for the Adafruit 0.96" 160x80 Color TFT Display. More...

#include <AdafruitTFTDriver.h>

Inheritance diagram for AdafruitTFTDriver:
Collaboration diagram for AdafruitTFTDriver:

Public Member Functions

 AdafruitTFTDriver (int csPin, int dcPin)
 Instantiate the Adafruit driver using hardware SPI.
void initialize () override
 Initializes the display.
unsigned getScreenWidth () const override
 Returns the width, in pixels, of the screen.
unsigned getScreenHeight () const override
 Returns the height, in pixels, of the screen.
unsigned getTextWidth () const override
 Returns the width, in pixels, of one character.
unsigned getTextHeight () const override
 Returns the height, in pixels, of one character.
void clearScreen (TFTColor color) override
 Assigns one color to all pixels on the screen, clearing any previously drawn text.
void drawText (TFTPoint topLeft, TFTColor textColor, TFTColor bgColor, const char *string) override
 Draws monospace text.

Private Types

using Color565 = uint16_t

Static Private Member Functions

static Color565 encodeColor (TFTColor color)
 Converts an abstract color to the representation used by the Adafruit ST7735 library.

Private Attributes

Adafruit_ST7735 m_gfx

Static Private Attributes

static constexpr uint8_t DISPLAY_REVISION {INITR_MINI160x80_PLUGIN}
static constexpr unsigned TEXT_SCALE {2}
static constexpr unsigned SCREEN_ORIENTATION {1}
static constexpr unsigned DEFAULT_TEXT_WIDTH {6}
static constexpr unsigned DEFAULT_TEXT_HEIGHT {8}

Detailed Description

An implementation of TFTDriver for the Adafruit 0.96" 160x80 Color TFT Display.

Member Typedef Documentation

◆ Color565

using AdafruitTFTDriver::Color565 = uint16_t
private

Constructor & Destructor Documentation

◆ AdafruitTFTDriver()

AdafruitTFTDriver::AdafruitTFTDriver ( int csPin,
int dcPin )

Instantiate the Adafruit driver using hardware SPI.

Parameters
csPinThe SPI chip select pin
dcPinThe SPI data/command pin

Member Function Documentation

◆ clearScreen()

void AdafruitTFTDriver::clearScreen ( TFTColor color)
overridevirtual

Assigns one color to all pixels on the screen, clearing any previously drawn text.

Parameters
colorThe color to assign.

Implements TFTDriver.

◆ drawText()

void AdafruitTFTDriver::drawText ( TFTPoint topLeft,
TFTColor textColor,
TFTColor bgColor,
const char * string )
overridevirtual

Draws monospace text.

If the text goes off the right edge of the screen, it is wrapped to the next line.

Parameters
topLeftThe top-left position of the first character.
textColorThe text color.
bgColorThe background color.
stringThe NUL-terminated ASCII string to draw.

Implements TFTDriver.

◆ encodeColor()

AdafruitTFTDriver::Color565 AdafruitTFTDriver::encodeColor ( TFTColor color)
staticprivate

Converts an abstract color to the representation used by the Adafruit ST7735 library.

◆ getScreenHeight()

unsigned AdafruitTFTDriver::getScreenHeight ( ) const
nodiscardoverridevirtual

Returns the height, in pixels, of the screen.

Implements TFTDriver.

◆ getScreenWidth()

unsigned AdafruitTFTDriver::getScreenWidth ( ) const
nodiscardoverridevirtual

Returns the width, in pixels, of the screen.

Implements TFTDriver.

◆ getTextHeight()

unsigned AdafruitTFTDriver::getTextHeight ( ) const
nodiscardoverridevirtual

Returns the height, in pixels, of one character.

Implements TFTDriver.

◆ getTextWidth()

unsigned AdafruitTFTDriver::getTextWidth ( ) const
nodiscardoverridevirtual

Returns the width, in pixels, of one character.

Implements TFTDriver.

◆ initialize()

void AdafruitTFTDriver::initialize ( )
overridevirtual

Initializes the display.

The display must be initialized before any other functions are called.

Implements TFTDriver.

Member Data Documentation

◆ DEFAULT_TEXT_HEIGHT

unsigned AdafruitTFTDriver::DEFAULT_TEXT_HEIGHT {8}
staticconstexprprivate

◆ DEFAULT_TEXT_WIDTH

unsigned AdafruitTFTDriver::DEFAULT_TEXT_WIDTH {6}
staticconstexprprivate

◆ DISPLAY_REVISION

uint8_t AdafruitTFTDriver::DISPLAY_REVISION {INITR_MINI160x80_PLUGIN}
staticconstexprprivate

◆ m_gfx

Adafruit_ST7735 AdafruitTFTDriver::m_gfx
private

◆ SCREEN_ORIENTATION

unsigned AdafruitTFTDriver::SCREEN_ORIENTATION {1}
staticconstexprprivate

◆ TEXT_SCALE

unsigned AdafruitTFTDriver::TEXT_SCALE {2}
staticconstexprprivate

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