SpaIot Library
|
Analog multiplexer template. More...
#include <multiplexer.h>
Public Member Functions | |
Multiplexer (const std::initializer_list< int > &spins, int inhPin) | |
Multiplexer () | |
int | size () const |
virtual void | begin () |
virtual void | end () |
virtual int | select (int button) |
virtual void | deselect () |
virtual bool | isNull () const |
virtual bool | operator== (const ButtonController &other) const |
int | selectPin (int key) const |
void | setSelectPin (int key, int pin) |
virtual int | selected () const |
virtual bool | isOpened () const |
virtual bool | isSelected () const |
virtual const String & | name () const |
virtual bool | operator!= (const ButtonController &other) const |
Static Public Member Functions | |
static bool | addToRegister (const String &name, ButtonController &controller) |
static ButtonController & | getFromRegister (const String &name) |
static bool | registerContains (const String &name) |
Analog multiplexer template.
|
inline |
The constructor of Multiplexer takes a list of integers and an integer as input. The list of integers represents the selection pins that are connected to the multiplexer. The integer represents the pin that is connected to the inhibit pin
spins | a list of integers that represent the pins that are connected to the multiplexer, in ascending order of weight |
inhPin | The pin number of the inhibit pin ((active in high level) |
|
inline |
Default constructor The Multiplexer class is a subclass of ButtonController
|
staticinherited |
name | |
controller |
|
inlinevirtual |
It opens the multiplexer.
Selection pins are low logic state, the inihibition pin in the high logic state.
References SpaIot::Multiplexer< W >::isNull().
|
inlinevirtual |
It deselects the current selected item.
|
inlinevirtual |
This function is called when the program ends.
It sets the pins to be inputs with pullups
|
staticinherited |
name |
|
inlinevirtual |
This function returns true if default construting
Referenced by SpaIot::Multiplexer< W >::begin().
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
other |
|
inlinevirtual |
The Multiplexer class has an operator== function that takes one argument, a Multiplexer object.
other | the other object being compared to this one. |
|
staticinherited |
name |
|
inlinevirtual |
If the button is pressed, the corresponding pin is set to high, and the other pins are set to low
button | The button number to be selected. |
|
virtualinherited |
|
inline |
Given a key, return the corresponding value
key | The key of the parameter. |
|
inline |
It sets the pin number for the select pin of the given key.
key | the key to be used for the pin |
pin | the pin number |
|
inline |
Return the number of multiplexer channels.