Karg  v0.2.0
The kernel of CargOS
timer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <list.h>
4 #include <time.h>
5 
6 typedef struct {
8 
10  void (*callback)(void *data);
11  void *data;
12 } timer_t;
13 
14 void timer_init(timer_t *timer);
15 void timer_wait(timer_t *timer, time_t ns, void (*callback)(void *data),
16  void *data);
17 void timer_cancel(timer_t *timer);
18 void timer_isr(void);
Definition: list.h:6
Definition: timer.h:6
list_node_t node
Definition: timer.h:7
time_t time
Definition: timer.h:9
void * data
Definition: timer.h:11
u64 time_t
Definition: time.h:7
void timer_init(timer_t *timer)
Definition: timer.c:9
void timer_cancel(timer_t *timer)
Definition: timer.c:32
void timer_wait(timer_t *timer, time_t ns, void(*callback)(void *data), void *data)
Definition: timer.c:11
void timer_isr(void)
Definition: timer.c:43