1 /*
2 ** ###################################################################
3 **     Processors:          MIMXRT1064CVJ5A
4 **                          MIMXRT1064CVL5A
5 **                          MIMXRT1064DVJ6A
6 **                          MIMXRT1064DVL6A
7 **
8 **     Compilers:           Freescale C/C++ for Embedded ARM
9 **                          GNU C Compiler
10 **                          IAR ANSI C/C++ Compiler for ARM
11 **                          Keil ARM C/C++ Compiler
12 **                          MCUXpresso Compiler
13 **
14 **     Reference manual:    IMXRT1064RM Rev.2, 07/2021 | IMXRT106XSRM Rev.0
15 **     Version:             rev. 1.3, 2021-08-10
16 **     Build:               b210811
17 **
18 **     Abstract:
19 **         Provides a system configuration function and a global variable that
20 **         contains the system frequency. It configures the device and initializes
21 **         the oscillator (PLL) that is part of the microcontroller device.
22 **
23 **     Copyright 2016 Freescale Semiconductor, Inc.
24 **     Copyright 2016-2021 NXP
25 **     All rights reserved.
26 **
27 **     SPDX-License-Identifier: BSD-3-Clause
28 **
29 **     http:                 www.nxp.com
30 **     mail:                 support@nxp.com
31 **
32 **     Revisions:
33 **     - rev. 0.1 (2018-06-22)
34 **         Initial version.
35 **     - rev. 1.0 (2018-11-16)
36 **         Update header files to align with IMXRT1064RM Rev.0.
37 **     - rev. 1.1 (2018-11-27)
38 **         Update header files to align with IMXRT1064RM Rev.0.1.
39 **     - rev. 1.2 (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.3 (2021-08-10)
42 **         Update header files to align with IMXRT1064RM Rev.2.
43 **
44 ** ###################################################################
45 */
46 
47 /*!
48  * @file MIMXRT1064
49  * @version 1.3
50  * @date 2021-08-10
51  * @brief Device specific configuration file for MIMXRT1064 (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_MIMXRT1064_H_
59 #define _SYSTEM_MIMXRT1064_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 CPU_CLK1_HZ                    0UL                 /* Value of the CLK1 (select the CLK1_N/CLK1_P as source) frequency in Hz */
77                                                            /* If CLOCK1_P,CLOCK1_N is choose as the pll bypass clock source, please implement the CLKPN_FREQ define, otherwise 0 will be returned. */
78 
79 #define DEFAULT_SYSTEM_CLOCK           528000000UL         /* Default System clock value */
80 
81 
82 /**
83  * @brief System clock frequency (core clock)
84  *
85  * The system clock frequency supplied to the SysTick timer and the processor
86  * core clock. This variable can be used by the user application to setup the
87  * SysTick timer or configure other parameters. It may also be used by debugger to
88  * query the frequency of the debug timer or configure the trace clock speed
89  * SystemCoreClock is initialized with a correct predefined value.
90  */
91 extern uint32_t SystemCoreClock;
92 
93 /**
94  * @brief Setup the microcontroller system.
95  *
96  * Typically this function configures the oscillator (PLL) that is part of the
97  * microcontroller device. For systems with variable clock speed it also updates
98  * the variable SystemCoreClock. SystemInit is called from startup_device file.
99  */
100 void SystemInit (void);
101 
102 /**
103  * @brief Updates the SystemCoreClock variable.
104  *
105  * It must be called whenever the core clock is changed during program
106  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
107  * the current core clock.
108  */
109 void SystemCoreClockUpdate (void);
110 
111 /**
112  * @brief SystemInit function hook.
113  *
114  * This weak function allows to call specific initialization code during the
115  * SystemInit() execution.This can be used when an application specific code needs
116  * to be called as close to the reset entry as possible (for example the Multicore
117  * Manager MCMGR_EarlyInit() function call).
118  * NOTE: No global r/w variables can be used in this hook function because the
119  * initialization of these variables happens after this function.
120  */
121 void SystemInitHook (void);
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif  /* _SYSTEM_MIMXRT1064_H_ */
128