![]() |
MHEG5
18.9.0
MHEG5 Documentation
|
The timer module allows the use of timers within the MHEG5 component. These timers can be set by other parts of the component and call a callback function when they are triggered. The timer component offers two timer functions: The first is mhegTimerCreate which creates a new timer with a specified timeout, callback, and caller reference and returns a handle. Once the timer expires the callback is called, passing the caller reference and timer handle, with the trigger flag set to True. The callback may be called before the mhegTimerCreate function completes. The second is mhegTimerDestroy which destroys a running or expired timer. If the timer has not triggered mhegTimerDestroy calls the callback with the trigger flag set to False, to allow any client resources associated with this timer to be freed. It is guaranteed that the callback will not be called for this timer once the mhegTimerDestroy function returns. Note: The callback must be reentrant and can be called from either the clients task or a timer component task. More...
Go to the source code of this file.
Macros | |
#define | mhegTimerCreate VT_TimerCreate |
#define | mhegTimerDestroy VT_TimerDestroy |
Typedefs | |
typedef void * | H_Timer |
typedef void(* | F_TimerCallback) (BOOLEAN triggered, void *callerRef, H_Timer timerHandle) |
Functions | |
E_MhegErr | VT_TimerCreate (U32BIT millisecs, F_TimerCallback callback, void *callerRef, H_Timer *pTimerHandle) |
Set a timer for a certain number of millseconds. When the timer expires a specified callback will be called, passing the caller reference value. More... | |
E_MhegErr | VT_TimerDestroy (H_Timer timerHandle) |
Destroy the specified timer. A callback will not be invoked for this timer after this function returns. More... | |
E_MhegErr | VT_TimersInit (U32BIT task_priority) |
Initialise the timer component. This function must be called before any other timer functions are invoked. More... | |
E_MhegErr | VT_TimersExit (void) |
Uninitialise the timer component - all resources are freed. Other timer functions must not be called after calling this function until mhegTimerInit is called again. More... | |
The timer module allows the use of timers within the MHEG5 component. These timers can be set by other parts of the component and call a callback function when they are triggered. The timer component offers two timer functions: The first is mhegTimerCreate which creates a new timer with a specified timeout, callback, and caller reference and returns a handle. Once the timer expires the callback is called, passing the caller reference and timer handle, with the trigger flag set to True. The callback may be called before the mhegTimerCreate function completes. The second is mhegTimerDestroy which destroys a running or expired timer. If the timer has not triggered mhegTimerDestroy calls the callback with the trigger flag set to False, to allow any client resources associated with this timer to be freed. It is guaranteed that the callback will not be called for this timer once the mhegTimerDestroy function returns. Note: The callback must be reentrant and can be called from either the clients task or a timer component task.
Definition in file glue_timers.h.
#define mhegTimerCreate VT_TimerCreate |
Definition at line 85 of file glue_timers.h.
#define mhegTimerDestroy VT_TimerDestroy |
Definition at line 86 of file glue_timers.h.
Definition at line 77 of file glue_timers.h.
typedef void* H_Timer |
Definition at line 58 of file glue_timers.h.
E_MhegErr VT_TimerCreate | ( | U32BIT | millisecs, |
F_TimerCallback | callback, | ||
void * | callerRef, | ||
H_Timer * | pTimerHandle | ||
) |
Set a timer for a certain number of millseconds. When the timer expires a specified callback will be called, passing the caller reference value.
millisecs | Number of milliseconds before callback will be invoked. |
callback | Pointer to callback function to invoke when timer is triggered. |
callerRef | Caller reference which is passed to callback function when timer is triggered |
pTimerHandle | Pointer to handle to this timer that must be used to destroy the timer. |
Definition at line 223 of file glue_timers.c.
Destroy the specified timer. A callback will not be invoked for this timer after this function returns.
timerHandle | Handle of the timer to be destroyed. |
Definition at line 324 of file glue_timers.c.
E_MhegErr VT_TimersExit | ( | void | ) |
Uninitialise the timer component - all resources are freed. Other timer functions must not be called after calling this function until mhegTimerInit is called again.
Definition at line 474 of file glue_timers.c.
Initialise the timer component. This function must be called before any other timer functions are invoked.
Definition at line 407 of file glue_timers.c.