]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_AT91SAM3U256_IAR/AT91Lib/peripherals/rtc/rtc.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_AT91SAM3U256_IAR / AT91Lib / peripherals / rtc / rtc.h
1 /* ----------------------------------------------------------------------------\r
2  *         ATMEL Microcontroller Software Support \r
3  * ----------------------------------------------------------------------------\r
4  * Copyright (c) 2008, Atmel Corporation\r
5  *\r
6  * All rights reserved.\r
7  *\r
8  * Redistribution and use in source and binary forms, with or without\r
9  * modification, are permitted provided that the following conditions are met:\r
10  *\r
11  * - Redistributions of source code must retain the above copyright notice,\r
12  * this list of conditions and the disclaimer below.\r
13  *\r
14  * Atmel's name may not be used to endorse or promote products derived from\r
15  * this software without specific prior written permission.\r
16  *\r
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR\r
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,\r
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\r
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
27  * ----------------------------------------------------------------------------\r
28  */\r
29 \r
30 #ifndef RTC_H\r
31 #define RTC_H\r
32 \r
33 //------------------------------------------------------------------------------\r
34 //         Macro used\r
35 //------------------------------------------------------------------------------\r
36 #define RTC_HOUR_BIT_LEN_MASK   0x3F\r
37 #define RTC_MIN_BIT_LEN_MASK    0x7F\r
38 #define RTC_SEC_BIT_LEN_MASK    0x7F\r
39 #define RTC_CENT_BIT_LEN_MASK   0x7F\r
40 #define RTC_YEAR_BIT_LEN_MASK   0xFF\r
41 #define RTC_MONTH_BIT_LEN_MASK  0x1F\r
42 #define RTC_DATE_BIT_LEN_MASK   0x3F\r
43 #define RTC_WEEK_BIT_LEN_MASK   0x07\r
44 \r
45 //------------------------------------------------------------------------------\r
46 //         Exported functions\r
47 //------------------------------------------------------------------------------\r
48 \r
49 extern void RTC_SetHourMode(unsigned int mode);\r
50 \r
51 extern unsigned int RTC_GetHourMode();\r
52 \r
53 extern void RTC_EnableIt(unsigned int sources);\r
54 \r
55 extern void RTC_DisableIt(unsigned int sources);\r
56 \r
57 extern int RTC_SetTime(\r
58         unsigned char hour,\r
59         unsigned char minute,\r
60         unsigned char second);\r
61 \r
62 extern void RTC_GetTime(\r
63         unsigned char *pHour,\r
64         unsigned char *pMinute,\r
65         unsigned char *pSecond);\r
66 \r
67 extern int RTC_SetTimeAlarm(\r
68         unsigned char *pHour,\r
69         unsigned char *pMinute,\r
70         unsigned char *pSecond);\r
71 \r
72 void RTC_GetDate(\r
73     unsigned short *pYear,\r
74     unsigned char *pMonth,\r
75     unsigned char *pDay,\r
76     unsigned char *pWeek);\r
77 \r
78 extern int RTC_SetDate(\r
79     unsigned short year,\r
80     unsigned char month,\r
81     unsigned char day,\r
82     unsigned char week);\r
83 \r
84 extern int RTC_SetDateAlarm(unsigned char *pMonth, unsigned char *pDay);\r
85 \r
86 extern void RTC_ClearSCCR(unsigned int mask);\r
87 \r
88 extern unsigned int RTC_GetSR(unsigned int mask);\r
89 #endif //#ifndef RTC_H\r
90 \r