SpaIot Library
pcf8574mux.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 <vector>
17#include <string>
18#include <initializer_list>
19#include <type_traits>
20#include <Arduino.h>
21#include "debug.h"
22
23#include "buttoncontroller.h"
24#include "twowireslave.h"
25namespace SpaIot {
26
31 class Pcf8574Mux : public ButtonController {
32 public:
33
40 Pcf8574Mux (uint8_t slaveAddress = 0x20, TwoWire & bus = Wire, uint8_t idleValue = 0xFF);
41
45 virtual void begin();
46
52 virtual int select (int button);
53
57 virtual void deselect ();
58
63 virtual bool isNull() const;
64
70 virtual bool operator== (const ButtonController &other) const;
71
72 protected:
73 TwoWireSlave m_pcf;
74 uint8_t m_idle;
75 };
76
77}
SpaIot name space.
Definition: bussettings.h:21