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