2 * GeekOS timer interrupt support
3 * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
4 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
5 * (c) 2008, The V3VEE Project <http://www.v3vee.org>
8 * This is free software. You are permitted to use,
9 * redistribute, and modify it as specified in the file "COPYING".
12 #ifndef GEEKOS_TIMER_H
13 #define GEEKOS_TIMER_H
17 extern volatile unsigned long g_numTicks;
19 typedef void (*timerCallback)(int, void*);
21 void Init_Timer(void);
23 void Micro_Delay(int us);
27 int ticks; /* timer code decrements this */
28 int id; /* unqiue id for this timer even */
29 timerCallback callBack; /* Queue to wakeup on timer expire */
30 void * cb_arg; /* Argument to add to callback */
35 int Start_Timer_Secs(int seconds, timerCallback cb, void * arg);
36 int Start_Timer_MSecs(int msecs, timerCallback cb, void * arg);
37 int Start_Timer(int ticks, timerCallback, void * arg);
40 double Get_Remaining_Timer_Secs(int id);
41 int Get_Remaining_Timer_MSecs(int id);
42 int Get_Remaining_Timer_Ticks(int id);
43 int Cancel_Timer(int id);
45 void Micro_Delay(int us);
47 unsigned long clock_time(void); //return elipsed millisecs
49 #endif /* GEEKOS_TIMER_H */