19#ifndef DISPLAYINTERFACE_H
20#define DISPLAYINTERFACE_H
75 void setId(uint8_t displayId);
104 void formatRow(
int row,
const char *text);
172 bool _isRGB(
const char *colour);
Class to abstract away all physical display implementation to enable multiple display types.
Definition DisplayInterface.h:36
int getScreenId()
Get the Screen ID this display is currently displaing.
Definition DisplayInterface.cpp:36
int _csPin
If there are more than one SPI displays that libraries don't officially support, the CS pin can be pr...
Definition DisplayInterface.h:136
void setScreenId(int screenId)
Set the Screen ID this display is currently displaying.
Definition DisplayInterface.cpp:31
DisplayInterface * _next
Pointer to the next DisplayInterface derived instance in the list.
Definition DisplayInterface.h:111
void formatRow(int row, const char *text)
Static method to enable calling back to a derived class with a formatted row.
Definition DisplayInterface.cpp:58
uint8_t _fontWidth
Calculated font width to determine column positioning.
Definition DisplayInterface.h:133
void setNeedsRedraw(bool redraw)
Set the flag for whether this display needs redrawing or not - individual row updates are not affecte...
Definition DisplayInterface.cpp:40
uint8_t getId()
Get the ID of this display instance.
Definition DisplayInterface.cpp:29
void setLogger(Logger *logger)
Set the logger instance to use for diagnostic logging.
Definition DisplayInterface.cpp:25
uint8_t _displayId
ID for this display instance.
Definition DisplayInterface.h:119
Logger * _logger
Pointer to the Logger instance for the DisplayInterface derived classes.
Definition DisplayInterface.h:117
uint8_t _rotation
Orientation of this display, most displays require this setting otherwise ignore it.
Definition DisplayInterface.h:123
RowAttributes _setAttribute(RowAttributes attributes, char modifier, uint16_t colour=0xFFFF)
Update the provided RowAttributes struct according to the provided modifier.
Definition DisplayInterface.cpp:170
int _screenId
ID of the screen this display is currently displaying, defaults to -1 to flag it is not a valid ID.
Definition DisplayInterface.h:121
uint8_t _maxColumn
Maximum column number (not count) that will fit on this display (based on font width,...
Definition DisplayInterface.h:129
uint8_t _textSize
Multiplier for text size, most displays require this setting otherwise ignore it.
Definition DisplayInterface.h:125
uint16_t _textColour
Default text colour for the display.
Definition DisplayInterface.h:113
bool needsRedraw()
Test if this display needs an entire redraw.
Definition DisplayInterface.cpp:42
virtual void displayFormattedRow(uint8_t row, uint8_t column, RowAttributes attributes, const char *text, bool append)=0
Display a row using formatting modifiers.
virtual void displayStartupInfo(const char *version)=0
Display the startup screen with software version.
RowAttributes _sanitiseAttributes(RowAttributes attributes)
Sanitise the provided struct of RowAttributes.
Definition DisplayInterface.cpp:148
int getCSPin()
Get the defined CS pin for this display to see if it needs manual SPI switching.
Definition DisplayInterface.cpp:38
void setId(uint8_t displayId)
Set the ID for this display instance.
Definition DisplayInterface.cpp:27
uint8_t _maxRow
Maximum row number (not count) that will fit on this display (based on font height,...
Definition DisplayInterface.h:127
virtual void clearScreen()=0
Clear the entire screen.
virtual void begin()=0
Perform any initial once off setup or configuration here and call only once.
bool _needsRedraw
Flag that this display needs redrawing - needed for switching between screens.
Definition DisplayInterface.h:138
bool _isRGB(const char *colour)
Check if the provided string constant translates to a valid RGB colour code.
Definition DisplayInterface.cpp:194
void setNext(DisplayInterface *display)
Set the next DisplayInterface derived instance in the list.
Definition DisplayInterface.cpp:21
uint16_t _convertRGBtoRGB565(const char *colour)
Convert the provided RGB colour code string constant to a uint16_t RGB565 colour.
Definition DisplayInterface.cpp:205
uint8_t _fontHeight
Calculated font height to determine row positioning.
Definition DisplayInterface.h:131
bool _isModifier(char check)
Validates the provided char is a valid modifier.
Definition DisplayInterface.cpp:161
uint16_t _backgroundColour
Default background colour for the display.
Definition DisplayInterface.h:115
virtual ~DisplayInterface()=default
Destructor for a DisplayInterface.
virtual void displayScreen(Screen *screen)=0
Display the specified Screen on this display.
DisplayInterface * getNext()
Get the next DisplayInterface derived instance in the list.
Definition DisplayInterface.cpp:23
Class to enable simple logging to a Stream object with different log levels This enables embedding pe...
Definition Logger.h:35
Class for each screen as received from the EXRAIL SCREEN() command Each Screen instance contains a li...
Definition Screen.h:27
Structure for row attributes.
Definition DisplayInterface.h:26
bool colourSet
Definition DisplayInterface.h:27
bool isUnderlined
Definition DisplayInterface.h:28
bool isLine
Definition DisplayInterface.h:29
uint16_t textColour
Definition DisplayInterface.h:32
bool alwaysTicker
Definition DisplayInterface.h:30
bool neverTicker
Definition DisplayInterface.h:31