1#ifndef GpioExpanderAdapter_h
2#define GpioExpanderAdapter_h
33 virtual bool read(
byte pin) = 0;
38 virtual void attachPin(
byte pin,
int mode = INPUT_PULLUP) = 0;
48 void write(
byte pin,
bool state) {}
The base class/interface specification for GPIO expanders.
Definition: GpioExpanderAdapter.h:10
virtual bool read(byte pin)=0
Returns the state of a pin on the expander.
virtual void begin()=0
Initialize the expander. (Idempotent)
virtual void update()=0
Read the state of all pins on the expander.
virtual void attachPin(byte pin, int mode=INPUT_PULLUP)=0
Use it to configure individual pin mode, if expander allows it. Not all of them do.
bool canWrite()
Returns true if the concrete GpioExpanderAdapter has implemented the write() method.
Definition: GpioExpanderAdapter.h:56
void write(byte pin, bool state)
Optionally implemented by concrete GpioExpanderAdapters if they support writing to pins.
Definition: GpioExpanderAdapter.h:48