Dataflow Runtime API  4.0.1.0
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
imt::base::dff::runtime::RuntimeTimer Class Reference

RuntimeTimer defines the basic Application Interface (API) to the timer part of the run to completion (RTC) kernel. More...

#include <Imt.Base.Dff.Runtime/RuntimeTimer.h>

Classes

struct  TimeItem
 TimeItem Object Structure. More...
 

Public Types

typedef int16_t TimerHandle
 A TimerHandle is used to identify a timer with a unique number. More...
 

Static Public Member Functions

static void initTimerModule ()
 Initialize software timer module. More...
 
static void startOneShotTimer (RuntimeCore::CoreHandle const apHandle, TimerHandle &timerToStart, uint32_t const timerTicksMs)
 Starts or restarts the given one shot timer. More...
 
static void startPeriodicTimer (RuntimeCore::CoreHandle const apHandle, TimerHandle &timerToStart, uint32_t const intervalMs)
 Starts a periodic timer. More...
 
static void updatePeriodicTimer (TimerHandle const timerToUpdate, uint32_t const intervalMs)
 Update the intervalMs of an active periodic timer. More...
 
static void killTimer (TimerHandle &timerToKill)
 Kill an existing timer. More...
 
static void process1msTick ()
 Process the 1ms tick in order to fire active timers if they are expired. More...
 
static uint32_t getTickCountMs ()
 Returns the tick count in milliseconds elapsed since system start. More...
 
static bool getIsRunningState (TimerHandle const timerHandle)
 Returns if the timer is running. More...
 

Static Public Attributes

static TimerHandle const TIMERHANDLE_INVALID = 0
 Constant which represents an invalid timer handle. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ 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

Member Function Documentation

◆ getIsRunningState()

static bool imt::base::dff::runtime::RuntimeTimer::getIsRunningState ( TimerHandle const  timerHandle)
static

Returns if the timer is running.

Parameters
timerHandleHandle 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 ( )
static

Initialize software timer module.

◆ killTimer()

static void imt::base::dff::runtime::RuntimeTimer::killTimer ( TimerHandle timerToKill)
static

Kill an existing timer.

In case the timer is not active anymore, the timerHandle will be set to invalid.

Parameters
timerToKillHandle 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()

static void imt::base::dff::runtime::RuntimeTimer::startOneShotTimer ( RuntimeCore::CoreHandle const  apHandle,
TimerHandle timerToStart,
uint32_t const  timerTicksMs 
)
static

Starts or restarts the given one shot timer.

In case of invalid parameters, timerToStart is set to an invalid time handle.

Parameters
apHandleReceiving activeObject.
timerToStartHandle of the timer to start.
timerTicksMsTimer delay in milliseconds.

◆ startPeriodicTimer()

static void imt::base::dff::runtime::RuntimeTimer::startPeriodicTimer ( RuntimeCore::CoreHandle const  apHandle,
TimerHandle timerToStart,
uint32_t const  intervalMs 
)
static

Starts a periodic timer.

In case of invalid parameters, an invalid time handle is returned.

Parameters
apHandleReceiving activeObject.
timerToStartHandle of the timer to start.
intervalMsTimer interval in milliseconds (has to be > 0).

◆ updatePeriodicTimer()

static void imt::base::dff::runtime::RuntimeTimer::updatePeriodicTimer ( TimerHandle const  timerToUpdate,
uint32_t const  intervalMs 
)
static

Update the intervalMs of an active periodic timer.

Parameters
timerToUpdateHandle of the Timer to start.
intervalMsTimer interval in milliseconds.

Member Data Documentation

◆ TIMERHANDLE_INVALID

TimerHandle const imt::base::dff::runtime::RuntimeTimer::TIMERHANDLE_INVALID = 0
static

Constant which represents an invalid timer handle.


The documentation for this class was generated from the following file: