1 /**************************************************************************//**
2  * @file
3  * @brief EFR32MG24 DPLL register and bit field definitions
4  ******************************************************************************
5  * # License
6  * <b>Copyright 2022 Silicon Laboratories, Inc. www.silabs.com</b>
7  ******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  *****************************************************************************/
30 #ifndef EFR32MG24_DPLL_H
31 #define EFR32MG24_DPLL_H
32 #define DPLL_HAS_SET_CLEAR
33 
34 /**************************************************************************//**
35 * @addtogroup Parts
36 * @{
37 ******************************************************************************/
38 /**************************************************************************//**
39  * @defgroup EFR32MG24_DPLL DPLL
40  * @{
41  * @brief EFR32MG24 DPLL Register Declaration.
42  *****************************************************************************/
43 
44 /** DPLL Register Declaration. */
45 typedef struct {
46   __IM uint32_t  IPVERSION;                     /**< IP Version                                         */
47   __IOM uint32_t EN;                            /**< Enable                                             */
48   __IOM uint32_t CFG;                           /**< Config                                             */
49   __IOM uint32_t CFG1;                          /**< Config1                                            */
50   __IOM uint32_t IF;                            /**< Interrupt Flag                                     */
51   __IOM uint32_t IEN;                           /**< Interrupt Enable                                   */
52   __IM uint32_t  STATUS;                        /**< Status                                             */
53   uint32_t       RESERVED0[2U];                 /**< Reserved for future use                            */
54   __IOM uint32_t LOCK;                          /**< Lock                                               */
55   uint32_t       RESERVED1[1014U];              /**< Reserved for future use                            */
56   __IM uint32_t  IPVERSION_SET;                 /**< IP Version                                         */
57   __IOM uint32_t EN_SET;                        /**< Enable                                             */
58   __IOM uint32_t CFG_SET;                       /**< Config                                             */
59   __IOM uint32_t CFG1_SET;                      /**< Config1                                            */
60   __IOM uint32_t IF_SET;                        /**< Interrupt Flag                                     */
61   __IOM uint32_t IEN_SET;                       /**< Interrupt Enable                                   */
62   __IM uint32_t  STATUS_SET;                    /**< Status                                             */
63   uint32_t       RESERVED2[2U];                 /**< Reserved for future use                            */
64   __IOM uint32_t LOCK_SET;                      /**< Lock                                               */
65   uint32_t       RESERVED3[1014U];              /**< Reserved for future use                            */
66   __IM uint32_t  IPVERSION_CLR;                 /**< IP Version                                         */
67   __IOM uint32_t EN_CLR;                        /**< Enable                                             */
68   __IOM uint32_t CFG_CLR;                       /**< Config                                             */
69   __IOM uint32_t CFG1_CLR;                      /**< Config1                                            */
70   __IOM uint32_t IF_CLR;                        /**< Interrupt Flag                                     */
71   __IOM uint32_t IEN_CLR;                       /**< Interrupt Enable                                   */
72   __IM uint32_t  STATUS_CLR;                    /**< Status                                             */
73   uint32_t       RESERVED4[2U];                 /**< Reserved for future use                            */
74   __IOM uint32_t LOCK_CLR;                      /**< Lock                                               */
75   uint32_t       RESERVED5[1014U];              /**< Reserved for future use                            */
76   __IM uint32_t  IPVERSION_TGL;                 /**< IP Version                                         */
77   __IOM uint32_t EN_TGL;                        /**< Enable                                             */
78   __IOM uint32_t CFG_TGL;                       /**< Config                                             */
79   __IOM uint32_t CFG1_TGL;                      /**< Config1                                            */
80   __IOM uint32_t IF_TGL;                        /**< Interrupt Flag                                     */
81   __IOM uint32_t IEN_TGL;                       /**< Interrupt Enable                                   */
82   __IM uint32_t  STATUS_TGL;                    /**< Status                                             */
83   uint32_t       RESERVED6[2U];                 /**< Reserved for future use                            */
84   __IOM uint32_t LOCK_TGL;                      /**< Lock                                               */
85 } DPLL_TypeDef;
86 /** @} End of group EFR32MG24_DPLL */
87 
88 /**************************************************************************//**
89  * @addtogroup EFR32MG24_DPLL
90  * @{
91  * @defgroup EFR32MG24_DPLL_BitFields DPLL Bit Fields
92  * @{
93  *****************************************************************************/
94 
95 /* Bit fields for DPLL IPVERSION */
96 #define _DPLL_IPVERSION_RESETVALUE           0x00000001UL                               /**< Default value for DPLL_IPVERSION            */
97 #define _DPLL_IPVERSION_MASK                 0xFFFFFFFFUL                               /**< Mask for DPLL_IPVERSION                     */
98 #define _DPLL_IPVERSION_IPVERSION_SHIFT      0                                          /**< Shift value for DPLL_IPVERSION              */
99 #define _DPLL_IPVERSION_IPVERSION_MASK       0xFFFFFFFFUL                               /**< Bit mask for DPLL_IPVERSION                 */
100 #define _DPLL_IPVERSION_IPVERSION_DEFAULT    0x00000001UL                               /**< Mode DEFAULT for DPLL_IPVERSION             */
101 #define DPLL_IPVERSION_IPVERSION_DEFAULT     (_DPLL_IPVERSION_IPVERSION_DEFAULT << 0)   /**< Shifted mode DEFAULT for DPLL_IPVERSION     */
102 
103 /* Bit fields for DPLL EN */
104 #define _DPLL_EN_RESETVALUE                  0x00000000UL                               /**< Default value for DPLL_EN                   */
105 #define _DPLL_EN_MASK                        0x00000003UL                               /**< Mask for DPLL_EN                            */
106 #define DPLL_EN_EN                           (0x1UL << 0)                               /**< Module Enable                               */
107 #define _DPLL_EN_EN_SHIFT                    0                                          /**< Shift value for DPLL_EN                     */
108 #define _DPLL_EN_EN_MASK                     0x1UL                                      /**< Bit mask for DPLL_EN                        */
109 #define _DPLL_EN_EN_DEFAULT                  0x00000000UL                               /**< Mode DEFAULT for DPLL_EN                    */
110 #define DPLL_EN_EN_DEFAULT                   (_DPLL_EN_EN_DEFAULT << 0)                 /**< Shifted mode DEFAULT for DPLL_EN            */
111 #define DPLL_EN_DISABLING                    (0x1UL << 1)                               /**< Disablement Busy Status                     */
112 #define _DPLL_EN_DISABLING_SHIFT             1                                          /**< Shift value for DPLL_DISABLING              */
113 #define _DPLL_EN_DISABLING_MASK              0x2UL                                      /**< Bit mask for DPLL_DISABLING                 */
114 #define _DPLL_EN_DISABLING_DEFAULT           0x00000000UL                               /**< Mode DEFAULT for DPLL_EN                    */
115 #define DPLL_EN_DISABLING_DEFAULT            (_DPLL_EN_DISABLING_DEFAULT << 1)          /**< Shifted mode DEFAULT for DPLL_EN            */
116 
117 /* Bit fields for DPLL CFG */
118 #define _DPLL_CFG_RESETVALUE                 0x00000000UL                               /**< Default value for DPLL_CFG                  */
119 #define _DPLL_CFG_MASK                       0x00000047UL                               /**< Mask for DPLL_CFG                           */
120 #define DPLL_CFG_MODE                        (0x1UL << 0)                               /**< Operating Mode Control                      */
121 #define _DPLL_CFG_MODE_SHIFT                 0                                          /**< Shift value for DPLL_MODE                   */
122 #define _DPLL_CFG_MODE_MASK                  0x1UL                                      /**< Bit mask for DPLL_MODE                      */
123 #define _DPLL_CFG_MODE_DEFAULT               0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG                   */
124 #define _DPLL_CFG_MODE_FLL                   0x00000000UL                               /**< Mode FLL for DPLL_CFG                       */
125 #define _DPLL_CFG_MODE_PLL                   0x00000001UL                               /**< Mode PLL for DPLL_CFG                       */
126 #define DPLL_CFG_MODE_DEFAULT                (_DPLL_CFG_MODE_DEFAULT << 0)              /**< Shifted mode DEFAULT for DPLL_CFG           */
127 #define DPLL_CFG_MODE_FLL                    (_DPLL_CFG_MODE_FLL << 0)                  /**< Shifted mode FLL for DPLL_CFG               */
128 #define DPLL_CFG_MODE_PLL                    (_DPLL_CFG_MODE_PLL << 0)                  /**< Shifted mode PLL for DPLL_CFG               */
129 #define DPLL_CFG_EDGESEL                     (0x1UL << 1)                               /**< Reference Edge Select                       */
130 #define _DPLL_CFG_EDGESEL_SHIFT              1                                          /**< Shift value for DPLL_EDGESEL                */
131 #define _DPLL_CFG_EDGESEL_MASK               0x2UL                                      /**< Bit mask for DPLL_EDGESEL                   */
132 #define _DPLL_CFG_EDGESEL_DEFAULT            0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG                   */
133 #define DPLL_CFG_EDGESEL_DEFAULT             (_DPLL_CFG_EDGESEL_DEFAULT << 1)           /**< Shifted mode DEFAULT for DPLL_CFG           */
134 #define DPLL_CFG_AUTORECOVER                 (0x1UL << 2)                               /**< Automatic Recovery Control                  */
135 #define _DPLL_CFG_AUTORECOVER_SHIFT          2                                          /**< Shift value for DPLL_AUTORECOVER            */
136 #define _DPLL_CFG_AUTORECOVER_MASK           0x4UL                                      /**< Bit mask for DPLL_AUTORECOVER               */
137 #define _DPLL_CFG_AUTORECOVER_DEFAULT        0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG                   */
138 #define DPLL_CFG_AUTORECOVER_DEFAULT         (_DPLL_CFG_AUTORECOVER_DEFAULT << 2)       /**< Shifted mode DEFAULT for DPLL_CFG           */
139 #define DPLL_CFG_DITHEN                      (0x1UL << 6)                               /**< Dither Enable Control                       */
140 #define _DPLL_CFG_DITHEN_SHIFT               6                                          /**< Shift value for DPLL_DITHEN                 */
141 #define _DPLL_CFG_DITHEN_MASK                0x40UL                                     /**< Bit mask for DPLL_DITHEN                    */
142 #define _DPLL_CFG_DITHEN_DEFAULT             0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG                   */
143 #define DPLL_CFG_DITHEN_DEFAULT              (_DPLL_CFG_DITHEN_DEFAULT << 6)            /**< Shifted mode DEFAULT for DPLL_CFG           */
144 
145 /* Bit fields for DPLL CFG1 */
146 #define _DPLL_CFG1_RESETVALUE                0x00000000UL                               /**< Default value for DPLL_CFG1                 */
147 #define _DPLL_CFG1_MASK                      0x0FFF0FFFUL                               /**< Mask for DPLL_CFG1                          */
148 #define _DPLL_CFG1_M_SHIFT                   0                                          /**< Shift value for DPLL_M                      */
149 #define _DPLL_CFG1_M_MASK                    0xFFFUL                                    /**< Bit mask for DPLL_M                         */
150 #define _DPLL_CFG1_M_DEFAULT                 0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG1                  */
151 #define DPLL_CFG1_M_DEFAULT                  (_DPLL_CFG1_M_DEFAULT << 0)                /**< Shifted mode DEFAULT for DPLL_CFG1          */
152 #define _DPLL_CFG1_N_SHIFT                   16                                         /**< Shift value for DPLL_N                      */
153 #define _DPLL_CFG1_N_MASK                    0xFFF0000UL                                /**< Bit mask for DPLL_N                         */
154 #define _DPLL_CFG1_N_DEFAULT                 0x00000000UL                               /**< Mode DEFAULT for DPLL_CFG1                  */
155 #define DPLL_CFG1_N_DEFAULT                  (_DPLL_CFG1_N_DEFAULT << 16)               /**< Shifted mode DEFAULT for DPLL_CFG1          */
156 
157 /* Bit fields for DPLL IF */
158 #define _DPLL_IF_RESETVALUE                  0x00000000UL                               /**< Default value for DPLL_IF                   */
159 #define _DPLL_IF_MASK                        0x00000007UL                               /**< Mask for DPLL_IF                            */
160 #define DPLL_IF_LOCK                         (0x1UL << 0)                               /**< Lock Interrupt Flag                         */
161 #define _DPLL_IF_LOCK_SHIFT                  0                                          /**< Shift value for DPLL_LOCK                   */
162 #define _DPLL_IF_LOCK_MASK                   0x1UL                                      /**< Bit mask for DPLL_LOCK                      */
163 #define _DPLL_IF_LOCK_DEFAULT                0x00000000UL                               /**< Mode DEFAULT for DPLL_IF                    */
164 #define DPLL_IF_LOCK_DEFAULT                 (_DPLL_IF_LOCK_DEFAULT << 0)               /**< Shifted mode DEFAULT for DPLL_IF            */
165 #define DPLL_IF_LOCKFAILLOW                  (0x1UL << 1)                               /**< Lock Failure Low Interrupt Flag             */
166 #define _DPLL_IF_LOCKFAILLOW_SHIFT           1                                          /**< Shift value for DPLL_LOCKFAILLOW            */
167 #define _DPLL_IF_LOCKFAILLOW_MASK            0x2UL                                      /**< Bit mask for DPLL_LOCKFAILLOW               */
168 #define _DPLL_IF_LOCKFAILLOW_DEFAULT         0x00000000UL                               /**< Mode DEFAULT for DPLL_IF                    */
169 #define DPLL_IF_LOCKFAILLOW_DEFAULT          (_DPLL_IF_LOCKFAILLOW_DEFAULT << 1)        /**< Shifted mode DEFAULT for DPLL_IF            */
170 #define DPLL_IF_LOCKFAILHIGH                 (0x1UL << 2)                               /**< Lock Failure High Interrupt Flag            */
171 #define _DPLL_IF_LOCKFAILHIGH_SHIFT          2                                          /**< Shift value for DPLL_LOCKFAILHIGH           */
172 #define _DPLL_IF_LOCKFAILHIGH_MASK           0x4UL                                      /**< Bit mask for DPLL_LOCKFAILHIGH              */
173 #define _DPLL_IF_LOCKFAILHIGH_DEFAULT        0x00000000UL                               /**< Mode DEFAULT for DPLL_IF                    */
174 #define DPLL_IF_LOCKFAILHIGH_DEFAULT         (_DPLL_IF_LOCKFAILHIGH_DEFAULT << 2)       /**< Shifted mode DEFAULT for DPLL_IF            */
175 
176 /* Bit fields for DPLL IEN */
177 #define _DPLL_IEN_RESETVALUE                 0x00000000UL                               /**< Default value for DPLL_IEN                  */
178 #define _DPLL_IEN_MASK                       0x00000007UL                               /**< Mask for DPLL_IEN                           */
179 #define DPLL_IEN_LOCK                        (0x1UL << 0)                               /**< LOCK interrupt Enable                       */
180 #define _DPLL_IEN_LOCK_SHIFT                 0                                          /**< Shift value for DPLL_LOCK                   */
181 #define _DPLL_IEN_LOCK_MASK                  0x1UL                                      /**< Bit mask for DPLL_LOCK                      */
182 #define _DPLL_IEN_LOCK_DEFAULT               0x00000000UL                               /**< Mode DEFAULT for DPLL_IEN                   */
183 #define DPLL_IEN_LOCK_DEFAULT                (_DPLL_IEN_LOCK_DEFAULT << 0)              /**< Shifted mode DEFAULT for DPLL_IEN           */
184 #define DPLL_IEN_LOCKFAILLOW                 (0x1UL << 1)                               /**< LOCKFAILLOW Interrupe Enable                */
185 #define _DPLL_IEN_LOCKFAILLOW_SHIFT          1                                          /**< Shift value for DPLL_LOCKFAILLOW            */
186 #define _DPLL_IEN_LOCKFAILLOW_MASK           0x2UL                                      /**< Bit mask for DPLL_LOCKFAILLOW               */
187 #define _DPLL_IEN_LOCKFAILLOW_DEFAULT        0x00000000UL                               /**< Mode DEFAULT for DPLL_IEN                   */
188 #define DPLL_IEN_LOCKFAILLOW_DEFAULT         (_DPLL_IEN_LOCKFAILLOW_DEFAULT << 1)       /**< Shifted mode DEFAULT for DPLL_IEN           */
189 #define DPLL_IEN_LOCKFAILHIGH                (0x1UL << 2)                               /**< LOCKFAILHIGH Interrupt Enable               */
190 #define _DPLL_IEN_LOCKFAILHIGH_SHIFT         2                                          /**< Shift value for DPLL_LOCKFAILHIGH           */
191 #define _DPLL_IEN_LOCKFAILHIGH_MASK          0x4UL                                      /**< Bit mask for DPLL_LOCKFAILHIGH              */
192 #define _DPLL_IEN_LOCKFAILHIGH_DEFAULT       0x00000000UL                               /**< Mode DEFAULT for DPLL_IEN                   */
193 #define DPLL_IEN_LOCKFAILHIGH_DEFAULT        (_DPLL_IEN_LOCKFAILHIGH_DEFAULT << 2)      /**< Shifted mode DEFAULT for DPLL_IEN           */
194 
195 /* Bit fields for DPLL STATUS */
196 #define _DPLL_STATUS_RESETVALUE              0x00000000UL                               /**< Default value for DPLL_STATUS               */
197 #define _DPLL_STATUS_MASK                    0x80000003UL                               /**< Mask for DPLL_STATUS                        */
198 #define DPLL_STATUS_RDY                      (0x1UL << 0)                               /**< Ready Status                                */
199 #define _DPLL_STATUS_RDY_SHIFT               0                                          /**< Shift value for DPLL_RDY                    */
200 #define _DPLL_STATUS_RDY_MASK                0x1UL                                      /**< Bit mask for DPLL_RDY                       */
201 #define _DPLL_STATUS_RDY_DEFAULT             0x00000000UL                               /**< Mode DEFAULT for DPLL_STATUS                */
202 #define DPLL_STATUS_RDY_DEFAULT              (_DPLL_STATUS_RDY_DEFAULT << 0)            /**< Shifted mode DEFAULT for DPLL_STATUS        */
203 #define DPLL_STATUS_ENS                      (0x1UL << 1)                               /**< Enable Status                               */
204 #define _DPLL_STATUS_ENS_SHIFT               1                                          /**< Shift value for DPLL_ENS                    */
205 #define _DPLL_STATUS_ENS_MASK                0x2UL                                      /**< Bit mask for DPLL_ENS                       */
206 #define _DPLL_STATUS_ENS_DEFAULT             0x00000000UL                               /**< Mode DEFAULT for DPLL_STATUS                */
207 #define DPLL_STATUS_ENS_DEFAULT              (_DPLL_STATUS_ENS_DEFAULT << 1)            /**< Shifted mode DEFAULT for DPLL_STATUS        */
208 #define DPLL_STATUS_LOCK                     (0x1UL << 31)                              /**< Lock Status                                 */
209 #define _DPLL_STATUS_LOCK_SHIFT              31                                         /**< Shift value for DPLL_LOCK                   */
210 #define _DPLL_STATUS_LOCK_MASK               0x80000000UL                               /**< Bit mask for DPLL_LOCK                      */
211 #define _DPLL_STATUS_LOCK_DEFAULT            0x00000000UL                               /**< Mode DEFAULT for DPLL_STATUS                */
212 #define _DPLL_STATUS_LOCK_UNLOCKED           0x00000000UL                               /**< Mode UNLOCKED for DPLL_STATUS               */
213 #define _DPLL_STATUS_LOCK_LOCKED             0x00000001UL                               /**< Mode LOCKED for DPLL_STATUS                 */
214 #define DPLL_STATUS_LOCK_DEFAULT             (_DPLL_STATUS_LOCK_DEFAULT << 31)          /**< Shifted mode DEFAULT for DPLL_STATUS        */
215 #define DPLL_STATUS_LOCK_UNLOCKED            (_DPLL_STATUS_LOCK_UNLOCKED << 31)         /**< Shifted mode UNLOCKED for DPLL_STATUS       */
216 #define DPLL_STATUS_LOCK_LOCKED              (_DPLL_STATUS_LOCK_LOCKED << 31)           /**< Shifted mode LOCKED for DPLL_STATUS         */
217 
218 /* Bit fields for DPLL LOCK */
219 #define _DPLL_LOCK_RESETVALUE                0x00007102UL                               /**< Default value for DPLL_LOCK                 */
220 #define _DPLL_LOCK_MASK                      0x0000FFFFUL                               /**< Mask for DPLL_LOCK                          */
221 #define _DPLL_LOCK_LOCKKEY_SHIFT             0                                          /**< Shift value for DPLL_LOCKKEY                */
222 #define _DPLL_LOCK_LOCKKEY_MASK              0xFFFFUL                                   /**< Bit mask for DPLL_LOCKKEY                   */
223 #define _DPLL_LOCK_LOCKKEY_DEFAULT           0x00007102UL                               /**< Mode DEFAULT for DPLL_LOCK                  */
224 #define _DPLL_LOCK_LOCKKEY_UNLOCK            0x00007102UL                               /**< Mode UNLOCK for DPLL_LOCK                   */
225 #define DPLL_LOCK_LOCKKEY_DEFAULT            (_DPLL_LOCK_LOCKKEY_DEFAULT << 0)          /**< Shifted mode DEFAULT for DPLL_LOCK          */
226 #define DPLL_LOCK_LOCKKEY_UNLOCK             (_DPLL_LOCK_LOCKKEY_UNLOCK << 0)           /**< Shifted mode UNLOCK for DPLL_LOCK           */
227 
228 /** @} End of group EFR32MG24_DPLL_BitFields */
229 /** @} End of group EFR32MG24_DPLL */
230 /** @} End of group Parts */
231 
232 #endif /* EFR32MG24_DPLL_H */
233