1 /* 2 ** ################################################################### 3 ** Processors: MKE16F256VLH16 4 ** MKE16F256VLL16 5 ** MKE16F512VLH16 6 ** MKE16F512VLL16 7 ** 8 ** Compilers: Freescale C/C++ for Embedded ARM 9 ** GNU C Compiler 10 ** IAR ANSI C/C++ Compiler for ARM 11 ** Keil ARM C/C++ Compiler 12 ** MCUXpresso Compiler 13 ** 14 ** Reference manual: KE1xFP100M168SF0RM, Rev. 2, Aug. 2016 15 ** Version: rev. 4.0, 2016-09-20 16 ** Build: b191113 17 ** 18 ** Abstract: 19 ** Provides a system configuration function and a global variable that 20 ** contains the system frequency. It configures the device and initializes 21 ** the oscillator (PLL) that is part of the microcontroller device. 22 ** 23 ** Copyright 2016 Freescale Semiconductor, Inc. 24 ** Copyright 2016-2019 NXP 25 ** All rights reserved. 26 ** 27 ** SPDX-License-Identifier: BSD-3-Clause 28 ** 29 ** http: www.nxp.com 30 ** mail: support@nxp.com 31 ** 32 ** Revisions: 33 ** - rev. 1.0 (2015-11-18) 34 ** Initial version. 35 ** - rev. 2.0 (2015-12-03) 36 ** Alpha version based on rev0 RDP. 37 ** - rev. 3.0 (2016-04-13) 38 ** Final version based on rev1 RDP. 39 ** - rev. 4.0 (2016-09-20) 40 ** Updated based on rev2 RDP. 41 ** 42 ** ################################################################### 43 */ 44 45 /*! 46 * @file MKE16F16 47 * @version 4.0 48 * @date 2016-09-20 49 * @brief Device specific configuration file for MKE16F16 (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_MKE16F16_H_ 57 #define _SYSTEM_MKE16F16_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 72 #define CPU_XTAL_CLK_HZ 8000000u /* Value of the external crystal or oscillator clock frequency in Hz */ 73 #define CPU_INT_FAST_CLK_HZ 48000000u /* Value of the fast internal oscillator clock frequency in Hz */ 74 #define CPU_INT_IRC_CLK_HZ 48000000u /* Value of the 48M internal oscillator clock frequency in Hz */ 75 76 /* Low power mode enable */ 77 /* SMC_PMPROT: AVLP=1 */ 78 #define SYSTEM_SMC_PMPROT_VALUE 0x20u /* SMC_PMPROT */ 79 #define SYSTEM_SMC_PMCTRL_VALUE 0x0u /* SMC_PMCTRL */ 80 81 #define DEFAULT_SYSTEM_CLOCK 48000000u /* Default System clock value */ 82 #define CPU_INT_SLOW_CLK_HZ 24000000u /* Value of the slow internal oscillator clock frequency in Hz */ 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_MKE16F16_H_ */ 131