]>
Commit | Line | Data |
---|---|---|
61b0cfe9 L |
1 | /* |
2 | * (C) Copyright 2001 | |
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | * | |
5 | * SPDX-License-Identifier: GPL-2.0+ | |
6 | */ | |
7 | ||
8 | /* | |
9 | * Generic RTC interface. | |
10 | */ | |
11 | #ifndef _RTC_H_ | |
12 | #define _RTC_H_ | |
13 | ||
14 | ||
15 | /* | |
16 | * The struct used to pass data from the generic interface code to | |
17 | * the hardware dependend low-level code ande vice versa. Identical | |
18 | * to struct rtc_time used by the Linux kernel. | |
19 | * | |
20 | * Note that there are small but significant differences to the | |
21 | * common "struct time": | |
22 | * | |
23 | * struct time: struct rtc_time: | |
24 | * tm_mon 0 ... 11 1 ... 12 | |
25 | * tm_year years since 1900 years since 0 | |
26 | */ | |
27 | ||
28 | struct rtc_time { | |
29 | int tm_sec; | |
30 | int tm_min; | |
31 | int tm_hour; | |
32 | int tm_mday; | |
33 | int tm_mon; | |
34 | int tm_year; | |
35 | int tm_wday; | |
36 | int tm_yday; | |
37 | int tm_isdst; | |
38 | }; | |
39 | ||
40 | int rtc_get (struct rtc_time *); | |
41 | int rtc_set (struct rtc_time *); | |
61b0cfe9 L |
42 | |
43 | void GregorianDay (struct rtc_time *); | |
44 | void to_tm (unsigned long, struct rtc_time *); | |
45 | unsigned long mktime (unsigned int, unsigned int, unsigned int, | |
46 | unsigned int, unsigned int, unsigned int); | |
47 | ||
48 | #endif /* _RTC_H_ */ |