comparison bsp/rtc/rtc_config.h @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /******************************************************************************/
2 /* */
3 /* File Name: rtc_config.h */
4 /* */
5 /* Purpose: This file contains adresses for RTC register access. */
6 /* and defined value */
7 /* */
8 /* Note: None. */
9 /* */
10 /* Revision History: */
11 /* 05/31/01 Laurent Sollier Create. */
12 /* */
13 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */
14 /* */
15 /******************************************************************************/
16
17 #ifndef _RTC_CONFIG_H_
18 #define _RTC_CONFIG_H_
19
20 #include "../../include/config.h"
21
22 #include "../mem.h"
23 #include "../../riviera/rv/general.h"
24
25
26 /* FOR ULYSSE AND CALYPSO CHIP */
27 /* Seconds register */
28 #define RTC_SECONDS_REG (UINT8 *)(RTC_XIO_START)
29 /* Minutes register */
30 #define RTC_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x01)
31 /* Hours register */
32 #define RTC_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x02)
33 /* Days register */
34 #define RTC_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x03)
35 /* Months register */
36 #define RTC_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x04)
37 /* Years register */
38 #define RTC_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x05)
39 /* Week register */
40 #define RTC_WEEK_REG ((UINT8 *)(RTC_XIO_START) + 0x06)
41 /* Alarms seconds register */
42 #define RTC_ALARM_SECONDS_REG ((UINT8 *)(RTC_XIO_START) + 0x08)
43 /* Alarms minutes register */
44 #define RTC_ALARM_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x09)
45 /* Alarms hours register */
46 #define RTC_ALARM_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x0A)
47 /* Alarms days register */
48 #define RTC_ALARM_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x0B)
49 /* Alarms months register */
50 #define RTC_ALARM_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x0C)
51 /* Alarms years register */
52 #define RTC_ALARM_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x0D)
53 /* Control register */
54 #define RTC_CTRL_REG ((UINT8 *)(RTC_XIO_START) + 0x10)
55 /* Status register */
56 #define RTC_STATUS_REG ((UINT8 *)(RTC_XIO_START) + 0x11)
57 /* Interrupts register */
58 #define RTC_INTERRUPTS_REG ((UINT8 *)(RTC_XIO_START) + 0x12)
59 /* LSB compensation register */
60 #define RTC_COMP_LSB_REG ((UINT8 *)(RTC_XIO_START) + 0x13)
61 /* MSB compensation register */
62 #define RTC_COMP_MSB_REG ((UINT8 *)(RTC_XIO_START) + 0x14)
63
64 /* RTC Control register description */
65
66 #define RTC_START_RTC 0x0001 /* 1 => RTC is running */
67 #define RTC_ROUND_30S 0x0002 /* Time rounded to the closest minute */
68 #define RTC_AUTO_COMP 0x0004 /* Auto compensation enabled or not */
69 #define RTC_MODE_12_24 0x0008 /* 12 hours mode*/
70 #define RTC_TEST_MODE 0x0010 /* Test mode */
71 #define RTC_SET_32_COUNTER 0x0020 /* set 32 KHz counter with comp_reg */
72 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11))
73 #define RTC_nDELTA_OMEGA 0x0040 /* Analog Baseband Type */
74 #endif
75
76
77 /* RTC Interrupt register description */
78
79 #define RTC_EVERY 0x0003
80 /* Define period of periodic interrupt (second, minute, hour, day) */
81 #define RTC_IT_TIMER 0x0004 /* Enable periodic interrupt */
82 #define RTC_IT_ALARM 0x0008 /* Alarm interrupt enabled or not */
83
84 /* RTC Status register description */
85
86 #define RTC_BUSY 0x0001
87 #define RTC_RUN 0x0002 /* RTC is running */
88 #define RTC_1S_EVENT 0x0004 /* One second has occured */
89 #define RTC_1M_EVENT 0x0008 /* One minute has occured */
90 #define RTC_1H_EVENT 0x0010 /* One hour has occured */
91 #define RTC_1D_EVENT 0x0020 /* One day has occrued */
92 #define RTC_ALARM 0x0040 /* Alarm interrupt has been generated */
93 #define RTC_POWER_UP 0x0080 /* Indicates that a reset occured */
94
95 #define RTC_EVERY_SEC 0x0000
96 #define RTC_EVERY_MIN 0x0001
97 #define RTC_EVERY_HR 0x0002
98 #define RTC_EVERY_DAY 0x0003
99
100 /* 32 Khz and HF clock definition */
101 #define RTC_CLOCK_32K 32768.0
102
103 /* HF clock definition */
104 #if ((CHIPSET == 3) || (CHIPSET == 5) || (CHIPSET == 6))
105 #define RTC_CLOCK_HF 65000000.0
106 #elif ((CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8))
107 #define RTC_CLOCK_HF 78000000.0
108 #elif ((CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12))
109 #define RTC_CLOCK_HF 104000000.0
110 #endif
111
112
113
114 #endif /* #ifndef _RTC_CONFIG_H_ */