#include <IoAbstraction.h>
Public Member Functions | |
MultiIoAbstraction (pinid_t arduinoPinsNeeded=100) | |
void | addIoExpander (IoAbstractionRef expander, pinid_t numOfPinsNeeded) |
void | addIoDevice (BasicIoAbstraction &expander, pinid_t pinsNeeded) |
void | pinDirection (pinid_t pin, uint8_t mode) override |
void | writeValue (pinid_t pin, uint8_t value) override |
uint8_t | readValue (pinid_t pin) override |
void | writePort (pinid_t port, uint8_t portVal) override |
uint8_t | readPort (pinid_t port) override |
void | attachInterrupt (pinid_t pin, RawIntHandler intHandler, uint8_t mode) override |
bool | runLoop () override |
Public Member Functions inherited from BasicIoAbstraction | |
uint8_t | digitalRead (pinid_t p) |
void | digitalWrite (pinid_t p, uint8_t v) |
uint8_t | digitalReadS (pinid_t p) |
void | digitalWriteS (pinid_t p, uint8_t v) |
void | writePortS (pinid_t p, uint8_t v) |
uint8_t | readPortS (pinid_t p) |
void | pinMode (pinid_t pin, uint8_t mode) |
bool | sync () |
An implementation of the BasicIoAbstraction that provides support for more than one IOExpander in a single abstraction, along with a single set of Arduino pins. Arduino pins will be from 0..arduinoPinsNeeded in the constructor (default 100) expanders will directly follow this, expanders are added using addIoExpander.
Take note that the usual way to use the MultiIoAbstraction is to create a global variable and append the additional IO devices during setup. In order to pass such a varable to the ioDevice functions, such as ioDeviceDigitalRead you must put an ampersand in front of the variable to make it into a pointer.
|
overridevirtual |
delegates the pin direction call to whichever abstraction owns the pin, and that abstraction will then set the pin mode
pin | the pin to set the mode on |
mode | as per pinMode modes |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
delegates writing the value to whichever abstraction owns the pin, this abstraction will then write out the value.
pin | the pin to write to |
value | the value to write to the pin |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
delegates reading the value from a pin to whichever abstraction owns the pin.
pin | the pin to read from |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
delegates writing the port value to the abstraction that owns that pin, the abstraction will then determine the port that the pin belongs to
port | any pin within the port |
portVal | an 8 bit value to write direct to the port. |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
delegates reading a port to the abstraction that owns the pin, the abstraction will then determine which port owns the pin and return the port value.
port | any pin within that port. |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
delegates attaching an interrupt to the abstraction that owns the pin, see each abstraction for more information about how interrupts work with the given device.
pin | the pin on the device |
intHandler | the interrupt intHandler |
mode | as per arduino interrupt modes. |
Reimplemented from BasicIoAbstraction.
|
overridevirtual |
will run through all delegate abstractions and sync them
Reimplemented from BasicIoAbstraction.