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