source: rtems/c/src/exec/rtems/include/rtems/rtems/timer.h @ 08311cc3

4.104.114.84.95
Last change on this file since 08311cc3 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 17, 1999 at 5:51:34 PM

Updated copyright notice.

  • Property mode set to 100644
File size: 4.5 KB
Line 
1/*  timer.h
2 *
3 *  This include file contains all the constants, structures, and
4 *  prototypes associated with the Timer Manager.  This manager provides
5 *  facilities to configure, initiate, cancel, and delete timers which will
6 *  fire at specified intervals of time.
7 *
8 *  Directives provided are:
9 *
10 *     + create a timer
11 *     + get an ID of a timer
12 *     + delete a timer
13 *     + set a timer to fire after a number of ticks have passed
14 *     + set a timer to fire when a specified date and time has been reached
15 *     + reset a timer
16 *     + cancel a time
17 *
18 *  COPYRIGHT (c) 1989-1999.
19 *  On-Line Applications Research Corporation (OAR).
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.OARcorp.com/rtems/license.html.
24 *
25 *  $Id$
26 */
27
28#ifndef __RTEMS_TIMER_h
29#define __RTEMS_TIMER_h
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <rtems/score/object.h>
36#include <rtems/score/tod.h>
37#include <rtems/score/watchdog.h>
38
39/*
40 *  The following enumerated type details the classes to which a timer
41 *  may belong.
42 */
43
44typedef enum {
45  TIMER_INTERVAL,
46  TIMER_TIME_OF_DAY,
47  TIMER_DORMANT
48} Timer_Classes;
49
50/*
51 *  The following types define a pointer to a timer service routine.
52 */
53 
54typedef void rtems_timer_service_routine;
55 
56typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
57                 rtems_id,
58                 void *
59             );
60
61/*
62 *  The following defines the information control block used to manage
63 *  this class of objects.
64 */
65
66RTEMS_EXTERN Objects_Information  _Timer_Information;
67
68/*
69 *  The following records define the control block used to manage
70 *  each timer.
71 */
72
73typedef struct {
74  Objects_Control  Object;
75  Watchdog_Control Ticker;
76  Timer_Classes    the_class;
77}   Timer_Control;
78
79/*
80 *  _Timer_Manager_initialization
81 *
82 *  DESCRIPTION:
83 *
84 *  This routine performs the initialization necessary for this manager.
85 */
86
87void _Timer_Manager_initialization(
88  unsigned32 maximum_timers
89);
90
91/*
92 *  rtems_timer_create
93 *
94 *  DESCRIPTION:
95 *
96 *  This routine implements the rtems_timer_create directive.  The
97 *  timer will have the name name.  It returns the id of the
98 *  created timer in ID.
99 */
100
101rtems_status_code rtems_timer_create(
102  rtems_name    name,
103  Objects_Id   *id
104);
105
106/*
107 *  rtems_timer_ident
108 *
109 *  DESCRIPTION:
110 *
111 *  This routine implements the rtems_timer_ident directive.
112 *  This directive returns the timer ID associated with name.
113 *  If more than one timer is named name, then the timer
114 *  to which the ID belongs is arbitrary.
115 */
116
117rtems_status_code rtems_timer_ident(
118  rtems_name    name,
119  Objects_Id   *id
120);
121
122/*
123 *  rtems_timer_cancel
124 *
125 *  DESCRIPTION:
126 *
127 *  This routine implements the rtems_timer_cancel directive.  It is used
128 *  to stop the timer associated with ID from firing.
129 */
130
131rtems_status_code rtems_timer_cancel(
132  Objects_Id id
133);
134
135/*
136 *  rtems_timer_delete
137 *
138 *  DESCRIPTION:
139 *
140 *  This routine implements the rtems_timer_delete directive.  The
141 *  timer indicated by ID is deleted.
142 */
143
144rtems_status_code rtems_timer_delete(
145  Objects_Id id
146);
147
148/*
149 *  rtems_timer_fire_after
150 *
151 *  DESCRIPTION:
152 *
153 *  This routine implements the rtems_timer_fire_after directive.  It
154 *  initiates the timer associated with ID to fire in ticks clock
155 *  ticks.  When the timer fires, the routine will be invoked.
156 */
157
158rtems_status_code rtems_timer_fire_after(
159  Objects_Id                         id,
160  rtems_interval                     ticks,
161  rtems_timer_service_routine_entry  routine,
162  void                              *user_data
163);
164
165/*
166 *  rtems_timer_fire_when
167 *
168 *  DESCRIPTION:
169 *
170 *  This routine implements the rtems_timer_fire_when directive.  It
171 *  initiates the timer associated with ID to fire at wall_time
172 *  When the timer fires, the routine will be invoked.
173 */
174
175rtems_status_code rtems_timer_fire_when(
176  Objects_Id                          id,
177  rtems_time_of_day                  *wall_time,
178  rtems_timer_service_routine_entry   routine,
179  void                               *user_data
180);
181
182/*
183 *  rtems_timer_reset
184 *
185 *  DESCRIPTION:
186 *
187 *  This routine implements the rtems_timer_reset directive.  It is used
188 *  to reinitialize the interval timer associated with ID just as if
189 *  rtems_timer_fire_after were re-invoked with the same arguments that
190 *  were used to initiate this timer.
191 */
192
193rtems_status_code rtems_timer_reset(
194  Objects_Id id
195);
196
197#ifndef __RTEMS_APPLICATION__
198#include <rtems/rtems/timer.inl>
199#endif
200
201#ifdef __cplusplus
202}
203#endif
204
205#endif
206/* end of include file */
Note: See TracBrowser for help on using the repository browser.