SpaIot Library
Loading...
Searching...
No Matches
pcf8574mux.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 <Wire.h>
13#include "buttoncontroller.h"
14
15namespace SpaIot {
16
26 public:
27
36 Pcf8574Mux (uint8_t slaveAddress = 0x20, TwoWire &bus = Wire, uint8_t idleValue = 0xFF);
37
47 Pcf8574Mux (const String &name, uint8_t slaveAddress = 0x20, TwoWire &bus = Wire, uint8_t idleValue = 0xFF);
48
52 Pcf8574Mux (const Pcf8574Mux &other);
53
58
63
68
73 uint8_t address() const;
74
75 // re-implemented methods from ButtonController
76 virtual void clear();
77 virtual bool isEmpty() const;
78 virtual bool operator== (const ButtonController &other) const;
79 virtual void begin();
80 virtual void end();
81 virtual int select (int button);
82 virtual void deselect ();
83
84 protected:
85 class Private;
86 Pcf8574Mux (Private &dd);
87 private:
88 PIMPL_DECLARE_PRIVATE (Pcf8574Mux)
89 };
90
97}
This class is the base class of all button controllers.
Definition buttoncontroller.h:26
virtual const String & name() const
Returns the name of the ButtonController object if it has been set, otherwise it returns an empty str...
Multiplexer controlled by a PCF8574.
Definition pcf8574mux.h:25
virtual bool operator==(const ButtonController &other) const
Returns true if the two objects are equal.
virtual bool isEmpty() const
Checks if all attributes are set to their default values (same as the default constructor)
Pcf8574Mux(const String &name, uint8_t slaveAddress=0x20, TwoWire &bus=Wire, uint8_t idleValue=0xFF)
virtual void end()
Releases all ressources used by the object.
uint8_t address() const
Reading of the slave m_address of the integrated circuit.
Pcf8574Mux & operator=(const Pcf8574Mux &other)
Assignment operator. (const ButtonController &other)
virtual void clear()
Sets all attributes to their default values (same as the default constructor)
Pcf8574Mux(const Pcf8574Mux &other)
Copy Constructor. (const ButtonController &other)
Pcf8574Mux(Pcf8574Mux &&other)
Copy Constructor. (ButtonController &&other)
Pcf8574Mux(uint8_t slaveAddress=0x20, TwoWire &bus=Wire, uint8_t idleValue=0xFF)
virtual void begin()
Configures all ressources needed to use the object.
virtual void deselect()
Deselects the button After the call to this function, isSelected() must return false,...
virtual int select(int button)
Selects a button.
SpaIot name space.
Definition bussettings.h:15
Pcf8574Mux SpaIotPcf8574Mux
SpaIot buttons controller with PCF8574A.