1 /* 2 ** ################################################################### 3 ** Processor: MK27FN2M0AVMI15 4 ** Compilers: Freescale C/C++ for Embedded ARM 5 ** GNU C Compiler 6 ** IAR ANSI C/C++ Compiler for ARM 7 ** Keil ARM C/C++ Compiler 8 ** MCUXpresso Compiler 9 ** 10 ** Reference manual: K27P169M150SF5RM, Rev. 2, Aug 2017 11 ** Version: rev. 1.3, 2018-01-09 12 ** Build: b181105 13 ** 14 ** Abstract: 15 ** Provides a system configuration function and a global variable that 16 ** contains the system frequency. It configures the device and initializes 17 ** the oscillator (PLL) that is part of the microcontroller device. 18 ** 19 ** Copyright 2016 Freescale Semiconductor, Inc. 20 ** Copyright 2016-2018 NXP 21 ** All rights reserved. 22 ** 23 ** SPDX-License-Identifier: BSD-3-Clause 24 ** 25 ** http: www.nxp.com 26 ** mail: support@nxp.com 27 ** 28 ** Revisions: 29 ** - rev. 1.0 (2016-05-10) 30 ** Initial version 31 ** - rev. 1.1 (2016-10-20) 32 ** Update based on Rev1 RM. 33 ** - rev. 1.2 (2017-04-06) 34 ** Remove TSI. 35 ** Add ISD2FA, ISD3FA, ISD2FB and ISD3FB bits in QuadSPI0_MCR. 36 ** - rev. 1.3 (2018-01-09) 37 ** Add K28FA support. 38 ** 39 ** ################################################################### 40 */ 41 42 /*! 43 * @file MK27FA15 44 * @version 1.3 45 * @date 2018-01-09 46 * @brief Device specific configuration file for MK27FA15 (header file) 47 * 48 * Provides a system configuration function and a global variable that contains 49 * the system frequency. It configures the device and initializes the oscillator 50 * (PLL) that is part of the microcontroller device. 51 */ 52 53 #ifndef _SYSTEM_MK27FA15_H_ 54 #define _SYSTEM_MK27FA15_H_ /**< Symbol preventing repeated inclusion */ 55 56 #ifdef __cplusplus 57 extern "C" { 58 #endif 59 60 #include <stdint.h> 61 62 63 #ifndef DISABLE_WDOG 64 #define DISABLE_WDOG 1 65 #endif 66 67 /* Define clock source values */ 68 69 #define CPU_XTAL_CLK_HZ 12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */ 70 #define CPU_XTAL32k_CLK_HZ 32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC in Hz */ 71 #define CPU_INT_SLOW_CLK_HZ 32768U /* Value of the slow internal oscillator clock frequency in Hz */ 72 #define CPU_INT_FAST_CLK_HZ 4000000U /* 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 /* RTC oscillator setting */ 76 /* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */ 77 #define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */ 78 79 /* Low power mode enable */ 80 /* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */ 81 #define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */ 82 83 #define DEFAULT_SYSTEM_CLOCK 20971520u 84 85 86 /** 87 * @brief System clock frequency (core clock) 88 * 89 * The system clock frequency supplied to the SysTick timer and the processor 90 * core clock. This variable can be used by the user application to setup the 91 * SysTick timer or configure other parameters. It may also be used by debugger to 92 * query the frequency of the debug timer or configure the trace clock speed 93 * SystemCoreClock is initialized with a correct predefined value. 94 */ 95 extern uint32_t SystemCoreClock; 96 97 /** 98 * @brief Setup the microcontroller system. 99 * 100 * Typically this function configures the oscillator (PLL) that is part of the 101 * microcontroller device. For systems with variable clock speed it also updates 102 * the variable SystemCoreClock. SystemInit is called from startup_device file. 103 */ 104 void SystemInit (void); 105 106 /** 107 * @brief Updates the SystemCoreClock variable. 108 * 109 * It must be called whenever the core clock is changed during program 110 * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates 111 * the current core clock. 112 */ 113 void SystemCoreClockUpdate (void); 114 115 /** 116 * @brief SystemInit function hook. 117 * 118 * This weak function allows to call specific initialization code during the 119 * SystemInit() execution.This can be used when an application specific code needs 120 * to be called as close to the reset entry as possible (for example the Multicore 121 * Manager MCMGR_EarlyInit() function call). 122 * NOTE: No global r/w variables can be used in this hook function because the 123 * initialization of these variables happens after this function. 124 */ 125 void SystemInitHook (void); 126 127 #ifdef __cplusplus 128 } 129 #endif 130 131 #endif /* _SYSTEM_MK27FA15_H_ */ 132