semf
|
Base class for having access to the level state of a digital input. More...
#include <digitalin.h>
Public Member Functions | |
DigitalIn (Gpio &gpio, bool inverted=false) | |
Constructor. More... | |
DigitalIn (const DigitalIn &other)=delete | |
bool | isInverted () const override |
Returns of the pin level logic is inverted. More... | |
void | setInverted (bool inverted) override |
Configures the inversion of the input reading. More... | |
State | state () const override |
Returns the level status of the hardware pin. More... | |
Public Member Functions inherited from semf::app::DigitalIn | |
virtual | ~DigitalIn ()=default |
virtual bool | isInverted () const =0 |
Returns of the pin level logic is inverted. More... | |
virtual void | setInverted (bool inverted)=0 |
Configures the inversion of the input reading. More... | |
virtual State | state () const =0 |
Returns the level status of the hardware pin. More... | |
Protected Member Functions | |
Gpio & | gpio () const |
Returns the pointer to the GPIO to check the status from. More... | |
Additional Inherited Members | |
Public Types inherited from semf::app::DigitalIn | |
enum | State : bool { Low = false , High = true } |
Public Attributes inherited from semf::app::DigitalIn | |
Signal | changedToHigh |
Signal | changedToLow |
Base class for having access to the level state of a digital input.
Definition at line 22 of file digitalin.h.
|
explicit |
Constructor.
gpio | GPIO interface object for hardware access. |
inverted | true sets high level of a pin as low and low level of a pin as high. |
Definition at line 15 of file digitalin.cpp.
|
explicitdelete |
|
protected |
Returns the pointer to the GPIO to check the status from.
Definition at line 40 of file digitalin.cpp.
|
overridevirtual |
Returns of the pin level logic is inverted.
true
for inverse, otherwise false
. Implements semf::app::DigitalIn.
Definition at line 21 of file digitalin.cpp.
|
overridevirtual |
Configures the inversion of the input reading.
inverted | true interprets high level of a pin as low and a low level of a pin as high. |
Implements semf::app::DigitalIn.
Definition at line 26 of file digitalin.cpp.
|
overridevirtual |
Returns the level status of the hardware pin.
DigitalIn
is set inverted, state is inverted. High
for high level and Low
for low level. Implements semf::app::DigitalIn.
Reimplemented in semf::DigitalInPolling.
Definition at line 32 of file digitalin.cpp.