SpaIot Library
Loading...
Searching...
No Matches
bussettings.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 <initializer_list>
13#include "global.h"
14
15namespace SpaIot {
16
26 public:
33
37 virtual ~BusSettings();
38
47 BusSettings (const int dataPin, const int clkPin, const int holdPin);
48
56 BusSettings (const std::initializer_list<int> &pins);
57
61 BusSettings (const BusSettings &other);
62
68
73
79
84 void clear();
85
89 bool isNull() const;
90
94 bool isEmpty() const;
95
104 bool operator== (const BusSettings &other) const;
105
114 bool operator!= (const BusSettings &other) const;
115
121 int dataPin() const;
122
128 int clkPin() const;
129
135 int holdPin() const;
136
142 void setDataPin (int pin);
143
149 void setClkPin (int pin);
150
156 void setHoldPin (int pin);
157
158 protected:
159 class Private;
160 BusSettings (Private &dd);
161 std::unique_ptr<Private> d_ptr;
162 private:
163 PIMPL_DECLARE_PRIVATE (BusSettings)
164 };
165
183 extern const BusSettings Scip2Bus;
184
194 extern const BusSettings SpaIot8266Bus;
195
205 extern const BusSettings SpaIot32Bus;
206
217 extern const BusSettings SpaIotS3Bus;
218
221}
SPI 2840X Bus settings.
Definition bussettings.h:25
BusSettings(const std::initializer_list< int > &pins)
void setClkPin(int pin)
virtual ~BusSettings()
Destructor.
int dataPin() const
void setHoldPin(int pin)
bool operator==(const BusSettings &other) const
bool isNull() const
Returns true if the object is null (i.e. it has not been initialized, d_ptr is null)
void clear()
Clears the BusSettings object After the call to this function, the BusSettings object is the same as ...
void setDataPin(int pin)
bool operator!=(const BusSettings &other) const
BusSettings(const int dataPin, const int clkPin, const int holdPin)
int clkPin() const
BusSettings(const BusSettings &other)
Copy Constructor.
BusSettings(BusSettings &&other)
Move Constructor after the move, other is null, other.clear() must be called if it is to be used agai...
bool isEmpty() const
Checks if all attributes are set to their default values (same as the default constructor)
BusSettings & operator=(const BusSettings &other)
Sets the BusSettings object to be equal to other.
int holdPin() const
const BusSettings SpaIotS3Bus
BusSettings for the SpaIot ESP32S3 Version.
const BusSettings SpaIot32Bus
BusSettings for the SpaIot ESP32 Version.
const BusSettings SpaIot8266Bus
BusSettings for the SpaIot ESP8266 Version.
const BusSettings Scip2Bus
BusSettings for the SpaIot.
SpaIot name space.
Definition bussettings.h:15