1 #ifndef __LUNAIX_TIMER_H
2 #define __LUNAIX_TIMER_H
4 #include <lunaix/ds/llist.h>
5 #include <lunaix/time.h>
6 #include <lunaix/hart_state.h>
8 #define SYS_TIMER_FREQUENCY_HZ 1000
10 #define TIMER_MODE_PERIODIC 0x1
14 struct llist_header link;
18 void (*callback)(void*);
23 * @brief Initialize the system timer that runs at specified frequency
25 * @param frequency The frequency that timer should run in Hz.
31 timer_run_second(u32_t second,
32 void (*callback)(void*),
37 timer_run_ms(u32_t millisecond,
38 void (*callback)(void*),
43 timer_run(ticks_t ticks, void (*callback)(void*), void* payload, u8_t flags);
45 #endif /* __LUNAIX_TIMER_H */