RTEMS: cpukit/include/rtems/rtems/timer.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1989-2011.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * Copyright (c) 2009, 2016 embedded brains GmbH.
14 *
15 * The license and distribution terms for this file may be
16 * found in the file LICENSE in this distribution or at
17 * http://www.rtems.org/license/LICENSE.
18 */
19
20#ifndef _RTEMS_RTEMS_TIMER_H
21#define _RTEMS_RTEMS_TIMER_H
22
23#include <rtems/rtems/attr.h>
24#include <rtems/rtems/status.h>
25#include <rtems/rtems/tasks.h>
26#include <rtems/rtems/types.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
46#define TIMER_CLASS_BIT_TIME_OF_DAY 0x1
47
48#define TIMER_CLASS_BIT_ON_TASK 0x2
49
50#define TIMER_CLASS_BIT_NOT_DORMANT 0x4
51
56 typedef enum {
60 TIMER_DORMANT,
61
66 TIMER_INTERVAL = TIMER_CLASS_BIT_NOT_DORMANT,
67
72 TIMER_INTERVAL_ON_TASK =
73 TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_ON_TASK,
74
79 TIMER_TIME_OF_DAY =
80 TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY,
81
86 TIMER_TIME_OF_DAY_ON_TASK =
87 TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY |
88 TIMER_CLASS_BIT_ON_TASK
89} Timer_Classes;
90
94 typedef void rtems_timer_service_routine;
95
101 typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
102 rtems_id,
103 void *
104 );
105
118 rtems_status_code rtems_timer_create(
119 rtems_name name,
120 rtems_id *id
121);
122
137 rtems_status_code rtems_timer_ident(
138 rtems_name name,
139 rtems_id *id
140);
141
148 rtems_status_code rtems_timer_cancel(
149 rtems_id id
150);
151
164 rtems_status_code rtems_timer_delete(
165 rtems_id id
166);
167
186 rtems_status_code rtems_timer_fire_after(
187 rtems_id id,
188 rtems_interval ticks,
189 rtems_timer_service_routine_entry routine,
190 void *user_data
191);
192
211 rtems_status_code rtems_timer_server_fire_after(
212 rtems_id id,
213 rtems_interval ticks,
214 rtems_timer_service_routine_entry routine,
215 void *user_data
216);
217
236 rtems_status_code rtems_timer_fire_when(
237 rtems_id id,
238 rtems_time_of_day *wall_time,
239 rtems_timer_service_routine_entry routine,
240 void *user_data
241);
242
254 rtems_status_code rtems_timer_server_fire_when(
255 rtems_id id,
256 rtems_time_of_day *wall_time,
257 rtems_timer_service_routine_entry routine,
258 void *user_data
259);
260
271 rtems_status_code rtems_timer_reset(
272 rtems_id id
273);
274
288 rtems_status_code rtems_timer_initiate_server(
289 rtems_task_priority priority,
290 size_t stack_size,
291 rtems_attribute attribute_set
292);
293
299#define RTEMS_TIMER_SERVER_DEFAULT_PRIORITY (uint32_t) -1
300
305 typedef struct {
307 Timer_Classes the_class;
309 Watchdog_Interval initial;
311 Watchdog_Interval start_time;
313 Watchdog_Interval stop_time;
314} rtems_timer_information;
315
328 rtems_status_code rtems_timer_get_information(
329 rtems_id id,
330 rtems_timer_information *the_info
331);
332
335#ifdef __cplusplus
336}
337#endif
338
339#endif
340/* end of include file */
attr.h
types.h
rtems_attribute
uint32_t rtems_attribute
Definition: attr.h:41
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
rtems_name
uint32_t rtems_name
Classic API object name type.
Definition: types.h:77
rtems_task_priority
uint32_t rtems_task_priority
Definition: tasks.h:55
rtems_id
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
rtems_interval
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
rtems_timer_reset
rtems_status_code rtems_timer_reset(rtems_id id)
RTEMS Timer Reset.
Definition: timerreset.c:24
rtems_timer_server_fire_when
rtems_status_code rtems_timer_server_fire_when(rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data)
RTEMS Timer Server Fire When Directive.
Definition: timerserverfirewhen.c:24
rtems_timer_service_routine_entry
rtems_timer_service_routine(* rtems_timer_service_routine_entry)(rtems_id, void *)
Definition: timer.h:101
rtems_timer_server_fire_after
rtems_status_code rtems_timer_server_fire_after(rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data)
RTEMS Timer Server Fire After.
Definition: timerserverfireafter.c:23
rtems_timer_create
rtems_status_code rtems_timer_create(rtems_name name, rtems_id *id)
RTEMS Create Timer.
Definition: timercreate.c:185
rtems_timer_delete
rtems_status_code rtems_timer_delete(rtems_id id)
RTEMS Delete Timer.
Definition: timerdelete.c:23
rtems_timer_cancel
rtems_status_code rtems_timer_cancel(rtems_id id)
rtems_timer_cancel
Definition: timercancel.c:19
rtems_timer_ident
rtems_status_code rtems_timer_ident(rtems_name name, rtems_id *id)
RTEMS Timer Name to Id.
Definition: timerident.c:27
rtems_timer_initiate_server
rtems_status_code rtems_timer_initiate_server(rtems_task_priority priority, size_t stack_size, rtems_attribute attribute_set)
Initiates the timer server.
Definition: timerserver.c:226
rtems_timer_service_routine
void rtems_timer_service_routine
Definition: timer.h:94
rtems_timer_get_information
rtems_status_code rtems_timer_get_information(rtems_id id, rtems_timer_information *the_info)
RTEMS Get Timer Information.
Definition: timergetinfo.c:23
rtems_timer_fire_when
rtems_status_code rtems_timer_fire_when(rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data)
RTEMS Timer Fire When.
Definition: timerfirewhen.c:23
Timer_Classes
Timer_Classes
Definition: timer.h:56
rtems_timer_fire_after
rtems_status_code rtems_timer_fire_after(rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data)
RTEMS Timer Fire After.
Definition: timerfireafter.c:23
TIMER_TIME_OF_DAY
@ TIMER_TIME_OF_DAY
Definition: timer.h:79
TIMER_TIME_OF_DAY_ON_TASK
@ TIMER_TIME_OF_DAY_ON_TASK
Definition: timer.h:86
TIMER_INTERVAL
@ TIMER_INTERVAL
Definition: timer.h:66
TIMER_INTERVAL_ON_TASK
@ TIMER_INTERVAL_ON_TASK
Definition: timer.h:72
TIMER_DORMANT
@ TIMER_DORMANT
Definition: timer.h:60
Watchdog_Interval
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdogticks.h:38
status.h
rtems_time_of_day
Data structure to manage and manipulate calendar time.
Definition: types.h:141
rtems_timer_information
Definition: timer.h:305
rtems_timer_information::stop_time
Watchdog_Interval stop_time
Definition: timer.h:313
rtems_timer_information::the_class
Timer_Classes the_class
Definition: timer.h:307
rtems_timer_information::initial
Watchdog_Interval initial
Definition: timer.h:309
rtems_timer_information::start_time
Watchdog_Interval start_time
Definition: timer.h:311
tasks.h
Classic Task Manager API.