1 /*
2 ** ###################################################################
3 **     Processors:          MKM34Z256VLL7
4 **                          MKM34Z256VLQ7
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:    KM34P144M75SF0RM, Rev.1, Jan 2015
13 **     Version:             rev. 1.2, 2015-03-06
14 **     Build:               b201125
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-10-17)
32 **         Initial version.
33 **     - rev. 1.1 (2015-01-27)
34 **         Update according to reference manual rev. 1, RC.
35 **     - rev. 1.2 (2015-03-06)
36 **         Update according to reference manual rev. 1.
37 **
38 ** ###################################################################
39 */
40 
41 /*!
42  * @file MKM34Z7
43  * @version 1.2
44  * @date 2015-03-06
45  * @brief Device specific configuration file for MKM34Z7 (header file)
46  *
47  * Provides a system configuration function and a global variable that contains
48  * the system frequency. It configures the device and initializes the oscillator
49  * (PLL) that is part of the microcontroller device.
50  */
51 
52 #ifndef _SYSTEM_MKM34Z7_H_
53 #define _SYSTEM_MKM34Z7_H_ /**< Symbol preventing repeated inclusion */
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #include <stdint.h>
60 
61 #ifndef DISABLE_WDOG
62 #define DISABLE_WDOG 1
63 #endif
64 
65 /* Define clock source values */
66 
67 #define CPU_XTAL_CLK_HZ     8000000u /* Value of the external crystal or oscillator clock frequency in Hz */
68 #define CPU_XTAL32k_CLK_HZ  32768u   /* Value of the external 32k crystal or oscillator clock frequency in Hz */
69 #define CPU_INT_SLOW_CLK_HZ 32768u   /* Value of the slow internal oscillator clock frequency in Hz  */
70 #define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz  */
71 
72 /* Low power mode enable */
73 /* SMC_PMPROT: AVLP=1,AVLLS=1 */
74 #define SYSTEM_SMC_PMPROT_VALUE 0x22U /* SMC_PMPROT */
75 
76 #define DEFAULT_SYSTEM_CLOCK 2000000u /* Default System clock value */
77 
78 /**
79  * @brief System clock frequency (core clock)
80  *
81  * The system clock frequency supplied to the SysTick timer and the processor
82  * core clock. This variable can be used by the user application to setup the
83  * SysTick timer or configure other parameters. It may also be used by debugger to
84  * query the frequency of the debug timer or configure the trace clock speed
85  * SystemCoreClock is initialized with a correct predefined value.
86  */
87 extern uint32_t SystemCoreClock;
88 
89 /**
90  * @brief Setup the microcontroller system.
91  *
92  * Typically this function configures the oscillator (PLL) that is part of the
93  * microcontroller device. For systems with variable clock speed it also updates
94  * the variable SystemCoreClock. SystemInit is called from startup_device file.
95  */
96 void SystemInit(void);
97 
98 /**
99  * @brief Updates the SystemCoreClock variable.
100  *
101  * It must be called whenever the core clock is changed during program
102  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
103  * the current core clock.
104  */
105 void SystemCoreClockUpdate(void);
106 
107 /**
108  * @brief SystemInit function hook.
109  *
110  * This weak function allows to call specific initialization code during the
111  * SystemInit() execution.This can be used when an application specific code needs
112  * to be called as close to the reset entry as possible (for example the Multicore
113  * Manager MCMGR_EarlyInit() function call).
114  * NOTE: No global r/w variables can be used in this hook function because the
115  * initialization of these variables happens after this function.
116  */
117 void SystemInitHook(void);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* _SYSTEM_MKM34Z7_H_ */
124