semf
|
Interfaces for having access to the level state of a digital input. More...
#include <digitalin.h>
Public Types | |
enum | State : bool { Low = false , High = true } |
Public Member Functions | |
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... | |
Public Attributes | |
Signal | changedToHigh |
Signal | changedToLow |
Interfaces for having access to the level state of a digital input.
By setting the inverted flag, the pin level will be forwarded inverse. The two signals changedToHigh
and changedToLow
will be emitted after the pin level changed. The function state
returns the actual status of the pin.
This class is designed for application layers. Both, polling (DigitalInPolling
) and interrupt (DigitalInInt
) driven inputs, inherit from this class. Also DebouncedDigitalInPolling
inherits from this class.
Definition at line 34 of file digitalin.h.
enum semf::app::DigitalIn::State : bool |
Enum for the state of the pin.
Enumerator | |
---|---|
Low | Pin is at low state |
High | Pin is at high state |
Definition at line 38 of file digitalin.h.
|
virtualdefault |
|
pure virtual |
Returns of the pin level logic is inverted.
true
for inverse, otherwise false
. Implemented in semf::DigitalIn.
|
pure virtual |
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. |
Implemented in semf::DigitalIn.
|
pure virtual |
Returns the level status of the hardware pin.
DigitalIn
is set inverted, state is inverted. High
for high level and Low
for low level. Implemented in semf::DigitalIn, and semf::DigitalInPolling.
Signal semf::app::DigitalIn::changedToHigh |
Is emitted after input changed to high.
Definition at line 64 of file digitalin.h.
Signal semf::app::DigitalIn::changedToLow |
Is emitted after input change to low.
Definition at line 66 of file digitalin.h.