1 /*
2 ** ###################################################################
3 **     Processors:          MIMXRT1061CVJ5A
4 **                          MIMXRT1061CVJ5B
5 **                          MIMXRT1061CVL5A
6 **                          MIMXRT1061CVL5B
7 **                          MIMXRT1061DVJ6A
8 **                          MIMXRT1061DVJ6B
9 **                          MIMXRT1061DVL6A
10 **                          MIMXRT1061DVL6B
11 **                          MIMXRT1061XVN5B
12 **
13 **     Compilers:           Freescale C/C++ for Embedded ARM
14 **                          GNU C Compiler
15 **                          IAR ANSI C/C++ Compiler for ARM
16 **                          Keil ARM C/C++ Compiler
17 **                          MCUXpresso Compiler
18 **
19 **     Reference manual:    IMXRT1060RM Rev.3, 07/2021 | IMXRT106XSRM Rev.0
20 **     Version:             rev. 1.4, 2022-03-25
21 **     Build:               b221009
22 **
23 **     Abstract:
24 **         Provides a system configuration function and a global variable that
25 **         contains the system frequency. It configures the device and initializes
26 **         the oscillator (PLL) that is part of the microcontroller device.
27 **
28 **     Copyright 2016 Freescale Semiconductor, Inc.
29 **     Copyright 2016-2022 NXP
30 **     All rights reserved.
31 **
32 **     SPDX-License-Identifier: BSD-3-Clause
33 **
34 **     http:                 www.nxp.com
35 **     mail:                 support@nxp.com
36 **
37 **     Revisions:
38 **     - rev. 0.1 (2017-01-10)
39 **         Initial version.
40 **     - rev. 1.0 (2018-11-16)
41 **         Update header files to align with IMXRT1060RM Rev.0.
42 **     - rev. 1.1 (2018-11-27)
43 **         Update header files to align with IMXRT1060RM Rev.1.
44 **     - rev. 1.2 (2019-04-29)
45 **         Add SET/CLR/TOG register group to register CTRL, STAT, CHANNELCTRL, CH0STAT, CH0OPTS, CH1STAT, CH1OPTS, CH2STAT, CH2OPTS, CH3STAT, CH3OPTS of DCP module.
46 **     - rev. 1.3 (2021-08-10)
47 **         Update header files to align with IMXRT1060RM Rev.3.
48 **     - rev. 1.4 (2022-03-25)
49 **         Add RT1060X device
50 **
51 ** ###################################################################
52 */
53 
54 /*!
55  * @file MIMXRT1061
56  * @version 1.4
57  * @date 2022-03-25
58  * @brief Device specific configuration file for MIMXRT1061 (header file)
59  *
60  * Provides a system configuration function and a global variable that contains
61  * the system frequency. It configures the device and initializes the oscillator
62  * (PLL) that is part of the microcontroller device.
63  */
64 
65 #ifndef _SYSTEM_MIMXRT1061_H_
66 #define _SYSTEM_MIMXRT1061_H_                    /**< Symbol preventing repeated inclusion */
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 #include <stdint.h>
73 
74 
75 #ifndef DISABLE_WDOG
76   #define DISABLE_WDOG                 1
77 #endif
78 
79 /* Define clock source values */
80 
81 #define CPU_XTAL_CLK_HZ                24000000UL          /* Value of the external crystal or oscillator clock frequency in Hz */
82 
83 #define CPU_CLK1_HZ                    0UL                 /* Value of the CLK1 (select the CLK1_N/CLK1_P as source) frequency in Hz */
84                                                            /* If CLOCK1_P,CLOCK1_N is choose as the pll bypass clock source, please implement the CLKPN_FREQ define, otherwise 0 will be returned. */
85 
86 #define DEFAULT_SYSTEM_CLOCK           528000000UL         /* Default System clock value */
87 
88 
89 /**
90  * @brief System clock frequency (core clock)
91  *
92  * The system clock frequency supplied to the SysTick timer and the processor
93  * core clock. This variable can be used by the user application to setup the
94  * SysTick timer or configure other parameters. It may also be used by debugger to
95  * query the frequency of the debug timer or configure the trace clock speed
96  * SystemCoreClock is initialized with a correct predefined value.
97  */
98 extern uint32_t SystemCoreClock;
99 
100 /**
101  * @brief Setup the microcontroller system.
102  *
103  * Typically this function configures the oscillator (PLL) that is part of the
104  * microcontroller device. For systems with variable clock speed it also updates
105  * the variable SystemCoreClock. SystemInit is called from startup_device file.
106  */
107 void SystemInit (void);
108 
109 /**
110  * @brief Updates the SystemCoreClock variable.
111  *
112  * It must be called whenever the core clock is changed during program
113  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
114  * the current core clock.
115  */
116 void SystemCoreClockUpdate (void);
117 
118 /**
119  * @brief SystemInit function hook.
120  *
121  * This weak function allows to call specific initialization code during the
122  * SystemInit() execution.This can be used when an application specific code needs
123  * to be called as close to the reset entry as possible (for example the Multicore
124  * Manager MCMGR_EarlyInit() function call).
125  * NOTE: No global r/w variables can be used in this hook function because the
126  * initialization of these variables happens after this function.
127  */
128 void SystemInitHook (void);
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif  /* _SYSTEM_MIMXRT1061_H_ */
135