Multiplexer controlled by a PCF8574.
More...
#include <pcf8574mux.h>
Inherits SpaIot::ButtonController.
|
| Pcf8574Mux (uint8_t slaveAddress=0x20, TwoWire &bus=Wire, uint8_t idleValue=0xFF) |
|
| Pcf8574Mux (const String &name, uint8_t slaveAddress=0x20, TwoWire &bus=Wire, uint8_t idleValue=0xFF) |
|
virtual void | begin () |
|
virtual void | end () |
| It close the PCF8574 chip.
|
|
virtual int | select (int button) |
|
virtual void | deselect () |
|
virtual bool | isNull () const |
|
virtual bool | operator== (const ButtonController &other) const |
|
virtual int | selected () const |
|
virtual bool | isOpened () const |
|
virtual bool | isSelected () const |
|
virtual const String & | name () const |
|
virtual bool | operator!= (const ButtonController &other) const |
|
Multiplexer controlled by a PCF8574.
Inheriting from the ButtonController class.
◆ Pcf8574Mux() [1/2]
SpaIot::Pcf8574Mux::Pcf8574Mux |
( |
uint8_t |
slaveAddress = 0x20 , |
|
|
TwoWire & |
bus = Wire , |
|
|
uint8_t |
idleValue = 0xFF |
|
) |
| |
It creates a new Pcf8574Mux object.
- Parameters
-
slaveAddress | The address of the PCF8574 chip. |
bus | The TwoWire object that is used to communicate with the PCF8574. |
idleValue | The value that the pins will be set to when the device is not in use. |
◆ Pcf8574Mux() [2/2]
SpaIot::Pcf8574Mux::Pcf8574Mux |
( |
const String & |
name, |
|
|
uint8_t |
slaveAddress = 0x20 , |
|
|
TwoWire & |
bus = Wire , |
|
|
uint8_t |
idleValue = 0xFF |
|
) |
| |
It creates a new Pcf8574Mux object.
- Parameters
-
name | controller name |
slaveAddress | The address of the PCF8574 chip. |
bus | The TwoWire object that is used to communicate with the PCF8574. |
idleValue | The value that the pins will be set to when the device is not in use. |
◆ addToRegister()
static bool SpaIot::ButtonController::addToRegister |
( |
const String & |
name, |
|
|
ButtonController & |
controller |
|
) |
| |
|
staticinherited |
◆ begin()
virtual void SpaIot::Pcf8574Mux::begin |
( |
| ) |
|
|
virtual |
It opens the PCF8574 chip.
◆ deselect()
virtual void SpaIot::Pcf8574Mux::deselect |
( |
| ) |
|
|
virtual |
◆ getFromRegister()
static ButtonController & SpaIot::ButtonController::getFromRegister |
( |
const String & |
name | ) |
|
|
staticinherited |
◆ isNull()
virtual bool SpaIot::Pcf8574Mux::isNull |
( |
| ) |
const |
|
virtual |
This function returns true if the object is a null pointer
- Returns
- The return value is a boolean value. The return value is true if the device is null, and false if the device is not null.
◆ isOpened()
virtual bool SpaIot::ButtonController::isOpened |
( |
| ) |
const |
|
virtualinherited |
◆ isSelected()
virtual bool SpaIot::ButtonController::isSelected |
( |
| ) |
const |
|
virtualinherited |
◆ name()
virtual const String & SpaIot::ButtonController::name |
( |
| ) |
const |
|
virtualinherited |
◆ operator!=()
virtual bool SpaIot::ButtonController::operator!= |
( |
const ButtonController & |
other | ) |
const |
|
virtualinherited |
◆ operator==()
virtual bool SpaIot::Pcf8574Mux::operator== |
( |
const ButtonController & |
other | ) |
const |
|
virtual |
This function is called when the ButtonController is compared to another ButtonController
- Parameters
-
other | The ButtonController to compare against. |
- Returns
- true if equal
◆ registerContains()
static bool SpaIot::ButtonController::registerContains |
( |
const String & |
name | ) |
|
|
staticinherited |
◆ select()
virtual int SpaIot::Pcf8574Mux::select |
( |
int |
button | ) |
|
|
virtual |
It writes the value of the button to the PCF8574 chip.
- Parameters
-
button | the button to be selected. |
- Returns
- the value return by selected()
◆ selected()
virtual int SpaIot::ButtonController::selected |
( |
| ) |
const |
|
virtualinherited |