1 #ifndef __LUNAIX_HWTIMER_H
2 #define __LUNAIX_HWTIMER_H
4 #include <lunaix/device.h>
5 #include <lunaix/time.h>
6 #include <lunaix/types.h>
8 typedef void (*timer_tick_cb)();
10 #define HWTIMER_MIN_PRECEDENCE 0
11 #define HWTIMER_MAX_PRECEDENCE 15
14 struct hwtimer_pot_ops
16 void (*calibrate)(struct hwtimer_pot*, u32_t hertz);
23 struct llist_header timers;
26 timer_tick_cb callback;
29 volatile ticks_t systick_raw;
31 struct hwtimer_pot_ops* ops;
35 hwtimer_init(u32_t hertz, void* tick_callback);
38 hwtimer_current_systicks();
41 hwtimer_to_ticks(u32_t value, int unit);
44 hwtimer_attach_potens(struct device* dev, int precedence,
45 struct hwtimer_pot_ops* ops);
48 #endif /* __LUNAIX_HWTIMER_H */