Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | ingob | 1 | /******************** (C) COPYRIGHT 2006 STMicroelectronics ******************** |
2 | * File Name : 91x_rtc.h |
||
3 | * Author : MCD Application Team |
||
4 | * Date First Issued : 05/18/2006 : Version 1.0 |
||
5 | * Description : This file provides the RTC library software functions |
||
6 | * prototypes & definitions |
||
7 | ******************************************************************************** |
||
8 | * History: |
||
9 | * 05/22/2007 : Version 1.2 |
||
10 | * 05/24/2006 : Version 1.1 |
||
11 | * 05/18/2006 : Version 1.0 |
||
12 | ******************************************************************************** |
||
13 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH |
||
14 | * CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS |
||
15 | * A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT |
||
16 | * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT |
||
17 | * OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION |
||
18 | * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
||
19 | *******************************************************************************/ |
||
20 | |||
21 | /* Define to prevent recursive inclusion -------------------------------------*/ |
||
22 | #ifndef __91x_RTC_H |
||
23 | #define __91x_RTC_H |
||
24 | |||
25 | /* Includes ------------------------------------------------------------------*/ |
||
26 | #include "91x_map.h" |
||
27 | |||
28 | /* Private typedef -----------------------------------------------------------*/ |
||
29 | typedef struct |
||
30 | { |
||
31 | u8 century; |
||
32 | u8 year; |
||
33 | u8 month; |
||
34 | u8 day; |
||
35 | u8 weekday; |
||
36 | }RTC_DATE; |
||
37 | |||
38 | typedef struct |
||
39 | { |
||
40 | u8 hours; |
||
41 | u8 minutes; |
||
42 | u8 seconds; |
||
43 | u16 milliseconds; |
||
44 | }RTC_TIME; |
||
45 | |||
46 | typedef struct |
||
47 | { |
||
48 | u8 day; |
||
49 | u8 hours; |
||
50 | u8 minutes; |
||
51 | u8 seconds; |
||
52 | }RTC_ALARM; |
||
53 | |||
54 | /* Exported constants --------------------------------------------------------*/ |
||
55 | |||
56 | #define BINARY 0 |
||
57 | #define BCD 1 |
||
58 | |||
59 | /*TamperMode*/ |
||
60 | #define RTC_TamperMode_Edge 0xFFFFFFEF |
||
61 | #define RTC_TamperMode_Level 0x10 |
||
62 | |||
63 | /*TamperPol*/ |
||
64 | #define RTC_TamperPol_High 0x4 |
||
65 | #define RTC_TamperPol_Low 0xFFFFFFFB |
||
66 | |||
67 | /*PeriodicClock*/ |
||
68 | #define RTC_Per_2Hz 0x10000 |
||
69 | #define RTC_Per_16Hz 0x20000 |
||
70 | #define RTC_Per_128Hz 0x40000 |
||
71 | #define RTC_Per_1024Hz 0x80000 |
||
72 | #define RTC_Per_DISABLE 0x0 |
||
73 | |||
74 | /*RTC_IT*/ |
||
75 | #define RTC_IT_Per 0x200000 |
||
76 | #define RTC_IT_Alarm 0x800000 |
||
77 | #define RTC_IT_Tamper 0x400000 |
||
78 | |||
79 | /*RTC_FLAG*/ |
||
80 | #define RTC_FLAG_Per 0x80000000 |
||
81 | #define RTC_FLAG_Alarm 0x40000000 |
||
82 | #define RTC_FLAG_Tamper 0x10000000 |
||
83 | |||
84 | |||
85 | /* Module private variables --------------------------------------------------*/ |
||
86 | /* Exported macro ------------------------------------------------------------*/ |
||
87 | /* Private functions ---------------------------------------------------------*/ |
||
88 | /* Exported functions ------------------------------------------------------- */ |
||
89 | void RTC_DeInit(void); |
||
90 | void RTC_SetDate(RTC_DATE Date); |
||
91 | void RTC_SetTime(RTC_TIME Time); |
||
92 | void RTC_SetAlarm(RTC_ALARM Alarm); |
||
93 | void RTC_GetDate(u8 Format, RTC_DATE * Date); |
||
94 | void RTC_GetTime(u8 Format, RTC_TIME * Time); |
||
95 | void RTC_GetAlarm(u8 Format, RTC_ALARM * Alarm); |
||
96 | void RTC_TamperConfig(u32 TamperMode, u32 TamperPol); |
||
97 | void RTC_TamperCmd(FunctionalState NewState); |
||
98 | void RTC_AlarmCmd(FunctionalState NewState); |
||
99 | void RTC_CalibClockCmd(FunctionalState NewState); |
||
100 | void RTC_SRAMBattPowerCmd(FunctionalState NewState); |
||
101 | void RTC_PeriodicIntConfig(u32 PeriodicClock); |
||
102 | void RTC_ITConfig(u32 RTC_IT, FunctionalState NewState); |
||
103 | FlagStatus RTC_GetFlagStatus(u32 RTC_FLAG); |
||
104 | void RTC_ClearFlag(u32 RTC_FLAG); |
||
105 | #endif /*__91x_RTC_H*/ |
||
106 | |||
107 | /******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/ |
||
108 | |||
109 | |||
110 |