source: trunk/Cosy/incl/timer.h@ 10077

Last change on this file since 10077 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 1.4 KB
Line 
1/*-----------------------------------------------------------------------------
2timer.h -- Timer Management
3
4Copyright (c) 1994 JANZ Computer AG
5All Rights Reserved
6
7Created 94/10/11 by Soenke Hansen
8Version 1.3 of 96/04/18
9
10Prototypes of functions defined in timer.c.
11The details of timer messages are in msg.h.
12
13-----------------------------------------------------------------------------*/
14
15#ifndef timer_DEFINED
16#define timer_DEFINED
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include "defs.h"
23#include "msg.h"
24
25/* Time units are 100usecs. Conversion (with chopping) from other
26 time units. */
27#define time_units_ms(ms) (((ms) < 0xffff/10) ? 10 * (ms) : 0xffff)
28
29/* Timer identifiers are 16 bit unsigned integers */
30#define NIL_TIMID (WORD_t)0 /* invalid identifier */
31
32/* Initialize the timer management */
33extern void init_timer _PARAMS((void));
34
35/* Start periodical timer */
36extern void start_timer _PARAMS((WORD_t));
37
38/* Stop timer */
39extern void stop_timer _PARAMS((void));
40
41/* Deactivate a timer */
42extern void clear_timer _PARAMS((WORD_t));
43
44/* Activate a timer. The alarm time is given in units of 100 usecs.
45 The alarm time is relative to the time of call. */
46extern int set_timer _PARAMS((WORD_t, WORD_t, WORD_t *));
47
48/* Alarm interrupt handler passed to the clock. */
49extern void isr_timer _PARAMS((void));
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* !timer_DEFINED */
Note: See TracBrowser for help on using the repository browser.