MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
flc_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 _FLC_REGS_H_
41 #define _FLC_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 addr;
90  __IO uint32_t clkdiv;
91  __IO uint32_t ctrl;
92  __R uint32_t rsv_0xc_0x23[6];
93  __IO uint32_t intr;
94  __IO uint32_t eccdata;
95  __R uint32_t rsv_0x2c;
96  __IO uint32_t data[4];
97  __O uint32_t actrl;
98  __R uint32_t rsv_0x44_0x7f[15];
99  __IO uint32_t welr0;
100  __R uint32_t rsv_0x84;
101  __IO uint32_t welr1;
102  __R uint32_t rsv_0x8c;
103  __IO uint32_t rlr0;
104  __R uint32_t rsv_0x94;
105  __IO uint32_t rlr1;
107 
108 /* Register offsets for module FLC */
115  #define MXC_R_FLC_ADDR ((uint32_t)0x00000000UL)
116  #define MXC_R_FLC_CLKDIV ((uint32_t)0x00000004UL)
117  #define MXC_R_FLC_CTRL ((uint32_t)0x00000008UL)
118  #define MXC_R_FLC_INTR ((uint32_t)0x00000024UL)
119  #define MXC_R_FLC_ECCDATA ((uint32_t)0x00000028UL)
120  #define MXC_R_FLC_DATA ((uint32_t)0x00000030UL)
121  #define MXC_R_FLC_ACTRL ((uint32_t)0x00000040UL)
122  #define MXC_R_FLC_WELR0 ((uint32_t)0x00000080UL)
123  #define MXC_R_FLC_WELR1 ((uint32_t)0x00000088UL)
124  #define MXC_R_FLC_RLR0 ((uint32_t)0x00000090UL)
125  #define MXC_R_FLC_RLR1 ((uint32_t)0x00000098UL)
134  #define MXC_F_FLC_ADDR_ADDR_POS 0
135  #define MXC_F_FLC_ADDR_ADDR ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_ADDR_ADDR_POS))
146  #define MXC_F_FLC_CLKDIV_CLKDIV_POS 0
147  #define MXC_F_FLC_CLKDIV_CLKDIV ((uint32_t)(0xFFUL << MXC_F_FLC_CLKDIV_CLKDIV_POS))
157  #define MXC_F_FLC_CTRL_WR_POS 0
158  #define MXC_F_FLC_CTRL_WR ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_WR_POS))
160  #define MXC_F_FLC_CTRL_ME_POS 1
161  #define MXC_F_FLC_CTRL_ME ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_ME_POS))
163  #define MXC_F_FLC_CTRL_PGE_POS 2
164  #define MXC_F_FLC_CTRL_PGE ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_PGE_POS))
166  #define MXC_F_FLC_CTRL_WDTH_POS 4
167  #define MXC_F_FLC_CTRL_WDTH ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_WDTH_POS))
169  #define MXC_F_FLC_CTRL_ERASE_CODE_POS 8
170  #define MXC_F_FLC_CTRL_ERASE_CODE ((uint32_t)(0xFFUL << MXC_F_FLC_CTRL_ERASE_CODE_POS))
171  #define MXC_V_FLC_CTRL_ERASE_CODE_NOP ((uint32_t)0x0UL)
172  #define MXC_S_FLC_CTRL_ERASE_CODE_NOP (MXC_V_FLC_CTRL_ERASE_CODE_NOP << MXC_F_FLC_CTRL_ERASE_CODE_POS)
173  #define MXC_V_FLC_CTRL_ERASE_CODE_ERASEPAGE ((uint32_t)0x55UL)
174  #define MXC_S_FLC_CTRL_ERASE_CODE_ERASEPAGE (MXC_V_FLC_CTRL_ERASE_CODE_ERASEPAGE << MXC_F_FLC_CTRL_ERASE_CODE_POS)
175  #define MXC_V_FLC_CTRL_ERASE_CODE_ERASEALL ((uint32_t)0xAAUL)
176  #define MXC_S_FLC_CTRL_ERASE_CODE_ERASEALL (MXC_V_FLC_CTRL_ERASE_CODE_ERASEALL << MXC_F_FLC_CTRL_ERASE_CODE_POS)
178  #define MXC_F_FLC_CTRL_PEND_POS 24
179  #define MXC_F_FLC_CTRL_PEND ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_PEND_POS))
181  #define MXC_F_FLC_CTRL_LVE_POS 25
182  #define MXC_F_FLC_CTRL_LVE ((uint32_t)(0x1UL << MXC_F_FLC_CTRL_LVE_POS))
184  #define MXC_F_FLC_CTRL_UNLOCK_POS 28
185  #define MXC_F_FLC_CTRL_UNLOCK ((uint32_t)(0xFUL << MXC_F_FLC_CTRL_UNLOCK_POS))
186  #define MXC_V_FLC_CTRL_UNLOCK_UNLOCKED ((uint32_t)0x2UL)
187  #define MXC_S_FLC_CTRL_UNLOCK_UNLOCKED (MXC_V_FLC_CTRL_UNLOCK_UNLOCKED << MXC_F_FLC_CTRL_UNLOCK_POS)
188  #define MXC_V_FLC_CTRL_UNLOCK_LOCKED ((uint32_t)0x3UL)
189  #define MXC_S_FLC_CTRL_UNLOCK_LOCKED (MXC_V_FLC_CTRL_UNLOCK_LOCKED << MXC_F_FLC_CTRL_UNLOCK_POS)
199  #define MXC_F_FLC_INTR_DONE_POS 0
200  #define MXC_F_FLC_INTR_DONE ((uint32_t)(0x1UL << MXC_F_FLC_INTR_DONE_POS))
202  #define MXC_F_FLC_INTR_AF_POS 1
203  #define MXC_F_FLC_INTR_AF ((uint32_t)(0x1UL << MXC_F_FLC_INTR_AF_POS))
205  #define MXC_F_FLC_INTR_DONEIE_POS 8
206  #define MXC_F_FLC_INTR_DONEIE ((uint32_t)(0x1UL << MXC_F_FLC_INTR_DONEIE_POS))
208  #define MXC_F_FLC_INTR_AFIE_POS 9
209  #define MXC_F_FLC_INTR_AFIE ((uint32_t)(0x1UL << MXC_F_FLC_INTR_AFIE_POS))
219  #define MXC_F_FLC_ECCDATA_EVEN_POS 0
220  #define MXC_F_FLC_ECCDATA_EVEN ((uint32_t)(0x1FFUL << MXC_F_FLC_ECCDATA_EVEN_POS))
222  #define MXC_F_FLC_ECCDATA_ODD_POS 16
223  #define MXC_F_FLC_ECCDATA_ODD ((uint32_t)(0x1FFUL << MXC_F_FLC_ECCDATA_ODD_POS))
233  #define MXC_F_FLC_DATA_DATA_POS 0
234  #define MXC_F_FLC_DATA_DATA ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_DATA_DATA_POS))
248  #define MXC_F_FLC_ACTRL_ACTRL_POS 0
249  #define MXC_F_FLC_ACTRL_ACTRL ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_ACTRL_ACTRL_POS))
259  #define MXC_F_FLC_WELR0_WELR0_POS 0
260  #define MXC_F_FLC_WELR0_WELR0 ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_WELR0_WELR0_POS))
270  #define MXC_F_FLC_WELR1_WELR1_POS 0
271  #define MXC_F_FLC_WELR1_WELR1 ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_WELR1_WELR1_POS))
281  #define MXC_F_FLC_RLR0_RLR0_POS 0
282  #define MXC_F_FLC_RLR0_RLR0 ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_RLR0_RLR0_POS))
292  #define MXC_F_FLC_RLR1_RLR1_POS 0
293  #define MXC_F_FLC_RLR1_RLR1 ((uint32_t)(0xFFFFFFFFUL << MXC_F_FLC_RLR1_RLR1_POS))
297 #ifdef __cplusplus
298 }
299 #endif
300 
301 #endif /* _FLC_REGS_H_ */
mxc_flc_regs_t::ctrl
__IO uint32_t ctrl
Definition: flc_regs.h:91
mxc_flc_regs_t
Definition: flc_regs.h:88
mxc_flc_regs_t::addr
__IO uint32_t addr
Definition: flc_regs.h:89
mxc_flc_regs_t::intr
__IO uint32_t intr
Definition: flc_regs.h:93
mxc_flc_regs_t::rlr1
__IO uint32_t rlr1
Definition: flc_regs.h:105
mxc_flc_regs_t::welr0
__IO uint32_t welr0
Definition: flc_regs.h:99
mxc_flc_regs_t::eccdata
__IO uint32_t eccdata
Definition: flc_regs.h:94
mxc_flc_regs_t::clkdiv
__IO uint32_t clkdiv
Definition: flc_regs.h:90
mxc_flc_regs_t::welr1
__IO uint32_t welr1
Definition: flc_regs.h:101
mxc_flc_regs_t::actrl
__O uint32_t actrl
Definition: flc_regs.h:97
mxc_flc_regs_t::rlr0
__IO uint32_t rlr0
Definition: flc_regs.h:103