SpaIot Library
button.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 "buttonsettings.h"
17#include "buttoncontroller.h"
18#include "cd4051.h"
19#include "pcf8574mux.h"
20
21namespace SpaIot {
22
27 class Button {
28
29 public:
33 Button ();
37 Button (const ButtonSettings & settings);
42 int id() const;
47 const ButtonController & ctrl() const;
52 ButtonController & ctrl();
57 const ButtonSettings & settings() const;
61 void begin();
65 void press();
69 void release();
73 void push();
78 bool isOpened() const;
83 bool isNull() const;
88 bool isPressed() const;
93 bool operator== (const Button &other) const;
98 bool operator!= (const Button &other) const;
99
100 private:
101 ButtonSettings m_settings;
102 };
103}
SpaIot name space.
Definition: bussettings.h:21