![]() |
semf
|
Software SoftwareTimer
which can be added to a TimeBase
or used singular.
More...
#include <softwaretimer.h>
Public Member Functions | |
SoftwareTimer (uint32_t interval=0, bool start=false) | |
Constructor using no timebase. More... | |
SoftwareTimer (app::TimeBase &timeBase, uint32_t interval=0, bool start=false) | |
Constructor using no timebase. More... | |
virtual | ~SoftwareTimer ()=default |
void | setInterval (uint32_t interval) |
Set the timer interval. More... | |
uint32_t | interval () const |
Get the timer interval. More... | |
uint32_t | counterValue () const |
Get the current counter value. More... | |
void | reset () override |
void | tick () override |
Counting the time. Must be called cyclically by a timer interrupt or similar. More... | |
void | start () override |
Start time counting. More... | |
void | stop () override |
bool | isRunning () const |
Check if the timer is running. More... | |
![]() | |
virtual | ~Timer ()=default |
virtual void | start ()=0 |
virtual void | stop ()=0 |
virtual void | reset ()=0 |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
Signal | timeout |
Signal< Error > | error |
Software SoftwareTimer
which can be added to a TimeBase
or used singular.
For using the object combined with a TimeBase
, add the timer to the TimeBase
, for the singular usage case, call the count function e.g. in the microcontroller hardware timer interrupt service routine. Setting interval to zero will lead to the same behavior as setting the interval to one.
Definition at line 28 of file softwaretimer.h.
|
explicit |
Constructor using no timebase.
interval | The timer interval. |
start |
|
Definition at line 16 of file softwaretimer.cpp.
|
explicit |
Constructor using no timebase.
timeBase | The timebase for the timer. |
interval | The timer interval. |
start |
|
Definition at line 22 of file softwaretimer.cpp.
|
virtualdefault |
uint32_t semf::SoftwareTimer::counterValue | ( | ) | const |
Get the current counter value.
Definition at line 39 of file softwaretimer.cpp.
uint32_t semf::SoftwareTimer::interval | ( | ) | const |
Get the timer interval.
Definition at line 34 of file softwaretimer.cpp.
bool semf::SoftwareTimer::isRunning | ( | ) | const |
Check if the timer is running.
Definition at line 76 of file softwaretimer.cpp.
|
overridevirtual |
Restart counting.
Implements semf::app::Timer.
Definition at line 44 of file softwaretimer.cpp.
void semf::SoftwareTimer::setInterval | ( | uint32_t | interval | ) |
Set the timer interval.
interval | The timer interval. |
Definition at line 29 of file softwaretimer.cpp.
|
overridevirtual |
Start time counting.
Implements semf::app::Timer.
Definition at line 64 of file softwaretimer.cpp.
|
overridevirtual |
Stop time counting.
Implements semf::app::Timer.
Definition at line 70 of file softwaretimer.cpp.
|
overridevirtual |
Counting the time. Must be called cyclically by a timer interrupt or similar.
Implements semf::TickReceiver.
Definition at line 49 of file softwaretimer.cpp.