A class for ExtendedIOElements with a fixed size. More...
#include <AH/Hardware/ExtendedInputOutput/StaticSizeExtendedIOElement.hpp>
Public Member Functions | |
Array< pin_t, N > | pins () const |
Get an array containing all pins of the element. More... | |
virtual void | pinMode (pin_t pin, uint8_t mode)=0 |
Set the mode of a given pin. More... | |
virtual void | digitalWrite (pin_t pin, uint8_t state)=0 |
Set the output of the given pin to the given state. More... | |
virtual int | digitalRead (pin_t pin)=0 |
Read the state of the given pin. More... | |
virtual void | analogWrite (pin_t pin, analog_t val)=0 |
Write an analog (or PWM) value to the given pin. More... | |
virtual analog_t | analogRead (pin_t pin)=0 |
Read the analog value of the given pin. More... | |
virtual void | begin ()=0 |
Initialize the extended IO element. More... | |
virtual void | update ()=0 |
Update the extended IO element: write the internal state to the physical outputs, or read the physical state into the input buffers. More... | |
pin_t | pin (pin_t pin) const |
Get the extended IO pin number of a given physical pin of this extended IO element. More... | |
pin_t | operator[] (pin_t pin) const |
Get the extended IO pin number of a given physical pin of this extended IO element. More... | |
pin_t | getLength () const |
Get the number of pins this IO element has. More... | |
pin_t | getEnd () const |
Get the largest global extended IO pin number that belongs to this extended IO element. More... | |
pin_t | getStart () const |
Get the smallest global extended IO pin number that belongs to this extended IO element. More... | |
Static Public Member Functions | |
static constexpr uint16_t | length () |
static void | beginAll () |
Initialize all extended IO elements. More... | |
static DoublyLinkedList< ExtendedIOElement > & | getAll () |
Get the list of all Extended IO elements. More... | |
Protected Member Functions | |
StaticSizeExtendedIOElement () | |
Protected Attributes | |
ExtendedIOElement * | next |
ExtendedIOElement * | previous |
Private Attributes | |
const pin_t | start |
const pin_t | end |
Static Private Attributes | |
static pin_t | offset = NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS |
static DoublyLinkedList< ExtendedIOElement > | elements |
A class for ExtendedIOElements with a fixed size.
This class is to make it easier to get an array of all pins of the element.
Definition at line 19 of file StaticSizeExtendedIOElement.hpp.
|
inlineprotected |
Definition at line 21 of file StaticSizeExtendedIOElement.hpp.
Get an array containing all pins of the element.
Definition at line 27 of file StaticSizeExtendedIOElement.hpp.
|
inlinestaticconstexpr |
Definition at line 31 of file StaticSizeExtendedIOElement.hpp.
|
pure virtualinherited |
Set the mode of a given pin.
pin | The (zero-based) pin of this IO element. |
mode | The mode to set the pin to (e.g. INPUT , OUTPUT or INPUT_PULLUP ). |
Implemented in ShiftRegisterOutBase< N >, MAX7219, and AnalogMultiplex< N >.
|
pure virtualinherited |
Set the output of the given pin to the given state.
pin | The (zero-based) pin of this IO element. |
state | The new state to set the pin to. |
Implemented in AnalogMultiplex< N >, ShiftRegisterOutBase< N >, and MAX7219.
|
pure virtualinherited |
Read the state of the given pin.
pin | The (zero-based) pin of this IO element. |
Implemented in AnalogMultiplex< N >, ShiftRegisterOutBase< N >, and MAX7219.
Write an analog (or PWM) value to the given pin.
pin | The (zero-based) pin of this IO element. |
val | The new analog value to set the pin to. |
Implemented in AnalogMultiplex< N >, ShiftRegisterOutBase< N >, and MAX7219.
Read the analog value of the given pin.
pin | The (zero-based) pin of this IO element. |
Implemented in ShiftRegisterOutBase< N >, MAX7219, and AnalogMultiplex< N >.
|
pure virtualinherited |
Initialize the extended IO element.
Implemented in AnalogMultiplex< N >, ShiftRegisterOut< N >, SPIShiftRegisterOut< N >, and MAX7219.
|
staticinherited |
Initialize all extended IO elements.
Definition at line 23 of file ExtendedIOElement.cpp.
|
pure virtualinherited |
Update the extended IO element: write the internal state to the physical outputs, or read the physical state into the input buffers.
Implemented in MAX7219, AnalogMultiplex< N >, ShiftRegisterOut< N >, and SPIShiftRegisterOut< N >.
Get the extended IO pin number of a given physical pin of this extended IO element.
pin | The zero-based physical pin number of this IO element. |
Definition at line 28 of file ExtendedIOElement.cpp.
Get the extended IO pin number of a given physical pin of this extended IO element.
It is alias for ExtendedIOElement::pin
.
pin | The zero-based physical pin number of this IO element. |
Definition at line 43 of file ExtendedIOElement.cpp.
|
inherited |
Get the number of pins this IO element has.
Definition at line 45 of file ExtendedIOElement.cpp.
|
inherited |
Get the largest global extended IO pin number that belongs to this extended IO element.
Definition at line 47 of file ExtendedIOElement.cpp.
|
inherited |
Get the smallest global extended IO pin number that belongs to this extended IO element.
Definition at line 49 of file ExtendedIOElement.cpp.
|
staticinherited |
Get the list of all Extended IO elements.
Definition at line 51 of file ExtendedIOElement.cpp.
|
privateinherited |
Definition at line 193 of file ExtendedIOElement.hpp.
|
privateinherited |
Definition at line 194 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 195 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 197 of file ExtendedIOElement.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.