SpaIot Library
bussettings.h
1/*
2 * SpaIot Library (c) by espilonrt - 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 <map>
17#include <vector>
18#include <initializer_list>
19#include "global.h"
20
21namespace SpaIot {
22
27 class BusSettings {
28 public:
32 BusSettings();
37 BusSettings (const std::initializer_list<int>& pins);
44 BusSettings (const int dataPin, const int clkPin, const int holdPin);
49 int dataPin() const;
54 int clkPin() const;
59 int holdPin() const;
64 bool isNull() const;
69 bool operator== (const BusSettings &other) const;
74 bool operator!= (const BusSettings &other) const;
79 void setDataPin (int pin);
84 void setClkPin (int pin);
89 void setHoldPin (int pin);
90 private:
91 std::vector<int> m_pin;
92 };
93
98 class LedSettings {
99
100 public:
104 LedSettings ();
109 LedSettings (const uint8_t order);
114 uint8_t order() const;
119 uint16_t frame() const;
124 void setOrder (const uint8_t order);
129 bool isNull() const;
134 bool operator== (const LedSettings &other) const;
139 bool operator!= (const LedSettings &other) const;
140
141 private:
142 uint8_t m_order;
143 };
144
148 extern const BusSettings ScipBus;
152 extern const std::map<int, LedSettings> SspLeds;
156 extern const std::map<int, LedSettings> SjbLeds;
157}
SpaIot name space.
Definition: bussettings.h:21