Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / timer / include / timer.h
blobc6b1e4e1ffbd46de88dc2ed355acc154fb0fb4dd
1 #ifndef HIDD_TIMER_H
2 #define HIDD_TIMER_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Definitions for the Timer HIDD system.
9 Lang: english
11 #ifndef EXEC_TYPES_H
12 # include <exec/types.h>
13 #endif
14 #ifndef DEVICES_TIMER_H
15 # include <devices/timer.h>
16 #endif
17 #ifndef HIDD_HIDD_H
18 # include <hidd/hidd.h>
19 #endif
21 #define TIMERHIDD "timer.hidd"
23 /* This union describes a certain time, either in seconds or nanoseconds
24 (cv_Normalised), or as an absolute value (cv_Absolute). */
25 typedef struct HIDDT_ClockVal
27 ULONG cv_Format; /* HIDDT_TimeFormat enum */
28 union {
29 struct EClockVal eclock; /* 64 bits, hi and low */
30 struct timeval tval; /* 32b seconds, nanosecs */
31 UQUAD abs; /* 64 bit, absolute */
32 } cv_Value;
34 } HIDDT_ClockVal;
36 #define cv_Secs cv_Value.tval.tv_secs
37 #define cv_Nanos cv_Value.tval.tv_micro
38 #define cv_EClock cv_Value.eclock
39 #define cv_Absolute cv_Value.abs
41 /* Attributes for the Timer HIDD */
42 enum {
43 HIDDAIDX_Timer_MinPeriod, /* [..G] (HIDDT_ClockVal *) Min period */
44 HIDDAIDX_Timer_MaxPeriod, /* [..G] (HIDDT_ClockVal *) Max period */
45 HIDDAIDX_Timer_IsFixed, /* [..G] (BOOL) Is this clock fixed */
46 HIDDAIDX_Timer_IsClock, /* [..G] (BOOL) Is this a clock-like timer */
47 HIDDAIDX_Timer_IsAlarm, /* [..G] (BOOL) Is this an alarm-like timer */
48 HIDDAIDX_Timer_IsExternal, /* [..G] (BOOL) This timer is external */
49 HIDDAIDX_Timer_Mode, /* [ISG] (ULONG) Current timer mode */
51 /* Attributes for Clock like devices */
52 HIDDAIDX_Timer_IsNonVolatile, /* [..G] (BOOL) This clock is non-volatile */
54 /* Attributes for Alarm like devices */
55 HIDDAIDX_Timer_CountMode, /* [.SG] (ULONG) Current counting mode */
56 HIDDAIDX_Timer_Hook, /* [ISG] (struct Hook *) Callback hook */
57 HIDDAIDX_Timer_SigTask, /* [ISG] (struct Task *) Task to signal */
58 HIDDAIDX_Timer_SigBit, /* [ISG] (UBYTE) Signal bit to use */
59 HIDDAIDX_Timer_SoftInt, /* [ISG] (struct Interrupt *) Software Int */
62 /* Values for HIDDA_Timer_Mode */
63 enum HIDDV_Timer_Mode {
64 HIDDV_Timer_ClockMode, /* Timer in clock mode */
65 HIDDV_Timer_AlarmMode /* Timer in alarm mode */
68 /* Values for HIDDA_Timer_CountMode */
69 enum {
70 HIDDV_Timer_OneShot, /* Timer in one-shot mode */
71 HIDDV_Timer_Continuous /* Timer in continuous mode */
74 /* Values describing a HIDDT_ClockVal structure */
75 enum HIDDT_TimeFormat {
76 HIDDV_Timer_Normalised, /* Value is normalised (cv_Secs/cv_Nano) */
77 HIDDV_Timer_Absolute, /* Value is absolute format (cv_Absolute) */
78 HIDDV_Timer_EClock, /* Value is like EClock (cv_EClock) */
79 HIDDV_Timer_Internal, /* Value is timer specific format (cv_Abs) */
82 /* Methods implemented by timers */
83 enum
85 HIDDMIDX_Timer_Reset, /* Reset a timer */
86 HIDDMIDX_Timer_Freeze, /* Freeze a timer */
87 HIDDMIDX_Timer_UnFreeze, /* Unfreeze a timer */
88 HIDDMIDX_Timer_ConvertTime, /* Convert between time formats */
90 /* Clock related methods */
91 HIDDMIDX_Timer_SetPeriod, /* Set the period of a clock */
92 HIDDMIDX_Timer_GetPeriod, /* Get the period of a clock */
93 HIDDMIDX_Timer_Set, /* Set the value of a clock */
94 HIDDMIDX_Timer_Get, /* Get the value of a clock */
96 /* Alarm related methods */
97 HIDDMIDX_Timer_Start, /* Start a timer running */
98 HIDDMIDX_Timer_Stop, /* Stop a timer running */
99 HIDDMIDX_Timer_SetInterval, /* Set the interval of the alarm */
100 HIDDMIDX_Timer_GetInterval /* Get the interval of the timer */
103 /* Message for HIDDM_Timer_Convert */
104 struct hTm_Convert {
105 STACKULONG MethodID;
106 HIDDT_ClockVal *htm_From;
107 HIDDT_ClockVal *htm_To;
110 #endif /* HIDD_TIMER_H */