1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef AT91_RTC_H
17#define AT91_RTC_H
18
19#define AT91_RTC_CR 0x00
20#define AT91_RTC_UPDTIM (1 << 0)
21#define AT91_RTC_UPDCAL (1 << 1)
22#define AT91_RTC_TIMEVSEL (3 << 8)
23#define AT91_RTC_TIMEVSEL_MINUTE (0 << 8)
24#define AT91_RTC_TIMEVSEL_HOUR (1 << 8)
25#define AT91_RTC_TIMEVSEL_DAY24 (2 << 8)
26#define AT91_RTC_TIMEVSEL_DAY12 (3 << 8)
27#define AT91_RTC_CALEVSEL (3 << 16)
28#define AT91_RTC_CALEVSEL_WEEK (0 << 16)
29#define AT91_RTC_CALEVSEL_MONTH (1 << 16)
30#define AT91_RTC_CALEVSEL_YEAR (2 << 16)
31
32#define AT91_RTC_MR 0x04
33#define AT91_RTC_HRMOD (1 << 0)
34
35#define AT91_RTC_TIMR 0x08
36#define AT91_RTC_SEC (0x7f << 0)
37#define AT91_RTC_MIN (0x7f << 8)
38#define AT91_RTC_HOUR (0x3f << 16)
39#define AT91_RTC_AMPM (1 << 22)
40
41#define AT91_RTC_CALR 0x0c
42#define AT91_RTC_CENT (0x7f << 0)
43#define AT91_RTC_YEAR (0xff << 8)
44#define AT91_RTC_MONTH (0x1f << 16)
45#define AT91_RTC_DAY (7 << 21)
46#define AT91_RTC_DATE (0x3f << 24)
47
48#define AT91_RTC_TIMALR 0x10
49#define AT91_RTC_SECEN (1 << 7)
50#define AT91_RTC_MINEN (1 << 15)
51#define AT91_RTC_HOUREN (1 << 23)
52
53#define AT91_RTC_CALALR 0x14
54#define AT91_RTC_MTHEN (1 << 23)
55#define AT91_RTC_DATEEN (1 << 31)
56
57#define AT91_RTC_SR 0x18
58#define AT91_RTC_ACKUPD (1 << 0)
59#define AT91_RTC_ALARM (1 << 1)
60#define AT91_RTC_SECEV (1 << 2)
61#define AT91_RTC_TIMEV (1 << 3)
62#define AT91_RTC_CALEV (1 << 4)
63
64#define AT91_RTC_SCCR 0x1c
65#define AT91_RTC_IER 0x20
66#define AT91_RTC_IDR 0x24
67#define AT91_RTC_IMR 0x28
68
69#define AT91_RTC_VER 0x2c
70#define AT91_RTC_NVTIM (1 << 0)
71#define AT91_RTC_NVCAL (1 << 1)
72#define AT91_RTC_NVTIMALR (1 << 2)
73#define AT91_RTC_NVCALALR (1 << 3)
74
75#endif
76