A class for ExtendedIOElements with a fixed size.
More...
#include <AH/Hardware/ExtendedInputOutput/StaticSizeExtendedIOElement.hpp>
|
static pin_t | offset = NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS |
|
|
static void | applyToAll (const LockGuard &, void(Derived::*method)(Args &&...), Args &&... args) |
|
static void | applyToAll (void(Derived::*method)(Args &&...), Args &&... args) |
|
|
void | enable (const LockGuard &lock) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
|
|
void | enable () |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
|
|
void | disable (const LockGuard &lock) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
|
|
void | disable () |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
|
|
bool | isEnabled (const LockGuard &) const |
| Check if this updatable is enabled. More...
|
|
bool | isEnabled () |
| Check if this updatable is enabled. More...
|
|
void | moveDown (const LockGuard &) |
| Move down this element in the list. More...
|
|
void | moveDown () |
| Move down this element in the list. More...
|
|
static void | enable (UpdatableCRTP *element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
|
|
static void | enable (UpdatableCRTP &element) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
|
|
static void | enable (U(&array)[N]) |
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
|
|
static void | disable (UpdatableCRTP *element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
|
|
static void | disable (UpdatableCRTP &element) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
|
|
static void | disable (U(&array)[N]) |
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
|
|
template<uint16_t N>
class AH::StaticSizeExtendedIOElement< N >
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.
◆ Mutex
◆ LockGuard
◆ StaticSizeExtendedIOElement()
◆ pins()
◆ length()
static constexpr uint16_t length |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ pinMode()
Set the mode of a given pin.
- Note
- This function might not be implemented by all subclasses.
Some extended IO types, such as shift registers, can only be used as outputs.
On others, it might be implemented, but it could impact all pins of the IO element. For example, enabling the internal pull-up resistor on an analog multiplexer affects all pins of the mux.
- Parameters
-
pin | The (zero-based) pin of this IO element. |
mode | The mode to set the pin to (e.g. INPUT , OUTPUT or INPUT_PULLUP ). |
Reimplemented in ShiftRegisterOutBase< N >, MAX7219< NumChips >, and AnalogMultiplex< N >.
Definition at line 90 of file ExtendedIOElement.hpp.
◆ pinModeBuffered()
Set the mode of a given pin in the software buffer.
The buffer is written to the ExtIO device when updateBufferedOutputs is called.
- Note
- This function might not be implemented by all subclasses.
Some extended IO types, such as shift registers, can only be used as outputs.
On others, it might be implemented, but it could impact all pins of the IO element. For example, enabling the internal pull-up resistor on an analog multiplexer affects all pins of the mux.
- Parameters
-
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< NumChips >, and AnalogMultiplex< N >.
◆ digitalWrite()
◆ digitalWriteBuffered()
◆ digitalRead()
virtual int digitalRead |
( |
pin_t |
pin | ) |
|
|
inlinevirtualinherited |
◆ digitalReadBuffered()
virtual int digitalReadBuffered |
( |
pin_t |
pin | ) |
|
|
pure virtualinherited |
◆ analogWrite()
◆ analogWriteBuffered()
◆ analogRead()
◆ analogReadBuffered()
◆ begin()
◆ beginAll()
◆ updateBufferedOutputs()
virtual void updateBufferedOutputs |
( |
| ) |
|
|
pure virtualinherited |
◆ updateAllBufferedOutputs()
void updateAllBufferedOutputs |
( |
| ) |
|
|
staticinherited |
Write the internal states to the physical outputs for all extended IO elements.
Definition at line 24 of file ExtendedIOElement.cpp.
◆ updateBufferedInputs()
virtual void updateBufferedInputs |
( |
| ) |
|
|
pure virtualinherited |
◆ updateAllBufferedInputs()
void updateAllBufferedInputs |
( |
| ) |
|
|
staticinherited |
Read the physical state into the input buffers for all extended IO elements.
Definition at line 28 of file ExtendedIOElement.cpp.
◆ pin()
Get the extended IO pin number of a given physical pin of this extended IO element.
- Parameters
-
pin | The zero-based physical pin number of this IO element. |
- Returns
- The global, unique extended IO pin number for the given pin.
Definition at line 32 of file ExtendedIOElement.cpp.
◆ operator[]()
Get the extended IO pin number of a given physical pin of this extended IO element.
It is alias for ExtendedIOElement::pin
.
- Parameters
-
pin | The zero-based physical pin number of this IO element. |
- Returns
- The global, unique extended IO pin number for the given pin.
Definition at line 47 of file ExtendedIOElement.cpp.
◆ getLength()
pin_t getLength |
( |
| ) |
const |
|
inherited |
Get the number of pins this IO element has.
- Returns
- The number of pins this IO element has.
Definition at line 49 of file ExtendedIOElement.cpp.
◆ getEnd()
Get the largest global extended IO pin number that belongs to this extended IO element.
Definition at line 51 of file ExtendedIOElement.cpp.
◆ getStart()
Get the smallest global extended IO pin number that belongs to this extended IO element.
Definition at line 53 of file ExtendedIOElement.cpp.
◆ getAll()
◆ getMutex()
static Mutex& getMutex |
( |
| ) |
|
|
inlinestaticinherited |
◆ applyToAll() [1/2]
static void applyToAll |
( |
const LockGuard & |
, |
|
|
void(Derived::*)(Args &&...) |
method, |
|
|
Args &&... |
args |
|
) |
| |
|
inlinestaticinherited |
◆ applyToAll() [2/2]
static void applyToAll |
( |
void(Derived::*)(Args &&...) |
method, |
|
|
Args &&... |
args |
|
) |
| |
|
inlinestaticinherited |
◆ enable() [1/5]
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 106 of file Updatable.hpp.
◆ enable() [2/5]
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 115 of file Updatable.hpp.
◆ enable() [3/5]
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 144 of file Updatable.hpp.
◆ enable() [4/5]
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 146 of file Updatable.hpp.
◆ enable() [5/5]
static void enable |
( |
U(&) |
array[N] | ) |
|
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 149 of file Updatable.hpp.
◆ disable() [1/5]
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 119 of file Updatable.hpp.
◆ disable() [2/5]
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 128 of file Updatable.hpp.
◆ disable() [3/5]
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 155 of file Updatable.hpp.
◆ disable() [4/5]
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 157 of file Updatable.hpp.
◆ disable() [5/5]
static void disable |
( |
U(&) |
array[N] | ) |
|
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 160 of file Updatable.hpp.
◆ isEnabled() [1/2]
Check if this updatable is enabled.
- Note
- Assumes that the updatable is not added to a different linked list by the user.
Definition at line 136 of file Updatable.hpp.
◆ isEnabled() [2/2]
Check if this updatable is enabled.
- Note
- Assumes that the updatable is not added to a different linked list by the user.
Definition at line 141 of file Updatable.hpp.
◆ moveDown() [1/2]
Move down this element in the list.
Definition at line 166 of file Updatable.hpp.
◆ moveDown() [2/2]
Move down this element in the list.
Definition at line 168 of file Updatable.hpp.
◆ start
◆ end
◆ offset
pin_t offset = NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS |
|
staticprivateinherited |
◆ updatables
◆ mutex
◆ next
◆ previous
The documentation for this class was generated from the following file: