![]() |
semf
|
Class for reading a digital input in polling mode. More...
#include <digitalinpolling.h>
Public Member Functions | |
DigitalInPolling (Gpio &gpio, bool inverted=false) | |
Constructor. More... | |
DigitalInPolling (Gpio &gpio, app::TimeBase &timeBase, bool inverted=false) | |
Constructor. More... | |
DigitalInPolling (const DigitalInPolling &other)=delete | |
virtual | ~DigitalInPolling ()=default |
void | tick () override |
State | state () const override |
Returns the level status of the hardware pin. More... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
virtual | ~TickReceiver ()=default |
virtual void | tick ()=0 |
Is called by every tick. Is called periodically e.g. by a Timer object. More... | |
![]() | |
virtual | ~Node ()=default |
T * | next () const |
Returns a pointer to the next element in a list. More... | |
void | setNext (T *next) |
Sets a pointer to the next element in a list. More... | |
T * | previous () const |
Returns a pointer to the previous element in a list. More... | |
void | setPrevious (T *previous) |
Sets a pointer to the previous element in a list. More... | |
bool | isInAList () |
Returns if a node is part of a LinkedList . More... | |
Protected Member Functions | |
void | setState (State state) |
Sets the hardware pin status internally. More... | |
![]() | |
Gpio & | gpio () const |
Returns the pointer to the GPIO to check the status from. More... | |
Additional Inherited Members | |
![]() | |
enum | State : bool { Low = false , High = true } |
![]() | |
Signal | changedToHigh |
Signal | changedToLow |
Class for reading a digital input in polling mode.
This class will be registered in the TimeBase
to get updated every TimeBase
cycle.
For reading the actual hardware pin level, call the function DigitalIn::state()
.
app::DigitalIn
TickReceiver
Definition at line 29 of file digitalinpolling.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 digitalinpolling.cpp.
semf::DigitalInPolling::DigitalInPolling | ( | Gpio & | gpio, |
app::TimeBase & | timeBase, | ||
bool | inverted = false |
||
) |
Constructor.
gpio | GPIO interface object for hardware access. |
timeBase | The timebase, registering in this object to update pin level. |
inverted | true sets high level of a pin as low and low level of a pin as high. |
Definition at line 21 of file digitalinpolling.cpp.
|
explicitdelete |
|
virtualdefault |
|
protected |
Sets the hardware pin status internally.
DigitalIn
is set inverted, the state has to be inverted here, tool state | Pin status. |
Definition at line 50 of file digitalinpolling.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. Reimplemented from semf::DigitalIn.
Definition at line 45 of file digitalinpolling.cpp.
|
overridevirtual |
Checks the level status of the digital input and considers the inverted setting done in DigitalIn
.
Implements semf::TickReceiver.
Definition at line 28 of file digitalinpolling.cpp.