From: Alan Cox Date: Wed, 15 Nov 2017 21:09:50 +0000 (+0000) Subject: rtc: Headers for RTC in kernel and user X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=32fae56cdd5507107140bcd867204899c03403f2;p=FUZIX.git rtc: Headers for RTC in kernel and user --- diff --git a/Kernel/include/rtc.h b/Kernel/include/rtc.h new file mode 100644 index 00000000..ca16a897 --- /dev/null +++ b/Kernel/include/rtc.h @@ -0,0 +1,17 @@ + +struct cmos_rtc +{ + uint8_t type; + union { + uint8_t bytes[8]; + time_t clock; + } data; +}; + +#define CMOS_RTC_BCD 0 +/* BCD encodded YYYY MM DD HH MM SS */ +#define CMOS_RTC_DEC 1 +/* Byte encoded the same. Year is 2 bytes little endian */ +#define CMOS_RTC_TIME 2 +/* Unix time format */ + diff --git a/Library/include/sys/rtc.h b/Library/include/sys/rtc.h new file mode 100644 index 00000000..3f65e7bf --- /dev/null +++ b/Library/include/sys/rtc.h @@ -0,0 +1,20 @@ +#ifndef _SYS_RTC_H +#define _SYS_RTC_H + +struct cmos_rtc +{ + uint8_t type; + union { + uint8_t bytes[8]; + time_t clock; + } data; +}; + +#define CMOS_RTC_BCD 0 +/* BCD encodded YYYY MM DD HH MM SS */ +#define CMOS_RTC_DEC 1 +/* Byte encoded the same. Year is 2 bytes little endian */ +#define CMOS_RTC_TIME 2 +/* Unix time format */ + +#endif