1 /**
2  * @file    flc_regs.h
3  * @brief   Registers, Bit Masks and Bit Positions for the FLC Peripheral Module.
4  * @note    This file is @generated.
5  * @ingroup flc_registers
6  */
7 
8 /******************************************************************************
9  *
10  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
11  * Analog Devices, Inc.),
12  * Copyright (C) 2023-2024 Analog Devices, Inc.
13  *
14  * Licensed under the Apache License, Version 2.0 (the "License");
15  * you may not use this file except in compliance with the License.
16  * You may obtain a copy of the License at
17  *
18  *     http://www.apache.org/licenses/LICENSE-2.0
19  *
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an "AS IS" BASIS,
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  *
26  ******************************************************************************/
27 
28 #ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32660_INCLUDE_FLC_REGS_H_
29 #define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32660_INCLUDE_FLC_REGS_H_
30 
31 /* **** Includes **** */
32 #include <stdint.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #if defined (__ICCARM__)
39   #pragma system_include
40 #endif
41 
42 #if defined (__CC_ARM)
43   #pragma anon_unions
44 #endif
45 /// @cond
46 /*
47     If types are not defined elsewhere (CMSIS) define them here
48 */
49 #ifndef __IO
50 #define __IO volatile
51 #endif
52 #ifndef __I
53 #define __I  volatile const
54 #endif
55 #ifndef __O
56 #define __O  volatile
57 #endif
58 #ifndef __R
59 #define __R  volatile const
60 #endif
61 /// @endcond
62 
63 /* **** Definitions **** */
64 
65 /**
66  * @ingroup     flc
67  * @defgroup    flc_registers FLC_Registers
68  * @brief       Registers, Bit Masks and Bit Positions for the FLC Peripheral Module.
69  * @details     Flash Memory Control.
70  */
71 
72 /**
73  * @ingroup flc_registers
74  * Structure type to access the FLC Registers.
75  */
76 typedef struct {
77     __IO uint32_t addr;                 /**< <tt>\b 0x00:</tt> FLC ADDR Register */
78     __IO uint32_t clkdiv;               /**< <tt>\b 0x04:</tt> FLC CLKDIV Register */
79     __IO uint32_t ctrl;                 /**< <tt>\b 0x08:</tt> FLC CTRL Register */
80     __R  uint32_t rsv_0xc_0x23[6];
81     __IO uint32_t intr;                 /**< <tt>\b 0x024:</tt> FLC INTR Register */
82     __R  uint32_t rsv_0x28_0x2f[2];
83     __IO uint32_t data[4];              /**< <tt>\b 0x30:</tt> FLC DATA Register */
84     __O  uint32_t actrl;                /**< <tt>\b 0x40:</tt> FLC ACTRL Register */
85 } mxc_flc_regs_t;
86 
87 /* Register offsets for module FLC */
88 /**
89  * @ingroup    flc_registers
90  * @defgroup   FLC_Register_Offsets Register Offsets
91  * @brief      FLC Peripheral Register Offsets from the FLC Base Peripheral Address.
92  * @{
93  */
94 #define MXC_R_FLC_ADDR                     ((uint32_t)0x00000000UL) /**< Offset from FLC Base Address: <tt> 0x0000</tt> */
95 #define MXC_R_FLC_CLKDIV                   ((uint32_t)0x00000004UL) /**< Offset from FLC Base Address: <tt> 0x0004</tt> */
96 #define MXC_R_FLC_CTRL                     ((uint32_t)0x00000008UL) /**< Offset from FLC Base Address: <tt> 0x0008</tt> */
97 #define MXC_R_FLC_INTR                     ((uint32_t)0x00000024UL) /**< Offset from FLC Base Address: <tt> 0x0024</tt> */
98 #define MXC_R_FLC_DATA                     ((uint32_t)0x00000030UL) /**< Offset from FLC Base Address: <tt> 0x0030</tt> */
99 #define MXC_R_FLC_ACTRL                    ((uint32_t)0x00000040UL) /**< Offset from FLC Base Address: <tt> 0x0040</tt> */
100 /**@} end of group flc_registers */
101 
102 /**
103  * @ingroup  flc_registers
104  * @defgroup FLC_ADDR FLC_ADDR
105  * @brief    Flash Write Address.
106  * @{
107  */
108 #define MXC_F_FLC_ADDR_ADDR_POS                        0 /**< ADDR_ADDR Position */
109 #define MXC_F_FLC_ADDR_ADDR                            ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_ADDR_ADDR_POS)) /**< ADDR_ADDR Mask */
110 
111 /**@} end of group FLC_ADDR_Register */
112 
113 /**
114  * @ingroup  flc_registers
115  * @defgroup FLC_CLKDIV FLC_CLKDIV
116  * @brief    Flash Clock Divide. The clock (PLL0) is divided by this value to generate a 1
117  *           MHz clock for Flash controller.
118  * @{
119  */
120 #define MXC_F_FLC_CLKDIV_CLKDIV_POS                    0 /**< CLKDIV_CLKDIV Position */
121 #define MXC_F_FLC_CLKDIV_CLKDIV                        ((uint32_t)(0xFFUL << MXC_F_FLC_CLKDIV_CLKDIV_POS)) /**< CLKDIV_CLKDIV Mask */
122 
123 /**@} end of group FLC_CLKDIV_Register */
124 
125 /**
126  * @ingroup  flc_registers
127  * @defgroup FLC_CTRL FLC_CTRL
128  * @brief    Flash Control Register.
129  * @{
130  */
131 #define MXC_F_FLC_CTRL_WRITE_POS                       0 /**< CTRL_WRITE Position */
132 #define MXC_F_FLC_CTRL_WRITE                           ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_WRITE_POS)) /**< CTRL_WRITE Mask */
133 
134 #define MXC_F_FLC_CTRL_MASS_ERASE_POS                  1 /**< CTRL_MASS_ERASE Position */
135 #define MXC_F_FLC_CTRL_MASS_ERASE                      ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_MASS_ERASE_POS)) /**< CTRL_MASS_ERASE Mask */
136 
137 #define MXC_F_FLC_CTRL_PAGE_ERASE_POS                  2 /**< CTRL_PAGE_ERASE Position */
138 #define MXC_F_FLC_CTRL_PAGE_ERASE                      ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_PAGE_ERASE_POS)) /**< CTRL_PAGE_ERASE Mask */
139 
140 #define MXC_F_FLC_CTRL_WIDTH_POS                       4 /**< CTRL_WIDTH Position */
141 #define MXC_F_FLC_CTRL_WIDTH                           ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_WIDTH_POS)) /**< CTRL_WIDTH Mask */
142 
143 #define MXC_F_FLC_CTRL_ERASE_CODE_POS                  8 /**< CTRL_ERASE_CODE Position */
144 #define MXC_F_FLC_CTRL_ERASE_CODE                      ((uint32_t)(0xFFUL << MXC_F_FLC_CTRL_ERASE_CODE_POS)) /**< CTRL_ERASE_CODE Mask */
145 #define MXC_V_FLC_CTRL_ERASE_CODE_NOP                  ((uint32_t)0x0UL) /**< CTRL_ERASE_CODE_NOP Value */
146 #define MXC_S_FLC_CTRL_ERASE_CODE_NOP                  (MXC_V_FLC_CTRL_ERASE_CODE_NOP << MXC_F_FLC_CTRL_ERASE_CODE_POS) /**< CTRL_ERASE_CODE_NOP Setting */
147 #define MXC_V_FLC_CTRL_ERASE_CODE_ERASEPAGE            ((uint32_t)0x55UL) /**< CTRL_ERASE_CODE_ERASEPAGE Value */
148 #define MXC_S_FLC_CTRL_ERASE_CODE_ERASEPAGE            (MXC_V_FLC_CTRL_ERASE_CODE_ERASEPAGE << MXC_F_FLC_CTRL_ERASE_CODE_POS) /**< CTRL_ERASE_CODE_ERASEPAGE Setting */
149 #define MXC_V_FLC_CTRL_ERASE_CODE_ERASEALL             ((uint32_t)0xAAUL) /**< CTRL_ERASE_CODE_ERASEALL Value */
150 #define MXC_S_FLC_CTRL_ERASE_CODE_ERASEALL             (MXC_V_FLC_CTRL_ERASE_CODE_ERASEALL << MXC_F_FLC_CTRL_ERASE_CODE_POS) /**< CTRL_ERASE_CODE_ERASEALL Setting */
151 
152 #define MXC_F_FLC_CTRL_BUSY_POS                        24 /**< CTRL_BUSY Position */
153 #define MXC_F_FLC_CTRL_BUSY                            ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_BUSY_POS)) /**< CTRL_BUSY Mask */
154 
155 #define MXC_F_FLC_CTRL_LVE_POS                         25 /**< CTRL_LVE Position */
156 #define MXC_F_FLC_CTRL_LVE                             ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_LVE_POS)) /**< CTRL_LVE Mask */
157 
158 #define MXC_F_FLC_CTRL_UNLOCK_CODE_POS                 28 /**< CTRL_UNLOCK_CODE Position */
159 #define MXC_F_FLC_CTRL_UNLOCK_CODE                     ((uint32_t)(0xFUL << MXC_F_FLC_CTRL_UNLOCK_CODE_POS)) /**< CTRL_UNLOCK_CODE Mask */
160 #define MXC_V_FLC_CTRL_UNLOCK_CODE_UNLOCKED            ((uint32_t)0x2UL) /**< CTRL_UNLOCK_CODE_UNLOCKED Value */
161 #define MXC_S_FLC_CTRL_UNLOCK_CODE_UNLOCKED            (MXC_V_FLC_CTRL_UNLOCK_CODE_UNLOCKED << MXC_F_FLC_CTRL_UNLOCK_CODE_POS) /**< CTRL_UNLOCK_CODE_UNLOCKED Setting */
162 #define MXC_V_FLC_CTRL_UNLOCK_CODE_LOCKED              ((uint32_t)0x3UL) /**< CTRL_UNLOCK_CODE_LOCKED Value */
163 #define MXC_S_FLC_CTRL_UNLOCK_CODE_LOCKED              (MXC_V_FLC_CTRL_UNLOCK_CODE_LOCKED << MXC_F_FLC_CTRL_UNLOCK_CODE_POS) /**< CTRL_UNLOCK_CODE_LOCKED Setting */
164 
165 /**@} end of group FLC_CTRL_Register */
166 
167 /**
168  * @ingroup  flc_registers
169  * @defgroup FLC_INTR FLC_INTR
170  * @brief    Flash Interrupt Register.
171  * @{
172  */
173 #define MXC_F_FLC_INTR_DONE_POS                        0 /**< INTR_DONE Position */
174 #define MXC_F_FLC_INTR_DONE                            ((uint32_t)(0x1UL << MXC_F_FLC_INTR_DONE_POS)) /**< INTR_DONE Mask */
175 
176 #define MXC_F_FLC_INTR_ACCESS_FAIL_POS                 1 /**< INTR_ACCESS_FAIL Position */
177 #define MXC_F_FLC_INTR_ACCESS_FAIL                     ((uint32_t)(0x1UL << MXC_F_FLC_INTR_ACCESS_FAIL_POS)) /**< INTR_ACCESS_FAIL Mask */
178 
179 #define MXC_F_FLC_INTR_DONE_IE_POS                     8 /**< INTR_DONE_IE Position */
180 #define MXC_F_FLC_INTR_DONE_IE                         ((uint32_t)(0x1UL << MXC_F_FLC_INTR_DONE_IE_POS)) /**< INTR_DONE_IE Mask */
181 
182 #define MXC_F_FLC_INTR_ACCESS_FAIL_IE_POS              9 /**< INTR_ACCESS_FAIL_IE Position */
183 #define MXC_F_FLC_INTR_ACCESS_FAIL_IE                  ((uint32_t)(0x1UL << MXC_F_FLC_INTR_ACCESS_FAIL_IE_POS)) /**< INTR_ACCESS_FAIL_IE Mask */
184 
185 /**@} end of group FLC_INTR_Register */
186 
187 /**
188  * @ingroup  flc_registers
189  * @defgroup FLC_DATA FLC_DATA
190  * @brief    Flash Write Data.
191  * @{
192  */
193 #define MXC_F_FLC_DATA_DATA_POS                        0 /**< DATA_DATA Position */
194 #define MXC_F_FLC_DATA_DATA                            ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_DATA_DATA_POS)) /**< DATA_DATA Mask */
195 
196 /**@} end of group FLC_DATA_Register */
197 
198 /**
199  * @ingroup  flc_registers
200  * @defgroup FLC_ACTRL FLC_ACTRL
201  * @brief    Access Control Register. Writing the ACTRL register with the following values in
202  *           the order shown, allows read and write access to the system and user Information
203  *           block:                 pflc-actrl = 0x3a7f5ca3;                 pflc-actrl =
204  *           0xa1e34f20;                 pflc-actrl = 0x9608b2c1. When unlocked, a write of
205  *           any word will disable access to system and user information block. Readback of
206  *           this register is always zero.
207  * @{
208  */
209 #define MXC_F_FLC_ACTRL_ACTRL_POS                      0 /**< ACTRL_ACTRL Position */
210 #define MXC_F_FLC_ACTRL_ACTRL                          ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_ACTRL_ACTRL_POS)) /**< ACTRL_ACTRL Mask */
211 
212 /**@} end of group FLC_ACTRL_Register */
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32660_INCLUDE_FLC_REGS_H_
219