Repository navigation
Expand file tree
/
Copy pathDisplayManager.h
More file actions
81 lines (64 loc) · 2.75 KB
/
Copy pathDisplayManager.h
File metadata and controls
81 lines (64 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* © 2024 Peter Cole
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef DISPLAYMANAGER_H
#define DISPLAYMANAGER_H
#include "DisplayInterface.h"
#include "Logger.h"
#include "ScreenManager.h"
/// @brief Manages all physical displays
class DisplayManager {
public:
/// @brief Constructor for the DisplayManager
DisplayManager();
/// @brief Add a DisplayInterface derived instance to the list of displays
/// @param display Pointer to the instance to add
void addDisplay(DisplayInterface *display);
/// @brief Parses the displays configured in myConfig.h and creates the list of displays (this is implemented in
/// CreateDeviceMacros.h, not DisplayManager.cpp)
void createDisplays();
/// @brief Call the begin() method for all associated Display instances
void startDisplays();
/// @brief Clear all displays
void clearAllDisplays();
/// @brief Calls the displayStartupInfo of all Display instances to display the version
/// @param version EX-Display version
void displayStartupInfo(const char *version);
/// @brief Call this routinely to ensure all displays are updated with screens
/// @param screenManager Pointer to the ScreenManager instance
void update(ScreenManager *screenManager);
/// @brief Get the first DisplayInterface derived instance in the list of displays
/// @return Pointer to the first instance
DisplayInterface *getFirstDisplay();
/// @brief Get a DisplayInterface derived instance by its ID
/// @return Pointer to the specified instance
DisplayInterface *getDisplayById(uint8_t displayId);
/// @brief Set the Logger instance
/// @param logger Pointer to the Logger
void setLogger(Logger *logger);
/// @brief Destructor for the DisplayManager
~DisplayManager();
private:
DisplayInterface *_firstDisplay;
Logger *_logger;
uint8_t _nextDisplayId;
/// @brief Set the chip select pin state for all displays that have it set and select them
void _setupAllSPICSPins();
/// @brief Manually selects SPI displays that require manual selecting via the CS pin - sets pin low
/// @param display Pointer to the DisplayInterface instance
void _selectSPIDisplay(DisplayInterface *display);
};
#endif // DISPLAYMANAGER_H