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