]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained/libchip_samv7/include/rtc.h
Update version number ready for V8.2.1 release.
[freertos] / FreeRTOS / Demo / CORTEX_M7_SAMV71_Xplained / libchip_samv7 / include / rtc.h
1 /* ----------------------------------------------------------------------------\r
2  *         SAM Software Package License\r
3  * ----------------------------------------------------------------------------\r
4  * Copyright (c) 2011, 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 /**\r
31  * \file\r
32  *\r
33  * Interface for Real Time Clock (RTC) controller.\r
34  *\r
35  */\r
36 \r
37 #ifndef _RTC_\r
38 #define _RTC_\r
39 \r
40 /*----------------------------------------------------------------------------\r
41  *        Headers\r
42  *----------------------------------------------------------------------------*/\r
43 #include "chip.h"\r
44 \r
45 #include <stdint.h>\r
46 \r
47 /*----------------------------------------------------------------------------\r
48  *        Definitions\r
49  *----------------------------------------------------------------------------*/\r
50 \r
51 #define RTC_HOUR_BIT_LEN_MASK   0x3F\r
52 #define RTC_MIN_BIT_LEN_MASK    0x7F\r
53 #define RTC_SEC_BIT_LEN_MASK    0x7F\r
54 #define RTC_CENT_BIT_LEN_MASK   0x7F\r
55 #define RTC_YEAR_BIT_LEN_MASK   0xFF\r
56 #define RTC_MONTH_BIT_LEN_MASK  0x1F\r
57 #define RTC_DATE_BIT_LEN_MASK   0x3F\r
58 #define RTC_WEEK_BIT_LEN_MASK   0x07\r
59 \r
60 /*----------------------------------------------------------------------------\r
61  *        Exported functions\r
62  *----------------------------------------------------------------------------*/\r
63 \r
64 #ifdef __cplusplus\r
65  extern "C" {\r
66 #endif\r
67 \r
68 extern void RTC_SetHourMode( Rtc* pRtc, uint32_t dwMode ) ;\r
69 \r
70 extern uint32_t RTC_GetHourMode( Rtc* pRtc ) ;\r
71 \r
72 extern void RTC_EnableIt( Rtc* pRtc, uint32_t dwSources ) ;\r
73 \r
74 extern void RTC_DisableIt( Rtc* pRtc, uint32_t dwSources ) ;\r
75 \r
76 extern int RTC_SetTime( Rtc* pRtc, uint8_t ucHour, uint8_t ucMinute, uint8_t ucSecond ) ;\r
77 \r
78 extern void RTC_GetTime( Rtc* pRtc, uint8_t *pucHour, uint8_t *pucMinute, uint8_t *pucSecond ) ;\r
79 \r
80 extern int RTC_SetTimeAlarm( Rtc* pRtc, uint8_t *pucHour, uint8_t *pucMinute, uint8_t *pucSecond ) ;\r
81 \r
82 extern void RTC_GetDate( Rtc* pRtc, uint16_t *pwYear, uint8_t *pucMonth, uint8_t *pucDay, uint8_t *pucWeek ) ;\r
83 \r
84 extern int RTC_SetDate( Rtc* pRtc, uint16_t wYear, uint8_t ucMonth, uint8_t ucDay, uint8_t ucWeek ) ;\r
85 \r
86 extern int RTC_SetDateAlarm( Rtc* pRtc, uint8_t *pucMonth, uint8_t *pucDay ) ;\r
87 \r
88 extern void RTC_ClearSCCR( Rtc* pRtc, uint32_t dwMask ) ;\r
89 \r
90 extern uint32_t RTC_GetSR( Rtc* pRtc, uint32_t dwMask ) ;\r
91 \r
92 #if defined(sam3s8) || defined(sam3sd8)\r
93 extern void RTC_SetWaveForm( Rtc* pRtc, uint32_t dwWaveMode );\r
94 #endif\r
95 \r
96 #ifdef __cplusplus\r
97 }\r
98 #endif\r
99 \r
100 #endif /* #ifndef _RTC_ */\r
101 \r