RTEMS CPU Kit with SuperCore  4.10.99.0
rtems/rtems/timer.h
Go to the documentation of this file.
00001 
00030 /*
00031  * COPYRIGHT (c) 1989-2011.
00032  * On-Line Applications Research Corporation (OAR).
00033  *
00034  * Copyright (c) 2009 embedded brains GmbH.
00035  *
00036  * The license and distribution terms for this file may be
00037  * found in the file LICENSE in this distribution or at
00038  * http://www.rtems.org/license/LICENSE.
00039  */
00040 
00041 #ifndef _RTEMS_RTEMS_TIMER_H
00042 #define _RTEMS_RTEMS_TIMER_H
00043 
00044 #include <rtems/rtems/attr.h>
00045 #include <rtems/rtems/status.h>
00046 #include <rtems/rtems/types.h>
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00070 typedef enum {
00075   TIMER_INTERVAL,
00076 
00081   TIMER_INTERVAL_ON_TASK,
00082 
00087   TIMER_TIME_OF_DAY,
00088 
00093   TIMER_TIME_OF_DAY_ON_TASK,
00094 
00098   TIMER_DORMANT
00099 } Timer_Classes;
00100 
00104 typedef void rtems_timer_service_routine;
00105 
00111 typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
00112                  rtems_id,
00113                  void *
00114              );
00115 
00120 typedef struct {
00122   Objects_Control  Object;
00124   Watchdog_Control Ticker;
00126   Timer_Classes    the_class;
00127 }   Timer_Control;
00128 
00141 rtems_status_code rtems_timer_create(
00142   rtems_name    name,
00143   rtems_id     *id
00144 );
00145 
00160 rtems_status_code rtems_timer_ident(
00161   rtems_name    name,
00162   rtems_id     *id
00163 );
00164 
00171 rtems_status_code rtems_timer_cancel(
00172   rtems_id   id
00173 );
00174 
00187 rtems_status_code rtems_timer_delete(
00188   rtems_id   id
00189 );
00190 
00209 rtems_status_code rtems_timer_fire_after(
00210   rtems_id                           id,
00211   rtems_interval                     ticks,
00212   rtems_timer_service_routine_entry  routine,
00213   void                              *user_data
00214 );
00215 
00234 rtems_status_code rtems_timer_server_fire_after(
00235   rtems_id                           id,
00236   rtems_interval                     ticks,
00237   rtems_timer_service_routine_entry  routine,
00238   void                              *user_data
00239 );
00240 
00259 rtems_status_code rtems_timer_fire_when(
00260   rtems_id                            id,
00261   rtems_time_of_day                  *wall_time,
00262   rtems_timer_service_routine_entry   routine,
00263   void                               *user_data
00264 );
00265 
00277 rtems_status_code rtems_timer_server_fire_when(
00278   rtems_id                            id,
00279   rtems_time_of_day                  *wall_time,
00280   rtems_timer_service_routine_entry   routine,
00281   void                               *user_data
00282 );
00283 
00294 rtems_status_code rtems_timer_reset(
00295   rtems_id   id
00296 );
00297 
00305 rtems_status_code rtems_timer_initiate_server(
00306   uint32_t             priority,
00307   uint32_t             stack_size,
00308   rtems_attribute      attribute_set
00309 );
00310 
00316 #define RTEMS_TIMER_SERVER_DEFAULT_PRIORITY (uint32_t) -1
00317 
00322 typedef struct {
00324   Timer_Classes      the_class;
00326   Watchdog_Interval  initial;
00328   Watchdog_Interval  start_time;
00330   Watchdog_Interval  stop_time;
00331 } rtems_timer_information;
00332 
00345 rtems_status_code rtems_timer_get_information(
00346   rtems_id                 id,
00347   rtems_timer_information *the_info
00348 );
00349 
00352 #ifdef __cplusplus
00353 }
00354 #endif
00355 
00356 #endif
00357 /* end of include file */