| Line |  | 
|---|
| 1 | /*----------------------------------------------------------------------------- | 
|---|
| 2 | timer.h -- Timer Management | 
|---|
| 3 |  | 
|---|
| 4 | Copyright (c) 1994 JANZ Computer AG | 
|---|
| 5 | All Rights Reserved | 
|---|
| 6 |  | 
|---|
| 7 | Created 94/10/11 by Soenke Hansen | 
|---|
| 8 | Version 1.3 of 96/04/18 | 
|---|
| 9 |  | 
|---|
| 10 | Prototypes of functions defined in timer.c. | 
|---|
| 11 | The details of timer messages are in msg.h. | 
|---|
| 12 |  | 
|---|
| 13 | -----------------------------------------------------------------------------*/ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef timer_DEFINED | 
|---|
| 16 | #define timer_DEFINED | 
|---|
| 17 |  | 
|---|
| 18 | #ifdef __cplusplus | 
|---|
| 19 | extern "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 */ | 
|---|
| 33 | extern void init_timer _PARAMS((void)); | 
|---|
| 34 |  | 
|---|
| 35 | /* Start periodical timer */ | 
|---|
| 36 | extern void start_timer _PARAMS((WORD_t)); | 
|---|
| 37 |  | 
|---|
| 38 | /* Stop timer */ | 
|---|
| 39 | extern void stop_timer _PARAMS((void)); | 
|---|
| 40 |  | 
|---|
| 41 | /* Deactivate a timer */ | 
|---|
| 42 | extern 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. */ | 
|---|
| 46 | extern int set_timer _PARAMS((WORD_t, WORD_t, WORD_t *)); | 
|---|
| 47 |  | 
|---|
| 48 | /* Alarm interrupt handler passed to the clock. */ | 
|---|
| 49 | extern 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.