1 /*
2 ** ###################################################################
3 **     Processors:          MKL17Z32VDA4
4 **                          MKL17Z32VFM4
5 **                          MKL17Z32VFT4
6 **                          MKL17Z32VLH4
7 **                          MKL17Z32VMP4
8 **                          MKL17Z64VDA4
9 **                          MKL17Z64VFM4
10 **                          MKL17Z64VFT4
11 **                          MKL17Z64VLH4
12 **                          MKL17Z64VMP4
13 **
14 **     Compilers:           Keil ARM C/C++ Compiler
15 **                          Freescale C/C++ for Embedded ARM
16 **                          GNU C Compiler
17 **                          IAR ANSI C/C++ Compiler for ARM
18 **                          MCUXpresso Compiler
19 **
20 **     Reference manual:    KL17P64M48SF2RM, Rev. 1, Sep 2014
21 **     Version:             rev. 1.4, 2016-02-02
22 **     Build:               b180801
23 **
24 **     Abstract:
25 **         Provides a system configuration function and a global variable that
26 **         contains the system frequency. It configures the device and initializes
27 **         the oscillator (PLL) that is part of the microcontroller device.
28 **
29 **     Copyright 2016 Freescale Semiconductor, Inc.
30 **     Copyright 2016-2018 NXP
31 **
32 **     SPDX-License-Identifier: BSD-3-Clause
33 **
34 **     http:                 www.nxp.com
35 **     mail:                 support@nxp.com
36 **
37 **     Revisions:
38 **     - rev. 1.0 (2014-05-12)
39 **         Initial version.
40 **     - rev. 1.1 (2014-07-10)
41 **         UART0 - UART0 module renamed to UART2.
42 **     - rev. 1.2 (2014-08-12)
43 **         CRC - CRC register renamed to DATA.
44 **     - rev. 1.3 (2014-09-22)
45 **         FLEXIO - Offsets of the SHIFTBUFBIS registers were interchanged with offsets of the SHIFTBUFBBS registers.
46 **         SIM - Changed bitfield value MCGIRCLK to LIRC_CLK of bitfield CLKOUTSEL in SOPT2 register.
47 **         SIM - Removed bitfield DIEID in SDID register.
48 **         UART2 - Removed ED register.
49 **         UART2 - Removed MODEM register.
50 **         UART2 - Removed IR register.
51 **         UART2 - Removed PFIFO register.
52 **         UART2 - Removed CFIFO register.
53 **         UART2 - Removed SFIFO register.
54 **         UART2 - Removed TWFIFO register.
55 **         UART2 - Removed TCFIFO register.
56 **         UART2 - Removed RWFIFO register.
57 **         UART2 - Removed RCFIFO register.
58 **     - rev. 1.4 (2016-02-02)
59 **         FGPIO - Add FGPIO registers.
60 **
61 ** ###################################################################
62 */
63 
64 /*!
65  * @file MKL17Z644
66  * @version 1.4
67  * @date 2016-02-02
68  * @brief Device specific configuration file for MKL17Z644 (header file)
69  *
70  * Provides a system configuration function and a global variable that contains
71  * the system frequency. It configures the device and initializes the oscillator
72  * (PLL) that is part of the microcontroller device.
73  */
74 
75 #ifndef _SYSTEM_MKL17Z644_H_
76 #define _SYSTEM_MKL17Z644_H_                     /**< Symbol preventing repeated inclusion */
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 #include <stdint.h>
83 
84 
85 #ifndef DISABLE_WDOG
86   #define DISABLE_WDOG  1
87 #endif
88 
89 #ifndef ACK_ISOLATION
90   #define ACK_ISOLATION   1
91 #endif
92 
93 /* Define clock source values */
94 
95 #define CPU_XTAL_CLK_HZ                32768u              /* Value of the external crystal or oscillator clock frequency in Hz */
96 #define CPU_INT_FAST_CLK_HZ            48000000u           /* Value of the fast internal oscillator clock frequency in Hz  */
97 #define CPU_INT_IRC_CLK_HZ             48000000u           /* Value of the 48M internal oscillator clock frequency in Hz  */
98 
99 /* Low power mode enable */
100 /* SMC_PMPROT: AVLP=1,AVLLS=1 */
101 #define SYSTEM_SMC_PMPROT_VALUE        0x2Au               /* SMC_PMPROT */
102 
103 #define DEFAULT_SYSTEM_CLOCK           8000000u            /* Default System clock value */
104 #define CPU_INT_SLOW_CLK_HZ            8000000u            /* Value of the slow internal oscillator clock frequency in Hz  */
105 
106 
107 /**
108  * @brief System clock frequency (core clock)
109  *
110  * The system clock frequency supplied to the SysTick timer and the processor
111  * core clock. This variable can be used by the user application to setup the
112  * SysTick timer or configure other parameters. It may also be used by debugger to
113  * query the frequency of the debug timer or configure the trace clock speed
114  * SystemCoreClock is initialized with a correct predefined value.
115  */
116 extern uint32_t SystemCoreClock;
117 
118 /**
119  * @brief Setup the microcontroller system.
120  *
121  * Typically this function configures the oscillator (PLL) that is part of the
122  * microcontroller device. For systems with variable clock speed it also updates
123  * the variable SystemCoreClock. SystemInit is called from startup_device file.
124  */
125 void SystemInit (void);
126 
127 /**
128  * @brief Updates the SystemCoreClock variable.
129  *
130  * It must be called whenever the core clock is changed during program
131  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
132  * the current core clock.
133  */
134 void SystemCoreClockUpdate (void);
135 
136 /**
137  * @brief SystemInit function hook.
138  *
139  * This weak function allows to call specific initialization code during the
140  * SystemInit() execution.This can be used when an application specific code needs
141  * to be called as close to the reset entry as possible (for example the Multicore
142  * Manager MCMGR_EarlyInit() function call).
143  * NOTE: No global r/w variables can be used in this hook function because the
144  * initialization of these variables happens after this function.
145  */
146 void SystemInitHook (void);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif  /* _SYSTEM_MKL17Z644_H_ */
153