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