00001 /* ndk - [ timer.h ] 00002 * 00003 * Interface for controlling the x86 timer 00004 * 00005 * (c)2004 dcipher / neuraldk 00006 * www.neuraldk.org 00007 */ 00008 00017 #ifndef __ndk_timer_h__ 00018 #define __ndk_timer_h__ 00019 00020 #include <types.h> 00021 #include <errorCodes.h> 00022 00023 typedef void (*TimerFunction) (void *data); 00024 typedef struct _Timer *Timer; 00025 00031 ErrorCode timerSetFreq(uint32 freq); 00032 00038 ErrorCode timerGetFreq(uint32 *freq); 00039 00045 ErrorCode timerGetTicks(uint32 *ticks); 00046 00056 ErrorCode timerDelay(uint32 usec); 00057 00067 ErrorCode timerCreate(Timer *t, uint32 usec, TimerFunction func, void *data); 00068 00074 ErrorCode timerStart(Timer t); 00075 00081 ErrorCode timerStop(Timer t); 00082 00090 ErrorCode timerSetTimeout(Timer t, uint32 usec); 00091 00098 ErrorCode timerSetRepeat(Timer t, Boolean repeat); 00099 00105 ErrorCode timerDestroy(Timer *t); 00106 00108 #endif