1#ifndef ExpanderPinAdapter_h
2#define ExpanderPinAdapter_h
6#include "GpioExpanderAdapter/GpioExpanderAdapter.h"
25 expanderAdapter(expander)
34 if ( !expanderAdapter )
return;
45 if ( !expanderAdapter )
return (mode == INPUT_PULLUP);
46 return expanderAdapter->
read(pin);
Implementation of a PinAdapter that reads from a GpioExpanderAdapter.
Definition: ExpanderPinAdapter.h:12
void begin() override
Attach the pin to the GpioExpanderAdapter which will set the pinMode if required/possible.
Definition: ExpanderPinAdapter.h:33
bool read() override
Return the state of this pin. If the GpioPinAdapter does not exist will return 'OFF' state (this shou...
Definition: ExpanderPinAdapter.h:44
ExpanderPinAdapter(byte pin, GpioExpanderAdapter *expander, int mode=INPUT_PULLUP)
Construct a new ExpanderPinAdapter with a GpioExpanderAdapter and optional pin mode (default INPUT_PU...
Definition: ExpanderPinAdapter.h:22
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 attachPin(byte pin, int mode=INPUT_PULLUP)=0
Use it to configure individual pin mode, if expander allows it. Not all of them do.
The interface specification for button, encoder button and switch pins.
Definition: PinAdapter.h:8