SpaIot Library
bussettings.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 <map>
17#include <vector>
18#include <initializer_list>
19#include "global.h"
20
21namespace SpaIot {
22
28 public:
37 BusSettings (const int dataPin, const int clkPin, const int holdPin);
44 BusSettings (const std::initializer_list<int>& pins);
56 int dataPin() const;
62 int clkPin() const;
68 int holdPin() const;
74 bool isNull() const;
83 bool operator== (const BusSettings &other) const;
92 bool operator!= (const BusSettings &other) const;
98 void setDataPin (int pin);
104 void setClkPin (int pin);
110 void setHoldPin (int pin);
111 private:
112 std::vector<int> m_pin;
113 };
114
120
121 public:
135 LedSettings (const uint8_t order);
141 uint8_t order() const;
147 uint16_t frame() const;
153 void setOrder (const uint8_t order);
160 bool isNull() const;
169 bool operator== (const LedSettings &other) const;
178 bool operator!= (const LedSettings &other) const;
179
180 private:
181 uint8_t m_order;
182 };
183
187 extern const BusSettings ScipBus;
191 extern const std::map<int, LedSettings> SspLeds;
195 extern const std::map<int, LedSettings> SjbLeds;
196}
SPI 2840X Bus settings.
Definition: bussettings.h:27
BusSettings(const std::initializer_list< int > &pins)
void setClkPin(int pin)
int dataPin() const
void setHoldPin(int pin)
bool operator==(const BusSettings &other) const
bool isNull() const
void setDataPin(int pin)
bool operator!=(const BusSettings &other) const
BusSettings(const int dataPin, const int clkPin, const int holdPin)
int clkPin() const
int holdPin() const
SPI 2840X Led settings.
Definition: bussettings.h:119
bool isNull() const
bool operator!=(const LedSettings &other) const
bool operator==(const LedSettings &other) const
LedSettings(const uint8_t order)
uint16_t frame() const
void setOrder(const uint8_t order)
uint8_t order() const
SpaIot name space.
Definition: bussettings.h:21