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

Static Public Attributes

static const TimerHandle 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 ( const TimerHandle  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 ( void  )
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 ( void  )
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 ( void  )
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 ( const RuntimeCore::CoreHandle  apHandle,
TimerHandle timerToStart,
const uint32_t  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 ( const RuntimeCore::CoreHandle  apHandle,
TimerHandle timerToStart,
const uint32_t  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 ( const TimerHandle  timerToUpdate,
const uint32_t  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

const TimerHandle 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: