1 /*
2 ** ###################################################################
3 **     Processors:          MKV56F1M0VLL24
4 **                          MKV56F1M0VLQ24
5 **                          MKV56F1M0VMD24
6 **                          MKV56F512VLL24
7 **                          MKV56F512VLQ24
8 **                          MKV56F512VMD24
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:    KV5XP144M240RM Rev. 3, 02/2016
17 **     Version:             rev. 0.3, 2016-02-29
18 **     Build:               b181105
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-2018 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. 0.1 (2015-02-24)
36 **         Initial version.
37 **     - rev. 0.2 (2015-10-21)
38 **         UART0 - removed LON functionality.
39 **         FMC - corrected base address.
40 **     - rev. 0.3 (2016-02-29)
41 **         PORT - removed registers GICLR, GICHR.
42 **
43 ** ###################################################################
44 */
45 
46 /*!
47  * @file MKV56F24
48  * @version 0.3
49  * @date 2016-02-29
50  * @brief Device specific configuration file for MKV56F24 (header file)
51  *
52  * Provides a system configuration function and a global variable that contains
53  * the system frequency. It configures the device and initializes the oscillator
54  * (PLL) that is part of the microcontroller device.
55  */
56 
57 #ifndef _SYSTEM_MKV56F24_H_
58 #define _SYSTEM_MKV56F24_H_                      /**< Symbol preventing repeated inclusion */
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 #include <stdint.h>
65 
66 
67 #ifndef DISABLE_WDOG
68   #define DISABLE_WDOG                 1
69 #endif
70 
71 /* Define clock source values */
72 
73 #define CPU_XTAL_CLK_HZ                50000000UL          /* Value of the external crystal or oscillator clock frequency in Hz */
74 #define CPU_INT_SLOW_CLK_HZ            32768UL             /* Value of the slow internal oscillator clock frequency in Hz  */
75 #define CPU_INT_FAST_CLK_HZ            4000000UL           /* Value of the fast internal oscillator clock frequency in Hz  */
76 
77 /* Low power mode enable */
78 
79 /* SMC_PMPROT: AHSRUN=1,?=0,AVLP=1,?=0,?=0,?=0,AVLLS=1,?=0 */
80 #define SYSTEM_SMC_PMPROT_VALUE        SMC_PMPROT_AHSRUN_MASK | SMC_PMPROT_AVLP_MASK | SMC_PMPROT_AVLLS_MASK /* Mask of allowed low power modes used to initialize power modes protection register */
81 
82 #define DEFAULT_SYSTEM_CLOCK           20971520UL         /* Default System clock value */
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_MKV56F24_H_ */
131