Subversion Repositories NaviCtrl

Rev

Rev 196 | Details | Compare with Previous | Last modification | View Log | RSS feed

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