1 #ifndef __LUNAIX_HWRTC_H
2 #define __LUNAIX_HWRTC_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/ldga.h>
6 #include <lunaix/ds/llist.h>
7 #include <lunaix/time.h>
9 #define RTC_STATE_MASKED 0x1
12 struct hwrtc_potens_ops
14 void (*get_walltime)(struct hwrtc_potens*, datetime_t*);
15 void (*set_walltime)(struct hwrtc_potens*, datetime_t*);
16 void (*set_proactive)(struct hwrtc_potens*, bool);
17 int (*chfreq)(struct hwrtc_potens*, int);
19 int (*calibrate)(struct hwrtc_potens*);
26 struct llist_header rtc_potentes;
27 struct device* rtc_proxy;
30 volatile ticks_t live;
33 struct hwrtc_potens_ops* ops;
40 hwrtc_walltime(datetime_t* dt);
43 hwrtc_attach_potens(struct device* raw_rtcdev, struct hwrtc_potens_ops* ops);
45 #endif /* __LUNAIX_HWRTC_H */