SpaIot Library
hardwaresettings.h
1/*
2 * SpaIot Library (c) by epsilonrt - epsilonrt@gmail.com
3 * This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4 *
5 * SpaIot library is licensed under a
6 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
7 *
8 * You should have received a copy of the license along with this
9 * work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
10 *
11 * SpaIot library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY;
13 */
14#pragma once
15
16#include <Arduino.h>
17#include "bussettings.h"
18#include "buttonsettings.h"
19
20namespace SpaIot {
21
26 class HardwareSettings {
27 public:
31 HardwareSettings();
38 HardwareSettings (const BusSettings & bus,
39 const std::map <int, LedSettings> & leds,
40 const std::map <int, ButtonSettings> & buttons);
41
46 bool isNull() const;
51 const BusSettings & bus() const;
56 const std::map <int, LedSettings> & leds() const;
61 const std::map <int, ButtonSettings> & buttons() const;
66 bool operator== (const HardwareSettings &other) const;
71 bool operator!= (const HardwareSettings &other) const;
76 void print(Print &out) const;
83 static bool addToRegister (const String & name, const HardwareSettings & settings);
89 static const HardwareSettings & getFromRegister (const String & name);
95 static bool registerContains (const String & name);
96
97 private:
98 const BusSettings * m_bus;
99 const std::map <int, LedSettings> * m_leds;
100 const std::map <int, ButtonSettings> * m_buttons;
101 static std::map<String, const HardwareSettings *> Register;
102 };
103
107 extern const HardwareSettings Scip2Ssp;
111 extern const HardwareSettings Scip2Sjb;
112}
SpaIot name space.
Definition: bussettings.h:21