MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
rtc_regs.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  *
38  *************************************************************************** */
39 
40 #ifndef _RTC_REGS_H_
41 #define _RTC_REGS_H_
42 
43 /* **** Includes **** */
44 #include <stdint.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #if defined (__ICCARM__)
51  #pragma system_include
52 #endif
53 
54 #if defined (__CC_ARM)
55  #pragma anon_unions
56 #endif
57 /*
59  If types are not defined elsewhere (CMSIS) define them here
60 */
61 #ifndef __IO
62 #define __IO volatile
63 #endif
64 #ifndef __I
65 #define __I volatile const
66 #endif
67 #ifndef __O
68 #define __O volatile
69 #endif
70 #ifndef __R
71 #define __R volatile const
72 #endif
73 
75 /* **** Definitions **** */
76 
88 typedef struct {
89  __IO uint32_t sec;
90  __IO uint32_t ssec;
91  __IO uint32_t toda;
92  __IO uint32_t sseca;
93  __IO uint32_t ctrl;
94  __IO uint32_t trim;
95  __IO uint32_t oscctrl;
97 
98 /* Register offsets for module RTC */
105  #define MXC_R_RTC_SEC ((uint32_t)0x00000000UL)
106  #define MXC_R_RTC_SSEC ((uint32_t)0x00000004UL)
107  #define MXC_R_RTC_TODA ((uint32_t)0x00000008UL)
108  #define MXC_R_RTC_SSECA ((uint32_t)0x0000000CUL)
109  #define MXC_R_RTC_CTRL ((uint32_t)0x00000010UL)
110  #define MXC_R_RTC_TRIM ((uint32_t)0x00000014UL)
111  #define MXC_R_RTC_OSCCTRL ((uint32_t)0x00000018UL)
120  #define MXC_F_RTC_SEC_SEC_POS 0
121  #define MXC_F_RTC_SEC_SEC ((uint32_t)(0xFFUL << MXC_F_RTC_SEC_SEC_POS))
132  #define MXC_F_RTC_SSEC_SSEC_POS 0
133  #define MXC_F_RTC_SSEC_SSEC ((uint32_t)(0xFFUL << MXC_F_RTC_SSEC_SSEC_POS))
143  #define MXC_F_RTC_TODA_TOD_ALARM_POS 0
144  #define MXC_F_RTC_TODA_TOD_ALARM ((uint32_t)(0xFFFFFUL << MXC_F_RTC_TODA_TOD_ALARM_POS))
155  #define MXC_F_RTC_SSECA_SSEC_ALARM_POS 0
156  #define MXC_F_RTC_SSECA_SSEC_ALARM ((uint32_t)(0xFFFFFFFFUL << MXC_F_RTC_SSECA_SSEC_ALARM_POS))
166  #define MXC_F_RTC_CTRL_EN_POS 0
167  #define MXC_F_RTC_CTRL_EN ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_EN_POS))
169  #define MXC_F_RTC_CTRL_TOD_ALARM_IE_POS 1
170  #define MXC_F_RTC_CTRL_TOD_ALARM_IE ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_TOD_ALARM_IE_POS))
172  #define MXC_F_RTC_CTRL_SSEC_ALARM_IE_POS 2
173  #define MXC_F_RTC_CTRL_SSEC_ALARM_IE ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_SSEC_ALARM_IE_POS))
175  #define MXC_F_RTC_CTRL_BUSY_POS 3
176  #define MXC_F_RTC_CTRL_BUSY ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_BUSY_POS))
178  #define MXC_F_RTC_CTRL_RDY_POS 4
179  #define MXC_F_RTC_CTRL_RDY ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_RDY_POS))
181  #define MXC_F_RTC_CTRL_RDY_IE_POS 5
182  #define MXC_F_RTC_CTRL_RDY_IE ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_RDY_IE_POS))
184  #define MXC_F_RTC_CTRL_TOD_ALARM_POS 6
185  #define MXC_F_RTC_CTRL_TOD_ALARM ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_TOD_ALARM_POS))
187  #define MXC_F_RTC_CTRL_SSEC_ALARM_POS 7
188  #define MXC_F_RTC_CTRL_SSEC_ALARM ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_SSEC_ALARM_POS))
190  #define MXC_F_RTC_CTRL_SQW_EN_POS 8
191  #define MXC_F_RTC_CTRL_SQW_EN ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_SQW_EN_POS))
193  #define MXC_F_RTC_CTRL_SQW_SEL_POS 9
194  #define MXC_F_RTC_CTRL_SQW_SEL ((uint32_t)(0x3UL << MXC_F_RTC_CTRL_SQW_SEL_POS))
195  #define MXC_V_RTC_CTRL_SQW_SEL_FREQ1HZ ((uint32_t)0x0UL)
196  #define MXC_S_RTC_CTRL_SQW_SEL_FREQ1HZ (MXC_V_RTC_CTRL_SQW_SEL_FREQ1HZ << MXC_F_RTC_CTRL_SQW_SEL_POS)
197  #define MXC_V_RTC_CTRL_SQW_SEL_FREQ512HZ ((uint32_t)0x1UL)
198  #define MXC_S_RTC_CTRL_SQW_SEL_FREQ512HZ (MXC_V_RTC_CTRL_SQW_SEL_FREQ512HZ << MXC_F_RTC_CTRL_SQW_SEL_POS)
199  #define MXC_V_RTC_CTRL_SQW_SEL_FREQ4KHZ ((uint32_t)0x2UL)
200  #define MXC_S_RTC_CTRL_SQW_SEL_FREQ4KHZ (MXC_V_RTC_CTRL_SQW_SEL_FREQ4KHZ << MXC_F_RTC_CTRL_SQW_SEL_POS)
201  #define MXC_V_RTC_CTRL_SQW_SEL_CLKDIV8 ((uint32_t)0x3UL)
202  #define MXC_S_RTC_CTRL_SQW_SEL_CLKDIV8 (MXC_V_RTC_CTRL_SQW_SEL_CLKDIV8 << MXC_F_RTC_CTRL_SQW_SEL_POS)
204  #define MXC_F_RTC_CTRL_RD_EN_POS 14
205  #define MXC_F_RTC_CTRL_RD_EN ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_RD_EN_POS))
207  #define MXC_F_RTC_CTRL_WR_EN_POS 15
208  #define MXC_F_RTC_CTRL_WR_EN ((uint32_t)(0x1UL << MXC_F_RTC_CTRL_WR_EN_POS))
218  #define MXC_F_RTC_TRIM_TRIM_POS 0
219  #define MXC_F_RTC_TRIM_TRIM ((uint32_t)(0xFFUL << MXC_F_RTC_TRIM_TRIM_POS))
221  #define MXC_F_RTC_TRIM_VRTC_TMR_POS 8
222  #define MXC_F_RTC_TRIM_VRTC_TMR ((uint32_t)(0xFFFFFFUL << MXC_F_RTC_TRIM_VRTC_TMR_POS))
232  #define MXC_F_RTC_OSCCTRL_BYPASS_POS 4
233  #define MXC_F_RTC_OSCCTRL_BYPASS ((uint32_t)(0x1UL << MXC_F_RTC_OSCCTRL_BYPASS_POS))
235  #define MXC_F_RTC_OSCCTRL_SQW_32K_POS 5
236  #define MXC_F_RTC_OSCCTRL_SQW_32K ((uint32_t)(0x1UL << MXC_F_RTC_OSCCTRL_SQW_32K_POS))
240 #ifdef __cplusplus
241 }
242 #endif
243 
244 #endif /* _RTC_REGS_H_ */
mxc_rtc_regs_t::sec
__IO uint32_t sec
Definition: rtc_regs.h:89
mxc_rtc_regs_t::ssec
__IO uint32_t ssec
Definition: rtc_regs.h:90
mxc_rtc_regs_t
Definition: rtc_regs.h:88
mxc_rtc_regs_t::oscctrl
__IO uint32_t oscctrl
Definition: rtc_regs.h:95
mxc_rtc_regs_t::sseca
__IO uint32_t sseca
Definition: rtc_regs.h:92
mxc_rtc_regs_t::toda
__IO uint32_t toda
Definition: rtc_regs.h:91
mxc_rtc_regs_t::ctrl
__IO uint32_t ctrl
Definition: rtc_regs.h:93
mxc_rtc_regs_t::trim
__IO uint32_t trim
Definition: rtc_regs.h:94