2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K22P121M120SF7RM, Rev. 1, March 24, 2014
9 ** Version: rev. 2.5, 2014-05-06
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-07-23)
49 ** - rev. 1.1 (2013-09-17)
50 ** RM rev. 0.4 update.
51 ** - rev. 2.0 (2013-10-29)
52 ** Register accessor macros added to the memory map.
53 ** Symbols for Processor Expert memory map compatibility added to the memory map.
54 ** Startup file for gcc has been updated according to CMSIS 3.2.
55 ** System initialization updated.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-20)
59 ** Update according to reference manual rev. 0.6,
60 ** - rev. 2.3 (2014-01-13)
61 ** Update according to reference manual rev. 0.61,
62 ** - rev. 2.4 (2014-02-10)
63 ** The declaration of clock configurations has been moved to separate header file system_MK22F51212.h
64 ** - rev. 2.5 (2014-05-06)
65 ** Update according to reference manual rev. 1.0,
66 ** Update of system and startup files.
67 ** Module access macro module_BASES replaced by module_BASE_PTRS.
69 ** ###################################################################
73 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
75 * This file was generated automatically and any changes may be lost.
77 #ifndef __HW_NV_REGISTERS_H__
78 #define __HW_NV_REGISTERS_H__
80 #include "MK22F51212.h"
81 #include "fsl_bitaccess.h"
86 * Flash configuration field
88 * Registers defined in this header file:
89 * - HW_NV_BACKKEY3 - Backdoor Comparison Key 3.
90 * - HW_NV_BACKKEY2 - Backdoor Comparison Key 2.
91 * - HW_NV_BACKKEY1 - Backdoor Comparison Key 1.
92 * - HW_NV_BACKKEY0 - Backdoor Comparison Key 0.
93 * - HW_NV_BACKKEY7 - Backdoor Comparison Key 7.
94 * - HW_NV_BACKKEY6 - Backdoor Comparison Key 6.
95 * - HW_NV_BACKKEY5 - Backdoor Comparison Key 5.
96 * - HW_NV_BACKKEY4 - Backdoor Comparison Key 4.
97 * - HW_NV_FPROT3 - Non-volatile P-Flash Protection 1 - Low Register
98 * - HW_NV_FPROT2 - Non-volatile P-Flash Protection 1 - High Register
99 * - HW_NV_FPROT1 - Non-volatile P-Flash Protection 0 - Low Register
100 * - HW_NV_FPROT0 - Non-volatile P-Flash Protection 0 - High Register
101 * - HW_NV_FSEC - Non-volatile Flash Security Register
102 * - HW_NV_FOPT - Non-volatile Flash Option Register
104 * - hw_nv_t - Struct containing all module registers.
107 #define HW_NV_INSTANCE_COUNT (1U) /*!< Number of instances of the NV module. */
109 /*******************************************************************************
110 * HW_NV_BACKKEY3 - Backdoor Comparison Key 3.
111 ******************************************************************************/
114 * @brief HW_NV_BACKKEY3 - Backdoor Comparison Key 3. (RO)
118 typedef union _hw_nv_backkey3
121 struct _hw_nv_backkey3_bitfields
123 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
128 * @name Constants and macros for entire NV_BACKKEY3 register
131 #define HW_NV_BACKKEY3_ADDR(x) ((x) + 0x0U)
133 #define HW_NV_BACKKEY3(x) (*(__I hw_nv_backkey3_t *) HW_NV_BACKKEY3_ADDR(x))
134 #define HW_NV_BACKKEY3_RD(x) (HW_NV_BACKKEY3(x).U)
138 * Constants & macros for individual NV_BACKKEY3 bitfields
142 * @name Register NV_BACKKEY3, field KEY[7:0] (RO)
145 #define BP_NV_BACKKEY3_KEY (0U) /*!< Bit position for NV_BACKKEY3_KEY. */
146 #define BM_NV_BACKKEY3_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY3_KEY. */
147 #define BS_NV_BACKKEY3_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY3_KEY. */
149 /*! @brief Read current value of the NV_BACKKEY3_KEY field. */
150 #define BR_NV_BACKKEY3_KEY(x) (HW_NV_BACKKEY3(x).U)
153 /*******************************************************************************
154 * HW_NV_BACKKEY2 - Backdoor Comparison Key 2.
155 ******************************************************************************/
158 * @brief HW_NV_BACKKEY2 - Backdoor Comparison Key 2. (RO)
162 typedef union _hw_nv_backkey2
165 struct _hw_nv_backkey2_bitfields
167 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
172 * @name Constants and macros for entire NV_BACKKEY2 register
175 #define HW_NV_BACKKEY2_ADDR(x) ((x) + 0x1U)
177 #define HW_NV_BACKKEY2(x) (*(__I hw_nv_backkey2_t *) HW_NV_BACKKEY2_ADDR(x))
178 #define HW_NV_BACKKEY2_RD(x) (HW_NV_BACKKEY2(x).U)
182 * Constants & macros for individual NV_BACKKEY2 bitfields
186 * @name Register NV_BACKKEY2, field KEY[7:0] (RO)
189 #define BP_NV_BACKKEY2_KEY (0U) /*!< Bit position for NV_BACKKEY2_KEY. */
190 #define BM_NV_BACKKEY2_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY2_KEY. */
191 #define BS_NV_BACKKEY2_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY2_KEY. */
193 /*! @brief Read current value of the NV_BACKKEY2_KEY field. */
194 #define BR_NV_BACKKEY2_KEY(x) (HW_NV_BACKKEY2(x).U)
197 /*******************************************************************************
198 * HW_NV_BACKKEY1 - Backdoor Comparison Key 1.
199 ******************************************************************************/
202 * @brief HW_NV_BACKKEY1 - Backdoor Comparison Key 1. (RO)
206 typedef union _hw_nv_backkey1
209 struct _hw_nv_backkey1_bitfields
211 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
216 * @name Constants and macros for entire NV_BACKKEY1 register
219 #define HW_NV_BACKKEY1_ADDR(x) ((x) + 0x2U)
221 #define HW_NV_BACKKEY1(x) (*(__I hw_nv_backkey1_t *) HW_NV_BACKKEY1_ADDR(x))
222 #define HW_NV_BACKKEY1_RD(x) (HW_NV_BACKKEY1(x).U)
226 * Constants & macros for individual NV_BACKKEY1 bitfields
230 * @name Register NV_BACKKEY1, field KEY[7:0] (RO)
233 #define BP_NV_BACKKEY1_KEY (0U) /*!< Bit position for NV_BACKKEY1_KEY. */
234 #define BM_NV_BACKKEY1_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY1_KEY. */
235 #define BS_NV_BACKKEY1_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY1_KEY. */
237 /*! @brief Read current value of the NV_BACKKEY1_KEY field. */
238 #define BR_NV_BACKKEY1_KEY(x) (HW_NV_BACKKEY1(x).U)
241 /*******************************************************************************
242 * HW_NV_BACKKEY0 - Backdoor Comparison Key 0.
243 ******************************************************************************/
246 * @brief HW_NV_BACKKEY0 - Backdoor Comparison Key 0. (RO)
250 typedef union _hw_nv_backkey0
253 struct _hw_nv_backkey0_bitfields
255 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
260 * @name Constants and macros for entire NV_BACKKEY0 register
263 #define HW_NV_BACKKEY0_ADDR(x) ((x) + 0x3U)
265 #define HW_NV_BACKKEY0(x) (*(__I hw_nv_backkey0_t *) HW_NV_BACKKEY0_ADDR(x))
266 #define HW_NV_BACKKEY0_RD(x) (HW_NV_BACKKEY0(x).U)
270 * Constants & macros for individual NV_BACKKEY0 bitfields
274 * @name Register NV_BACKKEY0, field KEY[7:0] (RO)
277 #define BP_NV_BACKKEY0_KEY (0U) /*!< Bit position for NV_BACKKEY0_KEY. */
278 #define BM_NV_BACKKEY0_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY0_KEY. */
279 #define BS_NV_BACKKEY0_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY0_KEY. */
281 /*! @brief Read current value of the NV_BACKKEY0_KEY field. */
282 #define BR_NV_BACKKEY0_KEY(x) (HW_NV_BACKKEY0(x).U)
285 /*******************************************************************************
286 * HW_NV_BACKKEY7 - Backdoor Comparison Key 7.
287 ******************************************************************************/
290 * @brief HW_NV_BACKKEY7 - Backdoor Comparison Key 7. (RO)
294 typedef union _hw_nv_backkey7
297 struct _hw_nv_backkey7_bitfields
299 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
304 * @name Constants and macros for entire NV_BACKKEY7 register
307 #define HW_NV_BACKKEY7_ADDR(x) ((x) + 0x4U)
309 #define HW_NV_BACKKEY7(x) (*(__I hw_nv_backkey7_t *) HW_NV_BACKKEY7_ADDR(x))
310 #define HW_NV_BACKKEY7_RD(x) (HW_NV_BACKKEY7(x).U)
314 * Constants & macros for individual NV_BACKKEY7 bitfields
318 * @name Register NV_BACKKEY7, field KEY[7:0] (RO)
321 #define BP_NV_BACKKEY7_KEY (0U) /*!< Bit position for NV_BACKKEY7_KEY. */
322 #define BM_NV_BACKKEY7_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY7_KEY. */
323 #define BS_NV_BACKKEY7_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY7_KEY. */
325 /*! @brief Read current value of the NV_BACKKEY7_KEY field. */
326 #define BR_NV_BACKKEY7_KEY(x) (HW_NV_BACKKEY7(x).U)
329 /*******************************************************************************
330 * HW_NV_BACKKEY6 - Backdoor Comparison Key 6.
331 ******************************************************************************/
334 * @brief HW_NV_BACKKEY6 - Backdoor Comparison Key 6. (RO)
338 typedef union _hw_nv_backkey6
341 struct _hw_nv_backkey6_bitfields
343 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
348 * @name Constants and macros for entire NV_BACKKEY6 register
351 #define HW_NV_BACKKEY6_ADDR(x) ((x) + 0x5U)
353 #define HW_NV_BACKKEY6(x) (*(__I hw_nv_backkey6_t *) HW_NV_BACKKEY6_ADDR(x))
354 #define HW_NV_BACKKEY6_RD(x) (HW_NV_BACKKEY6(x).U)
358 * Constants & macros for individual NV_BACKKEY6 bitfields
362 * @name Register NV_BACKKEY6, field KEY[7:0] (RO)
365 #define BP_NV_BACKKEY6_KEY (0U) /*!< Bit position for NV_BACKKEY6_KEY. */
366 #define BM_NV_BACKKEY6_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY6_KEY. */
367 #define BS_NV_BACKKEY6_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY6_KEY. */
369 /*! @brief Read current value of the NV_BACKKEY6_KEY field. */
370 #define BR_NV_BACKKEY6_KEY(x) (HW_NV_BACKKEY6(x).U)
373 /*******************************************************************************
374 * HW_NV_BACKKEY5 - Backdoor Comparison Key 5.
375 ******************************************************************************/
378 * @brief HW_NV_BACKKEY5 - Backdoor Comparison Key 5. (RO)
382 typedef union _hw_nv_backkey5
385 struct _hw_nv_backkey5_bitfields
387 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
392 * @name Constants and macros for entire NV_BACKKEY5 register
395 #define HW_NV_BACKKEY5_ADDR(x) ((x) + 0x6U)
397 #define HW_NV_BACKKEY5(x) (*(__I hw_nv_backkey5_t *) HW_NV_BACKKEY5_ADDR(x))
398 #define HW_NV_BACKKEY5_RD(x) (HW_NV_BACKKEY5(x).U)
402 * Constants & macros for individual NV_BACKKEY5 bitfields
406 * @name Register NV_BACKKEY5, field KEY[7:0] (RO)
409 #define BP_NV_BACKKEY5_KEY (0U) /*!< Bit position for NV_BACKKEY5_KEY. */
410 #define BM_NV_BACKKEY5_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY5_KEY. */
411 #define BS_NV_BACKKEY5_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY5_KEY. */
413 /*! @brief Read current value of the NV_BACKKEY5_KEY field. */
414 #define BR_NV_BACKKEY5_KEY(x) (HW_NV_BACKKEY5(x).U)
417 /*******************************************************************************
418 * HW_NV_BACKKEY4 - Backdoor Comparison Key 4.
419 ******************************************************************************/
422 * @brief HW_NV_BACKKEY4 - Backdoor Comparison Key 4. (RO)
426 typedef union _hw_nv_backkey4
429 struct _hw_nv_backkey4_bitfields
431 uint8_t KEY : 8; /*!< [7:0] Backdoor Comparison Key. */
436 * @name Constants and macros for entire NV_BACKKEY4 register
439 #define HW_NV_BACKKEY4_ADDR(x) ((x) + 0x7U)
441 #define HW_NV_BACKKEY4(x) (*(__I hw_nv_backkey4_t *) HW_NV_BACKKEY4_ADDR(x))
442 #define HW_NV_BACKKEY4_RD(x) (HW_NV_BACKKEY4(x).U)
446 * Constants & macros for individual NV_BACKKEY4 bitfields
450 * @name Register NV_BACKKEY4, field KEY[7:0] (RO)
453 #define BP_NV_BACKKEY4_KEY (0U) /*!< Bit position for NV_BACKKEY4_KEY. */
454 #define BM_NV_BACKKEY4_KEY (0xFFU) /*!< Bit mask for NV_BACKKEY4_KEY. */
455 #define BS_NV_BACKKEY4_KEY (8U) /*!< Bit field size in bits for NV_BACKKEY4_KEY. */
457 /*! @brief Read current value of the NV_BACKKEY4_KEY field. */
458 #define BR_NV_BACKKEY4_KEY(x) (HW_NV_BACKKEY4(x).U)
461 /*******************************************************************************
462 * HW_NV_FPROT3 - Non-volatile P-Flash Protection 1 - Low Register
463 ******************************************************************************/
466 * @brief HW_NV_FPROT3 - Non-volatile P-Flash Protection 1 - Low Register (RO)
470 typedef union _hw_nv_fprot3
473 struct _hw_nv_fprot3_bitfields
475 uint8_t PROT : 8; /*!< [7:0] P-Flash Region Protect */
480 * @name Constants and macros for entire NV_FPROT3 register
483 #define HW_NV_FPROT3_ADDR(x) ((x) + 0x8U)
485 #define HW_NV_FPROT3(x) (*(__I hw_nv_fprot3_t *) HW_NV_FPROT3_ADDR(x))
486 #define HW_NV_FPROT3_RD(x) (HW_NV_FPROT3(x).U)
490 * Constants & macros for individual NV_FPROT3 bitfields
494 * @name Register NV_FPROT3, field PROT[7:0] (RO)
497 #define BP_NV_FPROT3_PROT (0U) /*!< Bit position for NV_FPROT3_PROT. */
498 #define BM_NV_FPROT3_PROT (0xFFU) /*!< Bit mask for NV_FPROT3_PROT. */
499 #define BS_NV_FPROT3_PROT (8U) /*!< Bit field size in bits for NV_FPROT3_PROT. */
501 /*! @brief Read current value of the NV_FPROT3_PROT field. */
502 #define BR_NV_FPROT3_PROT(x) (HW_NV_FPROT3(x).U)
505 /*******************************************************************************
506 * HW_NV_FPROT2 - Non-volatile P-Flash Protection 1 - High Register
507 ******************************************************************************/
510 * @brief HW_NV_FPROT2 - Non-volatile P-Flash Protection 1 - High Register (RO)
514 typedef union _hw_nv_fprot2
517 struct _hw_nv_fprot2_bitfields
519 uint8_t PROT : 8; /*!< [7:0] P-Flash Region Protect */
524 * @name Constants and macros for entire NV_FPROT2 register
527 #define HW_NV_FPROT2_ADDR(x) ((x) + 0x9U)
529 #define HW_NV_FPROT2(x) (*(__I hw_nv_fprot2_t *) HW_NV_FPROT2_ADDR(x))
530 #define HW_NV_FPROT2_RD(x) (HW_NV_FPROT2(x).U)
534 * Constants & macros for individual NV_FPROT2 bitfields
538 * @name Register NV_FPROT2, field PROT[7:0] (RO)
541 #define BP_NV_FPROT2_PROT (0U) /*!< Bit position for NV_FPROT2_PROT. */
542 #define BM_NV_FPROT2_PROT (0xFFU) /*!< Bit mask for NV_FPROT2_PROT. */
543 #define BS_NV_FPROT2_PROT (8U) /*!< Bit field size in bits for NV_FPROT2_PROT. */
545 /*! @brief Read current value of the NV_FPROT2_PROT field. */
546 #define BR_NV_FPROT2_PROT(x) (HW_NV_FPROT2(x).U)
549 /*******************************************************************************
550 * HW_NV_FPROT1 - Non-volatile P-Flash Protection 0 - Low Register
551 ******************************************************************************/
554 * @brief HW_NV_FPROT1 - Non-volatile P-Flash Protection 0 - Low Register (RO)
558 typedef union _hw_nv_fprot1
561 struct _hw_nv_fprot1_bitfields
563 uint8_t PROT : 8; /*!< [7:0] P-Flash Region Protect */
568 * @name Constants and macros for entire NV_FPROT1 register
571 #define HW_NV_FPROT1_ADDR(x) ((x) + 0xAU)
573 #define HW_NV_FPROT1(x) (*(__I hw_nv_fprot1_t *) HW_NV_FPROT1_ADDR(x))
574 #define HW_NV_FPROT1_RD(x) (HW_NV_FPROT1(x).U)
578 * Constants & macros for individual NV_FPROT1 bitfields
582 * @name Register NV_FPROT1, field PROT[7:0] (RO)
585 #define BP_NV_FPROT1_PROT (0U) /*!< Bit position for NV_FPROT1_PROT. */
586 #define BM_NV_FPROT1_PROT (0xFFU) /*!< Bit mask for NV_FPROT1_PROT. */
587 #define BS_NV_FPROT1_PROT (8U) /*!< Bit field size in bits for NV_FPROT1_PROT. */
589 /*! @brief Read current value of the NV_FPROT1_PROT field. */
590 #define BR_NV_FPROT1_PROT(x) (HW_NV_FPROT1(x).U)
593 /*******************************************************************************
594 * HW_NV_FPROT0 - Non-volatile P-Flash Protection 0 - High Register
595 ******************************************************************************/
598 * @brief HW_NV_FPROT0 - Non-volatile P-Flash Protection 0 - High Register (RO)
602 typedef union _hw_nv_fprot0
605 struct _hw_nv_fprot0_bitfields
607 uint8_t PROT : 8; /*!< [7:0] P-Flash Region Protect */
612 * @name Constants and macros for entire NV_FPROT0 register
615 #define HW_NV_FPROT0_ADDR(x) ((x) + 0xBU)
617 #define HW_NV_FPROT0(x) (*(__I hw_nv_fprot0_t *) HW_NV_FPROT0_ADDR(x))
618 #define HW_NV_FPROT0_RD(x) (HW_NV_FPROT0(x).U)
622 * Constants & macros for individual NV_FPROT0 bitfields
626 * @name Register NV_FPROT0, field PROT[7:0] (RO)
629 #define BP_NV_FPROT0_PROT (0U) /*!< Bit position for NV_FPROT0_PROT. */
630 #define BM_NV_FPROT0_PROT (0xFFU) /*!< Bit mask for NV_FPROT0_PROT. */
631 #define BS_NV_FPROT0_PROT (8U) /*!< Bit field size in bits for NV_FPROT0_PROT. */
633 /*! @brief Read current value of the NV_FPROT0_PROT field. */
634 #define BR_NV_FPROT0_PROT(x) (HW_NV_FPROT0(x).U)
637 /*******************************************************************************
638 * HW_NV_FSEC - Non-volatile Flash Security Register
639 ******************************************************************************/
642 * @brief HW_NV_FSEC - Non-volatile Flash Security Register (RO)
646 * Allows the user to customize the operation of the MCU at boot time
648 typedef union _hw_nv_fsec
651 struct _hw_nv_fsec_bitfields
653 uint8_t SEC : 2; /*!< [1:0] Flash Security */
654 uint8_t FSLACC : 2; /*!< [3:2] Freescale Failure Analysis Access Code
656 uint8_t MEEN : 2; /*!< [5:4] */
657 uint8_t KEYEN : 2; /*!< [7:6] Backdoor Key Security Enable */
662 * @name Constants and macros for entire NV_FSEC register
665 #define HW_NV_FSEC_ADDR(x) ((x) + 0xCU)
667 #define HW_NV_FSEC(x) (*(__I hw_nv_fsec_t *) HW_NV_FSEC_ADDR(x))
668 #define HW_NV_FSEC_RD(x) (HW_NV_FSEC(x).U)
672 * Constants & macros for individual NV_FSEC bitfields
676 * @name Register NV_FSEC, field SEC[1:0] (RO)
679 * - 10 - MCU security status is unsecure
680 * - 11 - MCU security status is secure
683 #define BP_NV_FSEC_SEC (0U) /*!< Bit position for NV_FSEC_SEC. */
684 #define BM_NV_FSEC_SEC (0x03U) /*!< Bit mask for NV_FSEC_SEC. */
685 #define BS_NV_FSEC_SEC (2U) /*!< Bit field size in bits for NV_FSEC_SEC. */
687 /*! @brief Read current value of the NV_FSEC_SEC field. */
688 #define BR_NV_FSEC_SEC(x) (HW_NV_FSEC(x).B.SEC)
692 * @name Register NV_FSEC, field FSLACC[3:2] (RO)
695 * - 10 - Freescale factory access denied
696 * - 11 - Freescale factory access granted
699 #define BP_NV_FSEC_FSLACC (2U) /*!< Bit position for NV_FSEC_FSLACC. */
700 #define BM_NV_FSEC_FSLACC (0x0CU) /*!< Bit mask for NV_FSEC_FSLACC. */
701 #define BS_NV_FSEC_FSLACC (2U) /*!< Bit field size in bits for NV_FSEC_FSLACC. */
703 /*! @brief Read current value of the NV_FSEC_FSLACC field. */
704 #define BR_NV_FSEC_FSLACC(x) (HW_NV_FSEC(x).B.FSLACC)
708 * @name Register NV_FSEC, field MEEN[5:4] (RO)
711 * - 10 - Mass erase is disabled
712 * - 11 - Mass erase is enabled
715 #define BP_NV_FSEC_MEEN (4U) /*!< Bit position for NV_FSEC_MEEN. */
716 #define BM_NV_FSEC_MEEN (0x30U) /*!< Bit mask for NV_FSEC_MEEN. */
717 #define BS_NV_FSEC_MEEN (2U) /*!< Bit field size in bits for NV_FSEC_MEEN. */
719 /*! @brief Read current value of the NV_FSEC_MEEN field. */
720 #define BR_NV_FSEC_MEEN(x) (HW_NV_FSEC(x).B.MEEN)
724 * @name Register NV_FSEC, field KEYEN[7:6] (RO)
727 * - 10 - Backdoor key access enabled
728 * - 11 - Backdoor key access disabled
731 #define BP_NV_FSEC_KEYEN (6U) /*!< Bit position for NV_FSEC_KEYEN. */
732 #define BM_NV_FSEC_KEYEN (0xC0U) /*!< Bit mask for NV_FSEC_KEYEN. */
733 #define BS_NV_FSEC_KEYEN (2U) /*!< Bit field size in bits for NV_FSEC_KEYEN. */
735 /*! @brief Read current value of the NV_FSEC_KEYEN field. */
736 #define BR_NV_FSEC_KEYEN(x) (HW_NV_FSEC(x).B.KEYEN)
739 /*******************************************************************************
740 * HW_NV_FOPT - Non-volatile Flash Option Register
741 ******************************************************************************/
744 * @brief HW_NV_FOPT - Non-volatile Flash Option Register (RO)
748 typedef union _hw_nv_fopt
751 struct _hw_nv_fopt_bitfields
753 uint8_t LPBOOT : 1; /*!< [0] */
754 uint8_t EZPORT_DIS : 1; /*!< [1] */
755 uint8_t NMI_DIS : 1; /*!< [2] */
756 uint8_t RESERVED0 : 2; /*!< [4:3] */
757 uint8_t FAST_INIT : 1; /*!< [5] */
758 uint8_t RESERVED1 : 2; /*!< [7:6] */
763 * @name Constants and macros for entire NV_FOPT register
766 #define HW_NV_FOPT_ADDR(x) ((x) + 0xDU)
768 #define HW_NV_FOPT(x) (*(__I hw_nv_fopt_t *) HW_NV_FOPT_ADDR(x))
769 #define HW_NV_FOPT_RD(x) (HW_NV_FOPT(x).U)
773 * Constants & macros for individual NV_FOPT bitfields
777 * @name Register NV_FOPT, field LPBOOT[0] (RO)
780 * - 00 - Low-power boot
784 #define BP_NV_FOPT_LPBOOT (0U) /*!< Bit position for NV_FOPT_LPBOOT. */
785 #define BM_NV_FOPT_LPBOOT (0x01U) /*!< Bit mask for NV_FOPT_LPBOOT. */
786 #define BS_NV_FOPT_LPBOOT (1U) /*!< Bit field size in bits for NV_FOPT_LPBOOT. */
788 /*! @brief Read current value of the NV_FOPT_LPBOOT field. */
789 #define BR_NV_FOPT_LPBOOT(x) (BITBAND_ACCESS8(HW_NV_FOPT_ADDR(x), BP_NV_FOPT_LPBOOT))
793 * @name Register NV_FOPT, field EZPORT_DIS[1] (RO)
796 #define BP_NV_FOPT_EZPORT_DIS (1U) /*!< Bit position for NV_FOPT_EZPORT_DIS. */
797 #define BM_NV_FOPT_EZPORT_DIS (0x02U) /*!< Bit mask for NV_FOPT_EZPORT_DIS. */
798 #define BS_NV_FOPT_EZPORT_DIS (1U) /*!< Bit field size in bits for NV_FOPT_EZPORT_DIS. */
800 /*! @brief Read current value of the NV_FOPT_EZPORT_DIS field. */
801 #define BR_NV_FOPT_EZPORT_DIS(x) (BITBAND_ACCESS8(HW_NV_FOPT_ADDR(x), BP_NV_FOPT_EZPORT_DIS))
805 * @name Register NV_FOPT, field NMI_DIS[2] (RO)
808 * - 00 - NMI interrupts are always blocked
809 * - 01 - NMI_b pin/interrupts reset default to enabled
812 #define BP_NV_FOPT_NMI_DIS (2U) /*!< Bit position for NV_FOPT_NMI_DIS. */
813 #define BM_NV_FOPT_NMI_DIS (0x04U) /*!< Bit mask for NV_FOPT_NMI_DIS. */
814 #define BS_NV_FOPT_NMI_DIS (1U) /*!< Bit field size in bits for NV_FOPT_NMI_DIS. */
816 /*! @brief Read current value of the NV_FOPT_NMI_DIS field. */
817 #define BR_NV_FOPT_NMI_DIS(x) (BITBAND_ACCESS8(HW_NV_FOPT_ADDR(x), BP_NV_FOPT_NMI_DIS))
821 * @name Register NV_FOPT, field FAST_INIT[5] (RO)
824 * - 00 - Slower initialization
825 * - 01 - Fast Initialization
828 #define BP_NV_FOPT_FAST_INIT (5U) /*!< Bit position for NV_FOPT_FAST_INIT. */
829 #define BM_NV_FOPT_FAST_INIT (0x20U) /*!< Bit mask for NV_FOPT_FAST_INIT. */
830 #define BS_NV_FOPT_FAST_INIT (1U) /*!< Bit field size in bits for NV_FOPT_FAST_INIT. */
832 /*! @brief Read current value of the NV_FOPT_FAST_INIT field. */
833 #define BR_NV_FOPT_FAST_INIT(x) (BITBAND_ACCESS8(HW_NV_FOPT_ADDR(x), BP_NV_FOPT_FAST_INIT))
836 /*******************************************************************************
837 * hw_nv_t - module struct
838 ******************************************************************************/
840 * @brief All NV module registers.
843 typedef struct _hw_nv
845 __I hw_nv_backkey3_t BACKKEY3; /*!< [0x0] Backdoor Comparison Key 3. */
846 __I hw_nv_backkey2_t BACKKEY2; /*!< [0x1] Backdoor Comparison Key 2. */
847 __I hw_nv_backkey1_t BACKKEY1; /*!< [0x2] Backdoor Comparison Key 1. */
848 __I hw_nv_backkey0_t BACKKEY0; /*!< [0x3] Backdoor Comparison Key 0. */
849 __I hw_nv_backkey7_t BACKKEY7; /*!< [0x4] Backdoor Comparison Key 7. */
850 __I hw_nv_backkey6_t BACKKEY6; /*!< [0x5] Backdoor Comparison Key 6. */
851 __I hw_nv_backkey5_t BACKKEY5; /*!< [0x6] Backdoor Comparison Key 5. */
852 __I hw_nv_backkey4_t BACKKEY4; /*!< [0x7] Backdoor Comparison Key 4. */
853 __I hw_nv_fprot3_t FPROT3; /*!< [0x8] Non-volatile P-Flash Protection 1 - Low Register */
854 __I hw_nv_fprot2_t FPROT2; /*!< [0x9] Non-volatile P-Flash Protection 1 - High Register */
855 __I hw_nv_fprot1_t FPROT1; /*!< [0xA] Non-volatile P-Flash Protection 0 - Low Register */
856 __I hw_nv_fprot0_t FPROT0; /*!< [0xB] Non-volatile P-Flash Protection 0 - High Register */
857 __I hw_nv_fsec_t FSEC; /*!< [0xC] Non-volatile Flash Security Register */
858 __I hw_nv_fopt_t FOPT; /*!< [0xD] Non-volatile Flash Option Register */
862 /*! @brief Macro to access all NV registers. */
863 /*! @param x NV module instance base address. */
864 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
865 * use the '&' operator, like <code>&HW_NV(FTFA_FlashConfig_BASE)</code>. */
866 #define HW_NV(x) (*(hw_nv_t *)(x))
868 #endif /* __HW_NV_REGISTERS_H__ */