1 /******************************************************************************
2 ** File Name: rtc_reg_v3.h *
3 ** Author: mingwei.zhang *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
7 ******************************************************************************/
8 /******************************************************************************
10 **---------------------------------------------------------------------------*
11 ** DATE NAME DESCRIPTION *
12 ** 06/11/2010 mingwei.zhang Create. *
13 ******************************************************************************/
14 #ifndef _RTC_REG_V3_H_
15 #define _RTC_REG_V3_H_
16 /*----------------------------------------------------------------------------*
18 **------------------------------------------------------------------------- */
20 /**---------------------------------------------------------------------------*
22 **--------------------------------------------------------------------------*/
27 /**---------------------------------------------------------------------------*
29 **---------------------------------------------------------------------------*/
32 /*----------Real Timer Counter Register----------*/
34 #define RTC_BASE SPRD_ANA_RTC_PHYS
35 #define ANA_RTC_SEC_CNT (RTC_BASE + 0x00)
36 #define ANA_RTC_MIN_CNT (RTC_BASE + 0x04)
37 #define ANA_RTC_HOUR_CNT (RTC_BASE + 0x08)
38 #define ANA_RTC_DAY_CNT (RTC_BASE + 0x0C)
39 #define ANA_RTC_SEC_UPDATE (RTC_BASE + 0x10)
40 #define ANA_RTC_MIN_UPDATE (RTC_BASE + 0x14)
41 #define ANA_RTC_HOUR_UPDATE (RTC_BASE + 0x18)
42 #define ANA_RTC_DAY_UPDATE (RTC_BASE + 0x1C)
43 #define ANA_RTC_SEC_ALM (RTC_BASE + 0x20)
44 #define ANA_RTC_MIN_ALM (RTC_BASE + 0x24)
45 #define ANA_RTC_HOUR_ALM (RTC_BASE + 0x28)
46 #define ANA_RTC_DAY_ALM (RTC_BASE + 0x2C)
47 #define ANA_RTC_INT_EN (RTC_BASE + 0x30)
48 #define ANA_RTC_INT_RSTS (RTC_BASE + 0x34)
49 #define ANA_RTC_INT_CLR (RTC_BASE + 0x38)
50 #define ANA_RTC_INT_MSK (RTC_BASE + 0x3C)
52 #define ANA_RTC_SPG_VALUE (RTC_BASE + 0x50)
53 #define ANA_RTC_SPG_UPD (RTC_BASE + 0x54)
55 //The corresponding bit of RTC_CTL register.
56 #define RTC_SEC_BIT BIT_0 //Sec int enable
57 #define RTC_MIN_BIT BIT_1 //Min int enable
58 #define RTC_HOUR_BIT BIT_2 //Hour int enable
59 #define RTC_DAY_BIT BIT_3 //Day int enable
60 #define RTC_ALARM_BIT BIT_4 //Alarm int enable
61 #define RTCCTL_HOUR_FMT_SEL BIT_5 //Hour format select
62 //#define RTCCTL_EN BIT_6 //Rtc module enable
64 #define RTC_SEC_ACK_BIT BIT_8 // Sec ack int enable
65 #define RTC_MIN_ACK_BIT BIT_9 //Min ack int enable
66 #define RTC_HOUR_ACK_BIT BIT_10 //Hour ack int enable
67 #define RTC_DAY_ACK_BIT BIT_11 //Day ack int enable
68 #define RTC_SEC_ALM_ACK_BIT BIT_12 //Sec alm ack int enable
69 #define RTC_MIN_ALM_ACK_BIT BIT_13 //Min alm ack int enable
70 #define RTC_HOUR_ALM_ACK_BIT BIT_14 //Hour alm ack int enable
71 #define RTC_DAY_ALM_ACK_BIT BIT_15 //Day alm ack int enable
73 #define RTC_UPD_TIME_MASK (RTC_SEC_ACK_BIT | RTC_MIN_ACK_BIT | RTC_HOUR_ACK_BIT | RTC_DAY_ACK_BIT)
74 #define RTC_INT_ALL_MSK (0xFFFF&(~(BIT_5|BIT_6|BIT_7)))
76 #define RTC_SEC_MASK 0x3F
77 #define RTC_MIN_MASK 0x3F
78 #define RTC_HOUR_MASK 0x1F
79 #define RTC_DAY_MASK 0xFFFF
81 /**----------------------------------------------------------------------------*
83 **----------------------------------------------------------------------------*/
88 /**---------------------------------------------------------------------------*/
89 #endif //_RTC_REG_V3_H_