summaryrefslogtreecommitdiff
path: root/lcmodule/source/cnh1605720_ldr_time_utilities/include/t_time_utilities.h
blob: 534667987be7479a0abe1d8a32f40c266792e479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*******************************************************************************
 * Copyright (C) ST-Ericsson SA 2011
 * License terms: 3-clause BSD license
 ******************************************************************************/
#ifndef _T_TIME_UTILITIES_H_
#define _T_TIME_UTILITIES_H_
/**
 * @addtogroup ldr_time_utilities
 * @{
 */

/*******************************************************************************
 * Types, constants
 ******************************************************************************/

/** MAX defined timers */
#define MAX_TIMERS    100

/** defined type of function pointer to the handle function */
typedef void (*HandleFunction_t)(void *Param_p, void *Timer_p, void *Data_p);

/**
 * Structure of timer data
 */
typedef struct {
    uint32           Time;             /**< Requested for timer time.*/
    uint32           PeriodicalTime;   /**< Requested periodical time for timer.*/
    HandleFunction_t HandleFunction_p; /**< Callback function*/
    void            *Data_p;           /**< Pointer to data. */
    void            *Param_p;          /**< Extra parameters. */
    uint32           Set_Time;         /**< Used for debugging purposes only. */
    uint32           Set_System_Time;  /**< Used for debugging purposes only. */
} Timer_t;

/**
 * Header for buffer of timers
 */
typedef struct {
    uint32   MaxTimers;
    uint32   ActiveTimers;
    Timer_t *Timers_p;
} TimerHeader_t;

/** @} */
#endif /*_T_TIME_UTILITIES_H_*/