1 /**************************************************************************//**
\r
2 * @file efm32wg_rtc.h
\r
3 * @brief EFM32WG_RTC register and bit field definitions
\r
5 ******************************************************************************
\r
7 * <b>(C) Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com</b>
\r
8 ******************************************************************************
\r
10 * Permission is granted to anyone to use this software for any purpose,
\r
11 * including commercial applications, and to alter it and redistribute it
\r
12 * freely, subject to the following restrictions:
\r
14 * 1. The origin of this software must not be misrepresented; you must not
\r
15 * claim that you wrote the original software.@n
\r
16 * 2. Altered source versions must be plainly marked as such, and must not be
\r
17 * misrepresented as being the original software.@n
\r
18 * 3. This notice may not be removed or altered from any source distribution.
\r
20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc.
\r
21 * has no obligation to support this Software. Silicon Laboratories, Inc. is
\r
22 * providing the Software "AS IS", with no express or implied warranties of any
\r
23 * kind, including, but not limited to, any implied warranties of
\r
24 * merchantability or fitness for any particular purpose or warranties against
\r
25 * infringement of any proprietary rights of a third party.
\r
27 * Silicon Laboratories, Inc. will not be liable for any consequential,
\r
28 * incidental, or special damages, or any other relief, or for any claim by
\r
29 * any third party, arising from your use of this Software.
\r
31 *****************************************************************************/
\r
32 /**************************************************************************//**
\r
33 * @defgroup EFM32WG_RTC
\r
35 * @brief EFM32WG_RTC Register Declaration
\r
36 *****************************************************************************/
\r
39 __IO uint32_t CTRL; /**< Control Register */
\r
40 __IO uint32_t CNT; /**< Counter Value Register */
\r
41 __IO uint32_t COMP0; /**< Compare Value Register 0 */
\r
42 __IO uint32_t COMP1; /**< Compare Value Register 1 */
\r
43 __I uint32_t IF; /**< Interrupt Flag Register */
\r
44 __IO uint32_t IFS; /**< Interrupt Flag Set Register */
\r
45 __IO uint32_t IFC; /**< Interrupt Flag Clear Register */
\r
46 __IO uint32_t IEN; /**< Interrupt Enable Register */
\r
48 __IO uint32_t FREEZE; /**< Freeze Register */
\r
49 __I uint32_t SYNCBUSY; /**< Synchronization Busy Register */
\r
50 } RTC_TypeDef; /** @} */
\r
52 /**************************************************************************//**
\r
53 * @defgroup EFM32WG_RTC_BitFields
\r
55 *****************************************************************************/
\r
57 /* Bit fields for RTC CTRL */
\r
58 #define _RTC_CTRL_RESETVALUE 0x00000000UL /**< Default value for RTC_CTRL */
\r
59 #define _RTC_CTRL_MASK 0x00000007UL /**< Mask for RTC_CTRL */
\r
60 #define RTC_CTRL_EN (0x1UL << 0) /**< RTC Enable */
\r
61 #define _RTC_CTRL_EN_SHIFT 0 /**< Shift value for RTC_EN */
\r
62 #define _RTC_CTRL_EN_MASK 0x1UL /**< Bit mask for RTC_EN */
\r
63 #define _RTC_CTRL_EN_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_CTRL */
\r
64 #define RTC_CTRL_EN_DEFAULT (_RTC_CTRL_EN_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_CTRL */
\r
65 #define RTC_CTRL_DEBUGRUN (0x1UL << 1) /**< Debug Mode Run Enable */
\r
66 #define _RTC_CTRL_DEBUGRUN_SHIFT 1 /**< Shift value for RTC_DEBUGRUN */
\r
67 #define _RTC_CTRL_DEBUGRUN_MASK 0x2UL /**< Bit mask for RTC_DEBUGRUN */
\r
68 #define _RTC_CTRL_DEBUGRUN_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_CTRL */
\r
69 #define RTC_CTRL_DEBUGRUN_DEFAULT (_RTC_CTRL_DEBUGRUN_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_CTRL */
\r
70 #define RTC_CTRL_COMP0TOP (0x1UL << 2) /**< Compare Channel 0 is Top Value */
\r
71 #define _RTC_CTRL_COMP0TOP_SHIFT 2 /**< Shift value for RTC_COMP0TOP */
\r
72 #define _RTC_CTRL_COMP0TOP_MASK 0x4UL /**< Bit mask for RTC_COMP0TOP */
\r
73 #define _RTC_CTRL_COMP0TOP_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_CTRL */
\r
74 #define _RTC_CTRL_COMP0TOP_DISABLE 0x00000000UL /**< Mode DISABLE for RTC_CTRL */
\r
75 #define _RTC_CTRL_COMP0TOP_ENABLE 0x00000001UL /**< Mode ENABLE for RTC_CTRL */
\r
76 #define RTC_CTRL_COMP0TOP_DEFAULT (_RTC_CTRL_COMP0TOP_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_CTRL */
\r
77 #define RTC_CTRL_COMP0TOP_DISABLE (_RTC_CTRL_COMP0TOP_DISABLE << 2) /**< Shifted mode DISABLE for RTC_CTRL */
\r
78 #define RTC_CTRL_COMP0TOP_ENABLE (_RTC_CTRL_COMP0TOP_ENABLE << 2) /**< Shifted mode ENABLE for RTC_CTRL */
\r
80 /* Bit fields for RTC CNT */
\r
81 #define _RTC_CNT_RESETVALUE 0x00000000UL /**< Default value for RTC_CNT */
\r
82 #define _RTC_CNT_MASK 0x00FFFFFFUL /**< Mask for RTC_CNT */
\r
83 #define _RTC_CNT_CNT_SHIFT 0 /**< Shift value for RTC_CNT */
\r
84 #define _RTC_CNT_CNT_MASK 0xFFFFFFUL /**< Bit mask for RTC_CNT */
\r
85 #define _RTC_CNT_CNT_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_CNT */
\r
86 #define RTC_CNT_CNT_DEFAULT (_RTC_CNT_CNT_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_CNT */
\r
88 /* Bit fields for RTC COMP0 */
\r
89 #define _RTC_COMP0_RESETVALUE 0x00000000UL /**< Default value for RTC_COMP0 */
\r
90 #define _RTC_COMP0_MASK 0x00FFFFFFUL /**< Mask for RTC_COMP0 */
\r
91 #define _RTC_COMP0_COMP0_SHIFT 0 /**< Shift value for RTC_COMP0 */
\r
92 #define _RTC_COMP0_COMP0_MASK 0xFFFFFFUL /**< Bit mask for RTC_COMP0 */
\r
93 #define _RTC_COMP0_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_COMP0 */
\r
94 #define RTC_COMP0_COMP0_DEFAULT (_RTC_COMP0_COMP0_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_COMP0 */
\r
96 /* Bit fields for RTC COMP1 */
\r
97 #define _RTC_COMP1_RESETVALUE 0x00000000UL /**< Default value for RTC_COMP1 */
\r
98 #define _RTC_COMP1_MASK 0x00FFFFFFUL /**< Mask for RTC_COMP1 */
\r
99 #define _RTC_COMP1_COMP1_SHIFT 0 /**< Shift value for RTC_COMP1 */
\r
100 #define _RTC_COMP1_COMP1_MASK 0xFFFFFFUL /**< Bit mask for RTC_COMP1 */
\r
101 #define _RTC_COMP1_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_COMP1 */
\r
102 #define RTC_COMP1_COMP1_DEFAULT (_RTC_COMP1_COMP1_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_COMP1 */
\r
104 /* Bit fields for RTC IF */
\r
105 #define _RTC_IF_RESETVALUE 0x00000000UL /**< Default value for RTC_IF */
\r
106 #define _RTC_IF_MASK 0x00000007UL /**< Mask for RTC_IF */
\r
107 #define RTC_IF_OF (0x1UL << 0) /**< Overflow Interrupt Flag */
\r
108 #define _RTC_IF_OF_SHIFT 0 /**< Shift value for RTC_OF */
\r
109 #define _RTC_IF_OF_MASK 0x1UL /**< Bit mask for RTC_OF */
\r
110 #define _RTC_IF_OF_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IF */
\r
111 #define RTC_IF_OF_DEFAULT (_RTC_IF_OF_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_IF */
\r
112 #define RTC_IF_COMP0 (0x1UL << 1) /**< Compare Match 0 Interrupt Flag */
\r
113 #define _RTC_IF_COMP0_SHIFT 1 /**< Shift value for RTC_COMP0 */
\r
114 #define _RTC_IF_COMP0_MASK 0x2UL /**< Bit mask for RTC_COMP0 */
\r
115 #define _RTC_IF_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IF */
\r
116 #define RTC_IF_COMP0_DEFAULT (_RTC_IF_COMP0_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_IF */
\r
117 #define RTC_IF_COMP1 (0x1UL << 2) /**< Compare Match 1 Interrupt Flag */
\r
118 #define _RTC_IF_COMP1_SHIFT 2 /**< Shift value for RTC_COMP1 */
\r
119 #define _RTC_IF_COMP1_MASK 0x4UL /**< Bit mask for RTC_COMP1 */
\r
120 #define _RTC_IF_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IF */
\r
121 #define RTC_IF_COMP1_DEFAULT (_RTC_IF_COMP1_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_IF */
\r
123 /* Bit fields for RTC IFS */
\r
124 #define _RTC_IFS_RESETVALUE 0x00000000UL /**< Default value for RTC_IFS */
\r
125 #define _RTC_IFS_MASK 0x00000007UL /**< Mask for RTC_IFS */
\r
126 #define RTC_IFS_OF (0x1UL << 0) /**< Set Overflow Interrupt Flag */
\r
127 #define _RTC_IFS_OF_SHIFT 0 /**< Shift value for RTC_OF */
\r
128 #define _RTC_IFS_OF_MASK 0x1UL /**< Bit mask for RTC_OF */
\r
129 #define _RTC_IFS_OF_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFS */
\r
130 #define RTC_IFS_OF_DEFAULT (_RTC_IFS_OF_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_IFS */
\r
131 #define RTC_IFS_COMP0 (0x1UL << 1) /**< Set Compare match 0 Interrupt Flag */
\r
132 #define _RTC_IFS_COMP0_SHIFT 1 /**< Shift value for RTC_COMP0 */
\r
133 #define _RTC_IFS_COMP0_MASK 0x2UL /**< Bit mask for RTC_COMP0 */
\r
134 #define _RTC_IFS_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFS */
\r
135 #define RTC_IFS_COMP0_DEFAULT (_RTC_IFS_COMP0_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_IFS */
\r
136 #define RTC_IFS_COMP1 (0x1UL << 2) /**< Set Compare match 1 Interrupt Flag */
\r
137 #define _RTC_IFS_COMP1_SHIFT 2 /**< Shift value for RTC_COMP1 */
\r
138 #define _RTC_IFS_COMP1_MASK 0x4UL /**< Bit mask for RTC_COMP1 */
\r
139 #define _RTC_IFS_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFS */
\r
140 #define RTC_IFS_COMP1_DEFAULT (_RTC_IFS_COMP1_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_IFS */
\r
142 /* Bit fields for RTC IFC */
\r
143 #define _RTC_IFC_RESETVALUE 0x00000000UL /**< Default value for RTC_IFC */
\r
144 #define _RTC_IFC_MASK 0x00000007UL /**< Mask for RTC_IFC */
\r
145 #define RTC_IFC_OF (0x1UL << 0) /**< Clear Overflow Interrupt Flag */
\r
146 #define _RTC_IFC_OF_SHIFT 0 /**< Shift value for RTC_OF */
\r
147 #define _RTC_IFC_OF_MASK 0x1UL /**< Bit mask for RTC_OF */
\r
148 #define _RTC_IFC_OF_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFC */
\r
149 #define RTC_IFC_OF_DEFAULT (_RTC_IFC_OF_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_IFC */
\r
150 #define RTC_IFC_COMP0 (0x1UL << 1) /**< Clear Compare match 0 Interrupt Flag */
\r
151 #define _RTC_IFC_COMP0_SHIFT 1 /**< Shift value for RTC_COMP0 */
\r
152 #define _RTC_IFC_COMP0_MASK 0x2UL /**< Bit mask for RTC_COMP0 */
\r
153 #define _RTC_IFC_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFC */
\r
154 #define RTC_IFC_COMP0_DEFAULT (_RTC_IFC_COMP0_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_IFC */
\r
155 #define RTC_IFC_COMP1 (0x1UL << 2) /**< Clear Compare match 1 Interrupt Flag */
\r
156 #define _RTC_IFC_COMP1_SHIFT 2 /**< Shift value for RTC_COMP1 */
\r
157 #define _RTC_IFC_COMP1_MASK 0x4UL /**< Bit mask for RTC_COMP1 */
\r
158 #define _RTC_IFC_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IFC */
\r
159 #define RTC_IFC_COMP1_DEFAULT (_RTC_IFC_COMP1_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_IFC */
\r
161 /* Bit fields for RTC IEN */
\r
162 #define _RTC_IEN_RESETVALUE 0x00000000UL /**< Default value for RTC_IEN */
\r
163 #define _RTC_IEN_MASK 0x00000007UL /**< Mask for RTC_IEN */
\r
164 #define RTC_IEN_OF (0x1UL << 0) /**< Overflow Interrupt Enable */
\r
165 #define _RTC_IEN_OF_SHIFT 0 /**< Shift value for RTC_OF */
\r
166 #define _RTC_IEN_OF_MASK 0x1UL /**< Bit mask for RTC_OF */
\r
167 #define _RTC_IEN_OF_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IEN */
\r
168 #define RTC_IEN_OF_DEFAULT (_RTC_IEN_OF_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_IEN */
\r
169 #define RTC_IEN_COMP0 (0x1UL << 1) /**< Compare Match 0 Interrupt Enable */
\r
170 #define _RTC_IEN_COMP0_SHIFT 1 /**< Shift value for RTC_COMP0 */
\r
171 #define _RTC_IEN_COMP0_MASK 0x2UL /**< Bit mask for RTC_COMP0 */
\r
172 #define _RTC_IEN_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IEN */
\r
173 #define RTC_IEN_COMP0_DEFAULT (_RTC_IEN_COMP0_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_IEN */
\r
174 #define RTC_IEN_COMP1 (0x1UL << 2) /**< Compare Match 1 Interrupt Enable */
\r
175 #define _RTC_IEN_COMP1_SHIFT 2 /**< Shift value for RTC_COMP1 */
\r
176 #define _RTC_IEN_COMP1_MASK 0x4UL /**< Bit mask for RTC_COMP1 */
\r
177 #define _RTC_IEN_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_IEN */
\r
178 #define RTC_IEN_COMP1_DEFAULT (_RTC_IEN_COMP1_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_IEN */
\r
180 /* Bit fields for RTC FREEZE */
\r
181 #define _RTC_FREEZE_RESETVALUE 0x00000000UL /**< Default value for RTC_FREEZE */
\r
182 #define _RTC_FREEZE_MASK 0x00000001UL /**< Mask for RTC_FREEZE */
\r
183 #define RTC_FREEZE_REGFREEZE (0x1UL << 0) /**< Register Update Freeze */
\r
184 #define _RTC_FREEZE_REGFREEZE_SHIFT 0 /**< Shift value for RTC_REGFREEZE */
\r
185 #define _RTC_FREEZE_REGFREEZE_MASK 0x1UL /**< Bit mask for RTC_REGFREEZE */
\r
186 #define _RTC_FREEZE_REGFREEZE_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_FREEZE */
\r
187 #define _RTC_FREEZE_REGFREEZE_UPDATE 0x00000000UL /**< Mode UPDATE for RTC_FREEZE */
\r
188 #define _RTC_FREEZE_REGFREEZE_FREEZE 0x00000001UL /**< Mode FREEZE for RTC_FREEZE */
\r
189 #define RTC_FREEZE_REGFREEZE_DEFAULT (_RTC_FREEZE_REGFREEZE_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_FREEZE */
\r
190 #define RTC_FREEZE_REGFREEZE_UPDATE (_RTC_FREEZE_REGFREEZE_UPDATE << 0) /**< Shifted mode UPDATE for RTC_FREEZE */
\r
191 #define RTC_FREEZE_REGFREEZE_FREEZE (_RTC_FREEZE_REGFREEZE_FREEZE << 0) /**< Shifted mode FREEZE for RTC_FREEZE */
\r
193 /* Bit fields for RTC SYNCBUSY */
\r
194 #define _RTC_SYNCBUSY_RESETVALUE 0x00000000UL /**< Default value for RTC_SYNCBUSY */
\r
195 #define _RTC_SYNCBUSY_MASK 0x00000007UL /**< Mask for RTC_SYNCBUSY */
\r
196 #define RTC_SYNCBUSY_CTRL (0x1UL << 0) /**< CTRL Register Busy */
\r
197 #define _RTC_SYNCBUSY_CTRL_SHIFT 0 /**< Shift value for RTC_CTRL */
\r
198 #define _RTC_SYNCBUSY_CTRL_MASK 0x1UL /**< Bit mask for RTC_CTRL */
\r
199 #define _RTC_SYNCBUSY_CTRL_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_SYNCBUSY */
\r
200 #define RTC_SYNCBUSY_CTRL_DEFAULT (_RTC_SYNCBUSY_CTRL_DEFAULT << 0) /**< Shifted mode DEFAULT for RTC_SYNCBUSY */
\r
201 #define RTC_SYNCBUSY_COMP0 (0x1UL << 1) /**< COMP0 Register Busy */
\r
202 #define _RTC_SYNCBUSY_COMP0_SHIFT 1 /**< Shift value for RTC_COMP0 */
\r
203 #define _RTC_SYNCBUSY_COMP0_MASK 0x2UL /**< Bit mask for RTC_COMP0 */
\r
204 #define _RTC_SYNCBUSY_COMP0_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_SYNCBUSY */
\r
205 #define RTC_SYNCBUSY_COMP0_DEFAULT (_RTC_SYNCBUSY_COMP0_DEFAULT << 1) /**< Shifted mode DEFAULT for RTC_SYNCBUSY */
\r
206 #define RTC_SYNCBUSY_COMP1 (0x1UL << 2) /**< COMP1 Register Busy */
\r
207 #define _RTC_SYNCBUSY_COMP1_SHIFT 2 /**< Shift value for RTC_COMP1 */
\r
208 #define _RTC_SYNCBUSY_COMP1_MASK 0x4UL /**< Bit mask for RTC_COMP1 */
\r
209 #define _RTC_SYNCBUSY_COMP1_DEFAULT 0x00000000UL /**< Mode DEFAULT for RTC_SYNCBUSY */
\r
210 #define RTC_SYNCBUSY_COMP1_DEFAULT (_RTC_SYNCBUSY_COMP1_DEFAULT << 2) /**< Shifted mode DEFAULT for RTC_SYNCBUSY */
\r
212 /** @} End of group EFM32WG_RTC */
\r