SpaIot Library
Loading...
Searching...
No Matches
hardwaresettings.h
1/*
2 SpaIot Library (c) by epsilonrt - epsilonrt@epsilonrt.fr
3 This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4
5 SPDX-License-Identifier: BSD-3-Clause
6
7 SpaIot library is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY;
9*/
10#pragma once
11
12#include <Arduino.h>
13#include "bussettings.h"
14#include "ledsettings.h"
15#include "buttonsettings.h"
16
17namespace SpaIot {
18
26 public:
31
36
44 const std::map <int, LedSettings> &leds,
45 const std::map <int, ButtonSettings> &buttons);
46
51
57
62
68
73 void clear();
74
78 bool isNull() const;
79
83 bool isEmpty() const;
84
88 bool operator== (const HardwareSettings &other) const;
89
93 bool operator!= (const HardwareSettings &other) const;
94
98 const BusSettings &bus() const;
99
103 const std::map <int, LedSettings> &leds() const;
104
108 const std::map <int, ButtonSettings> &buttons() const;
109
114 void print (Print &out) const;
115
122 static bool addToRegister (const String &name, const HardwareSettings &settings);
123
131 static const HardwareSettings &getFromRegister (const String &name);
132
138 static bool registerContains (const String &name);
139
140 protected:
141 class Private;
142 HardwareSettings (Private &dd);
143 std::unique_ptr<Private> d_ptr;
144 private:
145 PIMPL_DECLARE_PRIVATE (HardwareSettings)
146 };
147
162 extern const HardwareSettings Scip2Ssp;
163
173 extern const HardwareSettings Scip2Sjb;
174
184 extern const HardwareSettings SpaIot8266Ssp;
185
195 extern const HardwareSettings SpaIot8266Sjb;
196
206 extern const HardwareSettings SpaIot32Ssp;
207
217 extern const HardwareSettings SpaIot32Sjb;
218
228 extern const HardwareSettings SpaIotS3Ssp;
229
239 extern const HardwareSettings SpaIotS3Sjb;
240
241
252
263
274
285
287}
SPI 2840X Bus settings.
Definition bussettings.h:25
This class represents the hardware settings of a SpaIot device.
Definition hardwaresettings.h:25
static bool registerContains(const String &name)
Returns true if the register contains the name.
const std::map< int, LedSettings > & leds() const
Returns the led settings as a map.
bool isEmpty() const
Checks if all attributes are set to their default values (same as the default constructor)
const BusSettings & bus() const
Returns the bus settings.
bool operator!=(const HardwareSettings &other) const
Checks if the two objects are not equal.
HardwareSettings()
The default constructor.
HardwareSettings(const HardwareSettings &other)
Copy Constructor.
bool isNull() const
Returns true if the object is null (i.e. it has not been initialized, d_ptr is null)
const std::map< int, ButtonSettings > & buttons() const
Returns the button settings as a map.
static const HardwareSettings & getFromRegister(const String &name)
Returns the HardwareSettings object from the register.
void clear()
Clears the HardwareSettings object After the call to this function, the HardwareSettings object is th...
HardwareSettings(const BusSettings &bus, const std::map< int, LedSettings > &leds, const std::map< int, ButtonSettings > &buttons)
The constructor for the HardwareSettings class takes three parameters.
void print(Print &out) const
Prints the object to the Print interface.
bool operator==(const HardwareSettings &other) const
Checks if the two objects are equal.
virtual ~HardwareSettings()
Destructor.
HardwareSettings(HardwareSettings &&other)
Move Constructor after the move, other is null, other.clear() must be called if it is to be used agai...
static bool addToRegister(const String &name, const HardwareSettings &settings)
Adds a HardwareSettings object to the register.
HardwareSettings & operator=(const HardwareSettings &other)
Sets the HardwareSettings object to be equal to other.
const HardwareSettings Scip2Sjb
Hardware settings for the SJB Spa with Scip2 board.
const HardwareSettings SpaIotS38574Sjb
Hardware settings for the SJB Spa with SpaIot Extended board with PCF8574A (ESP32 S3 Version)
const HardwareSettings SpaIotS3Ssp
Hardware settings for the SSP Spa with SpaIot board (ESP32 S3 Version)
const HardwareSettings SpaIot328574Ssp
Hardware settings for the SSP Spa with SpaIot Extended board with PCF8574A (ESP32 Version)
const HardwareSettings SpaIot328574Sjb
Hardware settings for the SJB Spa with SpaIot Extended board with PCF8574A (ESP32 Version)
const HardwareSettings SpaIotS38574Ssp
Hardware settings for the SSP Spa with SpaIot Extended board with PCF8574A (ESP32 S3 Version)
const HardwareSettings Scip2Ssp
Hardware settings for the SSP Spa with Scip2 board.
const HardwareSettings SpaIot8266Sjb
Hardware settings for the SJB Spa with SpaIot board (ESP8266 Version)
const HardwareSettings SpaIot32Sjb
Hardware settings for the SJB Spa with SpaIot board (ESP32 Version)
const HardwareSettings SpaIotS3Sjb
Hardware settings for the SJB Spa with SpaIot board (ESP32 S3 Version)
const HardwareSettings SpaIot32Ssp
Hardware settings for the SSP Spa with SpaIot board (ESP32 Version)
const HardwareSettings SpaIot8266Ssp
Hardware settings for the SSP Spa with SpaIot board (ESP8266 Version)
SpaIot name space.
Definition bussettings.h:15