RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rkhtmr.h File Reference

Specifies the interface of software timer services. More...

#include "rkhitl.h"
Include dependency graph for rkhtmr.h:

Go to the source code of this file.

Data Structures

struct  RKH_TINFO_T
 Defines the data structure into which the performance information for software timers is stored. More...
 
struct  RKH_TMR_T
 Defines the data structure used to maintain information that allows the timer-handling facility to update and expire software timers. More...
 

Macros

#define RKH_TIM_TICK(_sender)   rkh_tmr_tick(_sender)
 Invoke the system clock tick processing rkh_tmr_tick(). More...
 
#define RKH_TMR_INIT(t_, e_, th_)   rkh_tmr_init_((t_), (e_), (th_))
 Initializes the previously allocated timer structure RKH_TMR_T. More...
 
#define RKH_TMR_ONESHOT(t, sma, itick)
 Start a timer as one-shot timer. More...
 
#define RKH_TMR_PERIODIC(t, sma, itick, per)
 Start a timer as periodic timer. More...
 

Typedefs

typedef void(* RKH_THK_T )(void *t)
 The prototype of callback function (hook) to call when the timer expires. More...
 
typedef rui8_t RKH_TNT_T
 This data type defines the dynamic range of the time delays measured in clock ticks (maximum number of ticks). More...
 

Functions

void rkh_tmr_init_ (RKH_TMR_T *t, const RKH_EVT_T *e, RKH_THK_T thk)
 Initializes the previously allocated timer structure RKH_TMR_T.
 
void rkh_tmr_start (RKH_TMR_T *t, const struct RKH_SMA_T *sma, RKH_TNT_T itick)
 Start a timer. More...
 
void rkh_tmr_stop (RKH_TMR_T *t)
 Stops a running timer. More...
 
void rkh_tmr_get_info (RKH_TMR_T *t, RKH_TINFO_T *info)
 Retrieves performance information for a particular software timer. More...
 
void rkh_tmr_clear_info (RKH_TMR_T *t)
 Clear performance information for a particular software timer. More...
 
void rkh_tmr_tick (const void *const sender)
 Keep tracks and updates the started timers. More...
 

Detailed Description

Specifies the interface of software timer services.

Definition in file rkhtmr.h.

Typedef Documentation

typedef void(* RKH_THK_T)(void *t)

The prototype of callback function (hook) to call when the timer expires.

Parameters
[in]tpointer to elapsed timer (RKH_TMR_T data structure).

Definition at line 222 of file rkhtmr.h.

typedef rui8_t RKH_TNT_T

This data type defines the dynamic range of the time delays measured in clock ticks (maximum number of ticks).

The valid values [in bits] are 8, 16 or 32. Default is 8. This type is configurable via the preprocessor switch RKH_CFG_TMR_SIZEOF_NTIMER.

Definition at line 233 of file rkhtmr.h.

Function Documentation

void rkh_tmr_tick ( const void *const  sender)

Keep tracks and updates the started timers.

Time intervals are measured by periodic timer interrupts. Each timer interrupt is called a timer-tick. The actual time between timer-ticks is specified by the application. This function must be placed where will be incrementing the system tick. Normally this function is placed in a timer ISR routine. If one or more timers expires the assigned event is directly posted into the state machine application (SMA) queue and associated hook function is executed (if it's used). The expiration events of timers that expire at the same time are executed in the order they were started.

Note
This function is internal to RKH and the user application should not call it. Instead, use RKH_TIM_TICK() macro.