EX-Display
EX-Display
Loading...
Searching...
No Matches
/home/runner/work/EX-Display/EX-Display/DisplayManager.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef DISPLAYMANAGER_H
19#define DISPLAYMANAGER_H
20
21#include "DisplayInterface.h"
22#include "Logger.h"
23#include "ScreenManager.h"
24
27public:
30
33 void addDisplay(DisplayInterface *display);
34
37 void createDisplays();
38
40 void startDisplays();
41
43 void clearAllDisplays();
44
47 void displayStartupInfo(const char *version);
48
51 void update(ScreenManager *screenManager);
52
56
59 DisplayInterface *getDisplayById(uint8_t displayId);
60
63 void setLogger(Logger *logger);
64
67
68private:
72
74 void _setupAllSPICSPins();
75
79};
80
81#endif // DISPLAYMANAGER_H
Class to abstract away all physical display implementation to enable multiple display types.
Definition DisplayInterface.h:36
Manages all physical displays.
Definition DisplayManager.h:26
Logger * _logger
Definition DisplayManager.h:70
DisplayInterface * getDisplayById(uint8_t displayId)
Get a DisplayInterface derived instance by its ID.
Definition DisplayManager.cpp:107
void addDisplay(DisplayInterface *display)
Add a DisplayInterface derived instance to the list of displays.
Definition DisplayManager.cpp:25
void startDisplays()
Call the begin() method for all associated Display instances.
Definition DisplayManager.cpp:45
void _setupAllSPICSPins()
Set the chip select pin state for all displays that have it set and select them.
Definition DisplayManager.cpp:132
DisplayInterface * _firstDisplay
Definition DisplayManager.h:69
DisplayInterface * getFirstDisplay()
Get the first DisplayInterface derived instance in the list of displays.
Definition DisplayManager.cpp:105
void setLogger(Logger *logger)
Set the Logger instance.
Definition DisplayManager.cpp:116
void createDisplays()
Parses the displays configured in myConfig.h and creates the list of displays (this is implemented in...
Definition CreateDeviceMacros.h:29
void displayStartupInfo(const char *version)
Calls the displayStartupInfo of all Display instances to display the version.
Definition DisplayManager.cpp:68
DisplayManager()
Constructor for the DisplayManager.
Definition DisplayManager.cpp:23
void _selectSPIDisplay(DisplayInterface *display)
Manually selects SPI displays that require manual selecting via the CS pin - sets pin low.
Definition DisplayManager.cpp:146
void clearAllDisplays()
Clear all displays.
Definition DisplayManager.cpp:56
void update(ScreenManager *screenManager)
Call this routinely to ensure all displays are updated with screens.
Definition DisplayManager.cpp:81
~DisplayManager()
Destructor for the DisplayManager.
Definition DisplayManager.cpp:118
uint8_t _nextDisplayId
Definition DisplayManager.h:71
Class to enable simple logging to a Stream object with different log levels This enables embedding pe...
Definition Logger.h:35
Class to manage all EX-Display screens.
Definition ScreenManager.h:24