A class for ExtendedIOElements with a fixed size.
More...
#include <StaticSizeExtendedIOElement.hpp>
template<uint16_t N>
class 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 16 of file StaticSizeExtendedIOElement.hpp.
◆ StaticSizeExtendedIOElement()
◆ pins()
◆ length()
◆ pinMode()
virtual void ExtendedIOElement::pinMode |
( |
pin_t |
pin, |
|
|
uint8_t |
mode |
|
) |
| |
|
pure virtualinherited |
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 ). |
◆ digitalWrite()
virtual void ExtendedIOElement::digitalWrite |
( |
pin_t |
pin, |
|
|
uint8_t |
state |
|
) |
| |
|
pure virtualinherited |
Set the output of the given pin to the given state.
- Parameters
-
pin | The (zero-based) pin of this IO element. |
state | The new state to set the pin to. |
Implemented in ShiftRegisterOutBase< N >, and MAX7219.
◆ digitalRead()
virtual int ExtendedIOElement::digitalRead |
( |
pin_t |
pin | ) |
|
|
pure virtualinherited |
◆ analogWrite()
virtual void ExtendedIOElement::analogWrite |
( |
pin_t |
pin, |
|
|
analog_t |
val |
|
) |
| |
|
pure virtualinherited |
Write an analog (or PWM) value to the given pin.
- Parameters
-
pin | The (zero-based) pin of this IO element. |
val | The new analog value to set the pin to. |
Implemented in MAX7219, and ShiftRegisterOutBase< N >.
◆ analogRead()
◆ begin()
virtual void ExtendedIOElement::begin |
( |
| ) |
|
|
pure virtualinherited |
◆ beginAll()
void ExtendedIOElement::beginAll |
( |
| ) |
|
|
staticinherited |
◆ update()
virtual void ExtendedIOElement::update |
( |
| ) |
|
|
pure virtualinherited |
◆ 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.
- Examples
- 1.First-Output.ino, and Toggle-LEDs.ino.
Definition at line 26 of file ExtendedIOElement.cpp.
◆ operator[]()
pin_t ExtendedIOElement::operator[] |
( |
pin_t |
pin | ) |
const |
|
inherited |
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 41 of file ExtendedIOElement.cpp.
◆ getLength()
pin_t ExtendedIOElement::getLength |
( |
| ) |
const |
|
inherited |
◆ getEnd()
pin_t ExtendedIOElement::getEnd |
( |
| ) |
const |
|
inherited |
Get the largest global extended IO pin number that belongs to this extended IO element.
Definition at line 45 of file ExtendedIOElement.cpp.
◆ getStart()
pin_t ExtendedIOElement::getStart |
( |
| ) |
const |
|
inherited |
Get the smallest global extended IO pin number that belongs to this extended IO element.
Definition at line 47 of file ExtendedIOElement.cpp.
◆ getAll()
◆ start
const pin_t ExtendedIOElement::start |
|
privateinherited |
◆ end
const pin_t ExtendedIOElement::end |
|
privateinherited |
◆ offset
pin_t ExtendedIOElement::offset = NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS |
|
staticprivateinherited |
◆ elements
◆ next
◆ previous
The documentation for this class was generated from the following file: