RKH
RKH_TMR_T Struct Reference

Defines the data structure used to maintain information that allows the timer-handling facility to update and expire software timers. More...

#include <rkhtmr.h>

Data Fields

RKH_EVT_Tevt
 
RKH_TMR_Ttnext
 
const struct RKH_SMA_Tsma
 State machine application (a.k.a Active Object) that receives the timer event.
 
RKH_TNT_T ntick
 Tick down-counter.
 
RKH_TNT_T period
 Number of ticks for all timer expirations after the first (expiration period). A zero for this parameter makes the timer a one-shot timer, otherwise, for periodic timers, any value in range.
 
rui8_t used
 
RKH_THK_T timhk
 
RKH_TINFO_T info
 

Detailed Description

Defines the data structure used to maintain information that allows the timer-handling facility to update and expire software timers.

RKH software timers enables to execute application C functions and/or send an event to application state machine (SMA) at specific intervals of time. It can also set an application timer to expire only once. This type of timer is called a one-shot timer, while repeating interval timers are called periodic timers. Each application timer is a public resource. 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. On the other hand, application timers execute in the order in which they become active.

Note
RKH prohibits an application from explicitly modifying the RKH_TMR_T structure. The RKH's timer structures can be located anywhere in memory, but it is most common to make it a global structure by defining it outside the scope of any function. An RKH timer is created when an application timer is declared with the RKH_TMR_T data type. The following listing declares "my_timer" timer:
RKH_TMR_T my_timer;

Definition at line 291 of file rkhtmr.h.

Field Documentation

RKH_EVT_T* evt

Points to timer event.

Definition at line 296 of file rkhtmr.h.

RKH_TMR_T* tnext

Points to next timer structure in the doubly linked list.

Definition at line 301 of file rkhtmr.h.

rui8_t used

A non-zero value indicates that the timer is linked.

Definition at line 327 of file rkhtmr.h.

RKH_THK_T timhk

Hook function to call when the timer expires. This member is optional, thus it could be declared as NULL or eliminated in compile-time with RKH_CFG_TMR_HOOK_EN.

Definition at line 335 of file rkhtmr.h.

Performance information. This member is optional, thus it could be eliminated in compile-time with RKH_CFG_TMR_GET_INFO_EN.

Definition at line 343 of file rkhtmr.h.


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