xref: /minix3/minix/drivers/clock/readclock/readclock.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #ifndef __READCLOCK_H
2*433d6423SLionel Sambuc #define __READCLOCK_H
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc #include <time.h>
5*433d6423SLionel Sambuc 
6*433d6423SLionel Sambuc /* implementations provided by arch/${MACHINE_ARCH}/arch_readclock.c */
7*433d6423SLionel Sambuc struct rtc {
8*433d6423SLionel Sambuc 	int (*init)(void);
9*433d6423SLionel Sambuc 	int (*get_time)(struct tm *t, int flags);
10*433d6423SLionel Sambuc 	int (*set_time)(struct tm *t, int flags);
11*433d6423SLionel Sambuc 	int (*pwr_off)(void);
12*433d6423SLionel Sambuc 	void (*exit)(void);
13*433d6423SLionel Sambuc };
14*433d6423SLionel Sambuc 
15*433d6423SLionel Sambuc int arch_setup(struct rtc *r);
16*433d6423SLionel Sambuc 
17*433d6423SLionel Sambuc /* utility functions provided by readclock.c */
18*433d6423SLionel Sambuc int bcd_to_dec(int n);
19*433d6423SLionel Sambuc int dec_to_bcd(int n);
20*433d6423SLionel Sambuc 
21*433d6423SLionel Sambuc #endif /* __READCLOCK_H */
22