RuntimeTimer defines the basic Application Interface (API) to the timer part of the run to completion (RTC) kernel.
More...
#include <Imt.Base.Dff.Runtime/inc/Imt.Base.Dff.Runtime/RuntimeTimer.h>
|
using | TimerHandle = int16_t |
| A TimerHandle is used to identify a timer with a unique number.
|
|
RuntimeTimer defines the basic Application Interface (API) to the timer part of the run to completion (RTC) kernel.
Timer events are dispatched by the runtime in the same manner as any other event via the executable callback.
Definition at line 52 of file RuntimeTimer.h.
◆ TimerHandle
A TimerHandle is used to identify a timer with a unique number.
Invalid timers have the identifier TIMERHANDLE_INVALID. periodic timer identifiers have a range from 1..INT16_MAX, whereas one-shot timer identifiers have a range from -1..INT16_MIN
Definition at line 61 of file RuntimeTimer.h.
◆ getIsRunningState()
static bool imt::base::dff::runtime::RuntimeTimer::getIsRunningState |
( |
TimerHandle const |
timerToCheck | ) |
|
|
static |
Returns if the timer is running.
- Parameters
-
timerToCheck | Handle of the timer to check. |
- Returns
- bool state of the timer
◆ getTickCountMs()
static uint32_t imt::base::dff::runtime::RuntimeTimer::getTickCountMs |
( |
| ) |
|
|
static |
Returns the tick count in milliseconds elapsed since system start.
- Returns
- Tick count in milliseconds.
◆ initTimerModule()
static void imt::base::dff::runtime::RuntimeTimer::initTimerModule |
( |
uint32_t |
initialTimeMs = 0 | ) |
|
|
static |
Initialize software timer module.
- Parameters
-
initialTimeMs | The initial time the timer module uses. This parameter is only used for testing purposes. |
◆ killTimer()
Kill an existing timer.
In case the timer is not active anymore, the timerHandle will be set to invalid.
- Parameters
-
timerToKill | Handle of the timer to kill. |
◆ process1msTick()
static void imt::base::dff::runtime::RuntimeTimer::process1msTick |
( |
| ) |
|
|
static |
Process the 1ms tick in order to fire active timers if they are expired.
This function is usually called by the hardware specific implementation of the runtime.
◆ startOneShotTimer()
Starts or restarts the given one shot timer.
In case of invalid parameters, timerToStart is set to an invalid time handle.
- Parameters
-
apHandle | Receiving activeObject. |
timerToStart | Handle of the timer to start. |
timerTicksMs | Timer delay in milliseconds. |
◆ startPeriodicTimer()
Starts a periodic timer.
In case of invalid parameters, an invalid time handle is returned.
- Parameters
-
apHandle | Receiving activeObject. |
timerToStart | Handle of the timer to start. |
intervalMs | Timer interval in milliseconds (has to be > 0). |
◆ updatePeriodicTimer()
Update the intervalMs of an active periodic timer.
- Parameters
-
timerToUpdate | Handle of the Timer to start. |
intervalMs | Timer interval in milliseconds. |
◆ TIMERHANDLE_INVALID
constexpr TimerHandle imt::base::dff::runtime::RuntimeTimer::TIMERHANDLE_INVALID {0} |
|
staticconstexpr |
Constant which represents an invalid timer handle.
Definition at line 66 of file RuntimeTimer.h.
The documentation for this class was generated from the following file:
- C:/src/imt/Imt.Base-cpp/Imt.Base/Imt.Base.Dff.Runtime/inc/Imt.Base.Dff.Runtime/RuntimeTimer.h