1 /* 2 ** ################################################################### 3 ** Processors: MKV31F128VLH10 4 ** MKV31F128VLL10 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: KV31P100M100SF9RM, Rev. 1, April 25, 2014 13 ** Version: rev. 1.6, 2015-02-19 14 ** Build: b181105 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-2018 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 (2013-11-01) 32 ** Initial version. 33 ** - rev. 1.1 (2013-12-20) 34 ** Update according to reference manual rev. 0.1, 35 ** - rev. 1.2 (2014-02-10) 36 ** The declaration of clock configurations has been moved to separate header file system_MKV21F12810.h 37 ** - rev. 1.3 (2014-05-06) 38 ** Update according to reference manual rev. 1.0, 39 ** Update of system and startup files. 40 ** Module access macro module_BASES replaced by module_BASE_PTRS. 41 ** - rev. 1.4 (2014-08-28) 42 ** Update of system files - default clock configuration changed. 43 ** Update of startup files - possibility to override DefaultISR added. 44 ** - rev. 1.5 (2014-10-14) 45 ** Interrupt INT_LPTimer renamed to INT_LPTMR0, interrupt INT_Watchdog renamed to INT_WDOG_EWM. 46 ** - rev. 1.6 (2015-02-19) 47 ** Renamed interrupt vector LLW to LLWU. 48 ** 49 ** ################################################################### 50 */ 51 52 /*! 53 * @file MKV31F12810 54 * @version 1.6 55 * @date 2015-02-19 56 * @brief Device specific configuration file for MKV31F12810 (header file) 57 * 58 * Provides a system configuration function and a global variable that contains 59 * the system frequency. It configures the device and initializes the oscillator 60 * (PLL) that is part of the microcontroller device. 61 */ 62 63 #ifndef _SYSTEM_MKV31F12810_H_ 64 #define _SYSTEM_MKV31F12810_H_ /**< Symbol preventing repeated inclusion */ 65 66 #ifdef __cplusplus 67 extern "C" { 68 #endif 69 70 #include <stdint.h> 71 72 73 #ifndef DISABLE_WDOG 74 #define DISABLE_WDOG 1 75 #endif 76 77 /* Define clock source values */ 78 79 #define CPU_XTAL_CLK_HZ 8000000u /* Value of the external crystal or oscillator clock frequency in Hz */ 80 #define CPU_XTAL32k_CLK_HZ 0u /* No RTC clock available */ 81 #define CPU_INT_SLOW_CLK_HZ 32768u /* Value of the slow internal oscillator clock frequency in Hz */ 82 #define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz */ 83 #define CPU_INT_IRC_CLK_HZ 48000000u /* Value of the 48M internal oscillator clock frequency in Hz */ 84 85 /* RTC oscillator setting */ 86 87 /* Low power mode enable */ 88 /* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */ 89 #define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */ 90 91 #define DEFAULT_SYSTEM_CLOCK 20971520u /* Default System clock value */ 92 93 94 /** 95 * @brief System clock frequency (core clock) 96 * 97 * The system clock frequency supplied to the SysTick timer and the processor 98 * core clock. This variable can be used by the user application to setup the 99 * SysTick timer or configure other parameters. It may also be used by debugger to 100 * query the frequency of the debug timer or configure the trace clock speed 101 * SystemCoreClock is initialized with a correct predefined value. 102 */ 103 extern uint32_t SystemCoreClock; 104 105 /** 106 * @brief Setup the microcontroller system. 107 * 108 * Typically this function configures the oscillator (PLL) that is part of the 109 * microcontroller device. For systems with variable clock speed it also updates 110 * the variable SystemCoreClock. SystemInit is called from startup_device file. 111 */ 112 void SystemInit (void); 113 114 /** 115 * @brief Updates the SystemCoreClock variable. 116 * 117 * It must be called whenever the core clock is changed during program 118 * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates 119 * the current core clock. 120 */ 121 void SystemCoreClockUpdate (void); 122 123 /** 124 * @brief SystemInit function hook. 125 * 126 * This weak function allows to call specific initialization code during the 127 * SystemInit() execution.This can be used when an application specific code needs 128 * to be called as close to the reset entry as possible (for example the Multicore 129 * Manager MCMGR_EarlyInit() function call). 130 * NOTE: No global r/w variables can be used in this hook function because the 131 * initialization of these variables happens after this function. 132 */ 133 void SystemInitHook (void); 134 135 #ifdef __cplusplus 136 } 137 #endif 138 139 #endif /* _SYSTEM_MKV31F12810_H_ */ 140