Adafruit Library
Public Member Functions | List of all members
DisplayHardware Class Reference

Interface for interacting with display hardware (TFT, eInk, OLED, etc.) This class provides methods to initialize, write to, and manage the state of display hardware. More...

#include <hardware.h>

Public Member Functions

 DisplayHardware (const char *name)
 Constructs a new DisplayHardware object. More...
 
 ~DisplayHardware ()
 Destructor.
 
const char * getName ()
 Gets the name of the display hardware instance. More...
 
void setType (wippersnapper_display_v1_DisplayType type)
 Sets the hardware's display type. More...
 
wippersnapper_display_v1_DisplayType getType ()
 Gets the hardware's display type. More...
 
bool beginEPD (wippersnapper_display_v1_DisplayDriver *driver, wippersnapper_display_v1_EPDConfig *config, wippersnapper_display_v1_EpdSpiConfig *spi_config)
 Configures the EPD display with the provided configuration. More...
 
bool beginTft (wippersnapper_display_v1_DisplayDriver *driver, wippersnapper_display_v1_TftConfig *config, wippersnapper_display_v1_TftSpiConfig *spi_config)
 Attempts to configure and initialize a TFT display. More...
 
void showSplash ()
 Displays the splash screen on the display.
 
void drawStatusBar (const char *io_username)
 Draws a status bar at the top of the display. More...
 
void updateStatusBar (int8_t rssi, uint8_t bat, bool mqtt_connected)
 Updates the status bar with the latest RSSI, battery, and MQTT connection status. More...
 
void writeMessage (const char *message)
 Writes a message to the display. More...
 

Detailed Description

Interface for interacting with display hardware (TFT, eInk, OLED, etc.) This class provides methods to initialize, write to, and manage the state of display hardware.

Constructor & Destructor Documentation

◆ DisplayHardware()

DisplayHardware::DisplayHardware ( const char *  name)

Constructs a new DisplayHardware object.

Parameters
nameThe name of the hardware instance.

Member Function Documentation

◆ getName()

const char * DisplayHardware::getName ( )

Gets the name of the display hardware instance.

Returns
The name of the display hardware instance.

◆ setType()

void DisplayHardware::setType ( wippersnapper_display_v1_DisplayType  type)

Sets the hardware's display type.

Parameters
typeThe display type to set.

◆ getType()

wippersnapper_display_v1_DisplayType DisplayHardware::getType ( )

Gets the hardware's display type.

Returns
The current display type.

◆ beginEPD()

bool DisplayHardware::beginEPD ( wippersnapper_display_v1_DisplayDriver *  driver,
wippersnapper_display_v1_EPDConfig *  config,
wippersnapper_display_v1_EpdSpiConfig *  spi_config 
)

Configures the EPD display with the provided configuration.

Parameters
driverPointer to a DisplayDriver enum value.
configPointer to the EPD configuration structure.
spi_configPointer to the SPI configuration structure for EPD.
Returns
True if configuration was successful, False otherwise.

◆ beginTft()

bool DisplayHardware::beginTft ( wippersnapper_display_v1_DisplayDriver *  driver,
wippersnapper_display_v1_TftConfig *  config,
wippersnapper_display_v1_TftSpiConfig *  spi_config 
)

Attempts to configure and initialize a TFT display.

Parameters
driverPointer to a DisplayDriver enum value.
configPointer to the TFT configuration structure.
spi_configPointer to the SPI configuration structure for TFT.
Returns
True if configuration was successful, False otherwise.

◆ drawStatusBar()

void DisplayHardware::drawStatusBar ( const char *  io_username)

Draws a status bar at the top of the display.

Parameters
io_usernameThe Adafruit IO username to display on the status bar.

◆ updateStatusBar()

void DisplayHardware::updateStatusBar ( int8_t  rssi,
uint8_t  bat,
bool  mqtt_connected 
)

Updates the status bar with the latest RSSI, battery, and MQTT connection status.

Parameters
rssiThe current WiFi RSSI value.
batThe current battery percentage (0-100).
mqtt_connectedTrue if connected to MQTT, False otherwise.

◆ writeMessage()

void DisplayHardware::writeMessage ( const char *  message)

Writes a message to the display.

Parameters
messageThe message to display.

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