blob: 1adac21b9235c44cf69373e8d2ce095b88b9060b [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* ============================================================================
2** Copyright (C) 2002-2006 COMNEON GmbH & Co. OHG. All rights reserved.
3** ============================================================================
4**
5** ============================================================================
6**
7** This document contains proprietary information belonging to COMNEON.
8** Passing on and copying of this document, use and communication of its
9** contents is not permitted without prior written authorisation.
10**
11** ============================================================================
12** Revision Information :
13** File name: tic.h
14** Version: /main/6
15** Date: 2006-01-11 9:53:32
16**
17** ============================================================================
18** Project: Mobile Station (MS)
19** Block: -
20** Process: TIC
21**
22** ============================================================================
23** Contents: This file contains the interfaces for the timer management
24** component.
25**
26** ============================================================================
27** History:
28**
29** Date Author Comment
30**
31** 13.02.02 ges created.
32**
33** ============================================================================
34*/
35
36#ifndef TIC_H
37#define TIC_H
38
39/*============================================================================
40Exported Type Declarations
41============================================================================*/
42
43/* External representation of the timer control block data type.*/
44typedef struct tic_timer_s *tic_timer_t;
45
46
47/* TIC control ids.
48 *
49 * TIC_INFO:
50 * Get timer information.
51 *
52 * TIC_TRACE: 0/1 = disable/enable the tic trace.
53 * tic_ctrl_trace_t trace;
54 * trace.stat = 1;
55 * tic_timer_control (TIC_CTRL_TRACE, &trace, sizeof (tic_ctrl_trace_t));
56 */
57typedef enum
58{
59 TIC_CTRL_INFO,
60 TIC_CTRL_TRACE
61}tic_req_t;
62
63typedef struct tic_ctrl_info_s
64{
65 UINT16 max_number; /* Max. number of available timers. */
66 UINT16 installed; /* Number of installed timers. */
67} tic_ctrl_info_t;
68
69
70typedef struct tic_ctrl_trace_s
71{
72 UINT8 stat; /* 0/1 = disable/enable the tic trace. */
73} tic_ctrl_trace_t;
74
75
76/*============================================================================
77Exported Function Declarations
78============================================================================*/
79/**B**************************************************************************
80 * Function: tic_timer_create
81 *----------------------------------------------------------------------------
82 * Purpose: This function creates a timer and places it on the
83 * list of created timers. The timer is activated by
84 * tic_timer_start(). Upon timer expiration the
85 * expiration_routine is called.
86 *
87 * Parameters: expfunc: timer expiration routine.
88 * arg: argument of the expiration routine.
89 *
90 * Returns: Timer handle.
91 ***E*************************************************************************/
92extern tic_timer_t tic_timer_create(VOID (*expfunc)(VOID *arg), VOID *arg);
93
94
95/**B**************************************************************************
96 * Function: tic_timer_free
97 *----------------------------------------------------------------------------
98 * Purpose: This function is responsible for freeing a timer.
99 *
100 * Parameters: timer: timer handle.
101 *
102 * Returns: 1 means during dealloction the timer handler was executed,
103 * otherwise 0.
104 ***E*************************************************************************/
105extern SINT32 tic_timer_free(tic_timer_t timer);
106
107
108/**B**************************************************************************
109 * Function: tic_timer_start
110 *----------------------------------------------------------------------------
111 * Purpose: This function is responsible for starting a timer.
112 *
113 * Parameters: timer: timer handle.
114 * secs: number of seconds.
115 * nano_secs: nano seconds.
116 *
117 * Returns: None.
118 ***E*************************************************************************/
119extern VOID tic_timer_start(tic_timer_t timer, UNSIGNED secs, UNSIGNED nano_secs);
120
121
122/**B**************************************************************************
123 * Function: tic_timer_stop
124 *----------------------------------------------------------------------------
125 * Purpose: This function is responsible for stopping a timer.
126 *
127 * Parameters: timer: timer handle.
128 *
129 * Returns: 1 means during stopping the timer handler was executed,
130 * otherwise 0.
131 ***E*************************************************************************/
132extern SINT32 tic_timer_stop(tic_timer_t timer);
133
134#endif /* TIC_H */
135