1 /*
2 ** ###################################################################
3 **     Processors:          MKM14Z128ACHH5
4 **                          MKM14Z64ACHH5
5 **
6 **     Compilers:           Freescale C/C++ for Embedded ARM
7 **                          GNU C Compiler
8 **                          IAR ANSI C/C++ Compiler for ARM
9 **                          Keil ARM C/C++ Compiler
10 **                          MCUXpresso Compiler
11 **
12 **     Reference manual:    MKMxxZxxACxx5RM, Rev. 2, 10/2017
13 **     Version:             rev. 1.0, 2014-07-22
14 **     Build:               b201216
15 **
16 **     Abstract:
17 **         Provides a system configuration function and a global variable that
18 **         contains the system frequency. It configures the device and initializes
19 **         the oscillator (PLL) that is part of the microcontroller device.
20 **
21 **     Copyright 2016 Freescale Semiconductor, Inc.
22 **     Copyright 2016-2020 NXP
23 **     All rights reserved.
24 **
25 **     SPDX-License-Identifier: BSD-3-Clause
26 **
27 **     http:                 www.nxp.com
28 **     mail:                 support@nxp.com
29 **
30 **     Revisions:
31 **     - rev. 1.0 (2014-07-22)
32 **         Initial version.
33 **
34 ** ###################################################################
35 */
36 
37 /*!
38  * @file MKM14ZA5
39  * @version 1.0
40  * @date 2014-07-22
41  * @brief Device specific configuration file for MKM14ZA5 (header file)
42  *
43  * Provides a system configuration function and a global variable that contains
44  * the system frequency. It configures the device and initializes the oscillator
45  * (PLL) that is part of the microcontroller device.
46  */
47 
48 #ifndef _SYSTEM_MKM14ZA5_H_
49 #define _SYSTEM_MKM14ZA5_H_                      /**< Symbol preventing repeated inclusion */
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 #include <stdint.h>
56 
57 
58 #ifndef DISABLE_WDOG
59   #define DISABLE_WDOG                 1
60 #endif
61 
62 /* Define clock source values */
63 
64 #define CPU_XTAL_CLK_HZ                8000000u            /* Value of the external crystal or oscillator clock frequency in Hz */
65 #define CPU_XTAL32k_CLK_HZ             32768u              /* Value of the external 32k crystal or oscillator clock frequency in Hz */
66 #define CPU_INT_SLOW_CLK_HZ            32768u              /* Value of the slow internal oscillator clock frequency in Hz  */
67 #define CPU_INT_FAST_CLK_HZ            4000000u            /* Value of the fast internal oscillator clock frequency in Hz  */
68 
69 /* Low power mode enable */
70 /* SMC_PMPROT: AVLP=1,AVLLS=1 */
71 #define SYSTEM_SMC_PMPROT_VALUE        0x22U               /* SMC_PMPROT */
72 
73 #define DEFAULT_SYSTEM_CLOCK           2000000u            /* Default System clock value */
74 
75 
76 /**
77  * @brief System clock frequency (core clock)
78  *
79  * The system clock frequency supplied to the SysTick timer and the processor
80  * core clock. This variable can be used by the user application to setup the
81  * SysTick timer or configure other parameters. It may also be used by debugger to
82  * query the frequency of the debug timer or configure the trace clock speed
83  * SystemCoreClock is initialized with a correct predefined value.
84  */
85 extern uint32_t SystemCoreClock;
86 
87 /**
88  * @brief Setup the microcontroller system.
89  *
90  * Typically this function configures the oscillator (PLL) that is part of the
91  * microcontroller device. For systems with variable clock speed it also updates
92  * the variable SystemCoreClock. SystemInit is called from startup_device file.
93  */
94 void SystemInit (void);
95 
96 /**
97  * @brief Updates the SystemCoreClock variable.
98  *
99  * It must be called whenever the core clock is changed during program
100  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
101  * the current core clock.
102  */
103 void SystemCoreClockUpdate (void);
104 
105 /**
106  * @brief SystemInit function hook.
107  *
108  * This weak function allows to call specific initialization code during the
109  * SystemInit() execution.This can be used when an application specific code needs
110  * to be called as close to the reset entry as possible (for example the Multicore
111  * Manager MCMGR_EarlyInit() function call).
112  * NOTE: No global r/w variables can be used in this hook function because the
113  * initialization of these variables happens after this function.
114  */
115 void SystemInitHook (void);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif  /* _SYSTEM_MKM14ZA5_H_ */
122