The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 171:3a7713b1edbc 1 /*
AnnaBridge 171:3a7713b1edbc 2 ** ###################################################################
AnnaBridge 171:3a7713b1edbc 3 ** Processors: MK66FN2M0VLQ18
AnnaBridge 171:3a7713b1edbc 4 ** MK66FN2M0VMD18
AnnaBridge 171:3a7713b1edbc 5 ** MK66FX1M0VLQ18
AnnaBridge 171:3a7713b1edbc 6 ** MK66FX1M0VMD18
AnnaBridge 171:3a7713b1edbc 7 **
AnnaBridge 171:3a7713b1edbc 8 ** Compilers: Keil ARM C/C++ Compiler
AnnaBridge 171:3a7713b1edbc 9 ** Freescale C/C++ for Embedded ARM
AnnaBridge 171:3a7713b1edbc 10 ** GNU C Compiler
AnnaBridge 171:3a7713b1edbc 11 ** IAR ANSI C/C++ Compiler for ARM
AnnaBridge 171:3a7713b1edbc 12 ** MCUXpresso Compiler
AnnaBridge 171:3a7713b1edbc 13 **
AnnaBridge 171:3a7713b1edbc 14 ** Reference manual: K66P144M180SF5RMV2, Rev. 1, Mar 2015
AnnaBridge 171:3a7713b1edbc 15 ** Version: rev. 3.0, 2015-03-25
AnnaBridge 171:3a7713b1edbc 16 ** Build: b170112
AnnaBridge 171:3a7713b1edbc 17 **
AnnaBridge 171:3a7713b1edbc 18 ** Abstract:
AnnaBridge 171:3a7713b1edbc 19 ** Provides a system configuration function and a global variable that
AnnaBridge 171:3a7713b1edbc 20 ** contains the system frequency. It configures the device and initializes
AnnaBridge 171:3a7713b1edbc 21 ** the oscillator (PLL) that is part of the microcontroller device.
AnnaBridge 171:3a7713b1edbc 22 **
AnnaBridge 171:3a7713b1edbc 23 ** Copyright (c) 2016 Freescale Semiconductor, Inc.
AnnaBridge 171:3a7713b1edbc 24 ** Copyright 2016 - 2017 NXP
AnnaBridge 171:3a7713b1edbc 25 ** Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 171:3a7713b1edbc 26 ** are permitted provided that the following conditions are met:
AnnaBridge 171:3a7713b1edbc 27 **
AnnaBridge 171:3a7713b1edbc 28 ** o Redistributions of source code must retain the above copyright notice, this list
AnnaBridge 171:3a7713b1edbc 29 ** of conditions and the following disclaimer.
AnnaBridge 171:3a7713b1edbc 30 **
AnnaBridge 171:3a7713b1edbc 31 ** o Redistributions in binary form must reproduce the above copyright notice, this
AnnaBridge 171:3a7713b1edbc 32 ** list of conditions and the following disclaimer in the documentation and/or
AnnaBridge 171:3a7713b1edbc 33 ** other materials provided with the distribution.
AnnaBridge 171:3a7713b1edbc 34 **
AnnaBridge 171:3a7713b1edbc 35 ** o Neither the name of the copyright holder nor the names of its
AnnaBridge 171:3a7713b1edbc 36 ** contributors may be used to endorse or promote products derived from this
AnnaBridge 171:3a7713b1edbc 37 ** software without specific prior written permission.
AnnaBridge 171:3a7713b1edbc 38 **
AnnaBridge 171:3a7713b1edbc 39 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
AnnaBridge 171:3a7713b1edbc 40 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
AnnaBridge 171:3a7713b1edbc 41 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 171:3a7713b1edbc 42 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
AnnaBridge 171:3a7713b1edbc 43 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
AnnaBridge 171:3a7713b1edbc 44 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
AnnaBridge 171:3a7713b1edbc 45 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
AnnaBridge 171:3a7713b1edbc 46 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
AnnaBridge 171:3a7713b1edbc 47 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
AnnaBridge 171:3a7713b1edbc 48 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 171:3a7713b1edbc 49 **
AnnaBridge 171:3a7713b1edbc 50 ** http: www.nxp.com
AnnaBridge 171:3a7713b1edbc 51 ** mail: support@nxp.com
AnnaBridge 171:3a7713b1edbc 52 **
AnnaBridge 171:3a7713b1edbc 53 ** Revisions:
AnnaBridge 171:3a7713b1edbc 54 ** - rev. 1.0 (2013-09-02)
AnnaBridge 171:3a7713b1edbc 55 ** Initial version.
AnnaBridge 171:3a7713b1edbc 56 ** - rev. 2.0 (2014-02-17)
AnnaBridge 171:3a7713b1edbc 57 ** Register accessor macros added to the memory map.
AnnaBridge 171:3a7713b1edbc 58 ** Symbols for Processor Expert memory map compatibility added to the memory map.
AnnaBridge 171:3a7713b1edbc 59 ** Startup file for gcc has been updated according to CMSIS 3.2.
AnnaBridge 171:3a7713b1edbc 60 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
AnnaBridge 171:3a7713b1edbc 61 ** Update according to reference manual rev. 2
AnnaBridge 171:3a7713b1edbc 62 ** - rev. 2.1 (2014-04-16)
AnnaBridge 171:3a7713b1edbc 63 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
AnnaBridge 171:3a7713b1edbc 64 ** - rev. 2.2 (2014-10-14)
AnnaBridge 171:3a7713b1edbc 65 ** Interrupt INT_LPTimer renamed to INT_LPTMR0, interrupt INT_Watchdog renamed to INT_WDOG_EWM.
AnnaBridge 171:3a7713b1edbc 66 ** - rev. 2.3 (2014-11-20)
AnnaBridge 171:3a7713b1edbc 67 ** Update according to reverence manual K65P169M180SF5RMV2_NDA, Rev. 0 Draft A, October 2014.
AnnaBridge 171:3a7713b1edbc 68 ** Update of SystemInit() to use 16MHz external crystal.
AnnaBridge 171:3a7713b1edbc 69 ** - rev. 2.4 (2015-02-19)
AnnaBridge 171:3a7713b1edbc 70 ** Renamed interrupt vector LLW to LLWU.
AnnaBridge 171:3a7713b1edbc 71 ** - rev. 3.0 (2015-03-25)
AnnaBridge 171:3a7713b1edbc 72 ** Registers updated according to the reference manual revision 1, March 2015
AnnaBridge 171:3a7713b1edbc 73 **
AnnaBridge 171:3a7713b1edbc 74 ** ###################################################################
AnnaBridge 171:3a7713b1edbc 75 */
AnnaBridge 171:3a7713b1edbc 76
AnnaBridge 171:3a7713b1edbc 77 /*!
AnnaBridge 171:3a7713b1edbc 78 * @file MK66F18
AnnaBridge 171:3a7713b1edbc 79 * @version 3.0
AnnaBridge 171:3a7713b1edbc 80 * @date 2015-03-25
AnnaBridge 171:3a7713b1edbc 81 * @brief Device specific configuration file for MK66F18 (header file)
AnnaBridge 171:3a7713b1edbc 82 *
AnnaBridge 171:3a7713b1edbc 83 * Provides a system configuration function and a global variable that contains
AnnaBridge 171:3a7713b1edbc 84 * the system frequency. It configures the device and initializes the oscillator
AnnaBridge 171:3a7713b1edbc 85 * (PLL) that is part of the microcontroller device.
AnnaBridge 171:3a7713b1edbc 86 */
AnnaBridge 171:3a7713b1edbc 87
AnnaBridge 171:3a7713b1edbc 88 #ifndef _SYSTEM_MK66F18_H_
AnnaBridge 171:3a7713b1edbc 89 #define _SYSTEM_MK66F18_H_ /**< Symbol preventing repeated inclusion */
AnnaBridge 171:3a7713b1edbc 90
AnnaBridge 171:3a7713b1edbc 91 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 92 extern "C" {
AnnaBridge 171:3a7713b1edbc 93 #endif
AnnaBridge 171:3a7713b1edbc 94
AnnaBridge 171:3a7713b1edbc 95 #include <stdint.h>
AnnaBridge 171:3a7713b1edbc 96
AnnaBridge 171:3a7713b1edbc 97
AnnaBridge 171:3a7713b1edbc 98 #ifndef DISABLE_WDOG
AnnaBridge 171:3a7713b1edbc 99 #define DISABLE_WDOG 1
AnnaBridge 171:3a7713b1edbc 100 #endif
AnnaBridge 171:3a7713b1edbc 101
AnnaBridge 171:3a7713b1edbc 102 /* Define clock source values */
AnnaBridge 171:3a7713b1edbc 103
AnnaBridge 171:3a7713b1edbc 104 #define CPU_XTAL_CLK_HZ 16000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
AnnaBridge 171:3a7713b1edbc 105 #define CPU_XTAL32k_CLK_HZ 32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC in Hz */
AnnaBridge 171:3a7713b1edbc 106 #define CPU_INT_SLOW_CLK_HZ 32768U /* Value of the slow internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 107 #define CPU_INT_FAST_CLK_HZ 4000000U /* Value of the fast internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 108 #define CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 109
AnnaBridge 171:3a7713b1edbc 110 /* RTC oscillator setting */
AnnaBridge 171:3a7713b1edbc 111 /* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
AnnaBridge 171:3a7713b1edbc 112 #define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
AnnaBridge 171:3a7713b1edbc 113
AnnaBridge 171:3a7713b1edbc 114 /* Low power mode enable */
AnnaBridge 171:3a7713b1edbc 115 /* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
AnnaBridge 171:3a7713b1edbc 116 #define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
AnnaBridge 171:3a7713b1edbc 117
AnnaBridge 171:3a7713b1edbc 118 #define DEFAULT_SYSTEM_CLOCK 20971520u
AnnaBridge 171:3a7713b1edbc 119
AnnaBridge 171:3a7713b1edbc 120
AnnaBridge 171:3a7713b1edbc 121 /**
AnnaBridge 171:3a7713b1edbc 122 * @brief System clock frequency (core clock)
AnnaBridge 171:3a7713b1edbc 123 *
AnnaBridge 171:3a7713b1edbc 124 * The system clock frequency supplied to the SysTick timer and the processor
AnnaBridge 171:3a7713b1edbc 125 * core clock. This variable can be used by the user application to setup the
AnnaBridge 171:3a7713b1edbc 126 * SysTick timer or configure other parameters. It may also be used by debugger to
AnnaBridge 171:3a7713b1edbc 127 * query the frequency of the debug timer or configure the trace clock speed
AnnaBridge 171:3a7713b1edbc 128 * SystemCoreClock is initialized with a correct predefined value.
AnnaBridge 171:3a7713b1edbc 129 */
AnnaBridge 171:3a7713b1edbc 130 extern uint32_t SystemCoreClock;
AnnaBridge 171:3a7713b1edbc 131
AnnaBridge 171:3a7713b1edbc 132 /**
AnnaBridge 171:3a7713b1edbc 133 * @brief Setup the microcontroller system.
AnnaBridge 171:3a7713b1edbc 134 *
AnnaBridge 171:3a7713b1edbc 135 * Typically this function configures the oscillator (PLL) that is part of the
AnnaBridge 171:3a7713b1edbc 136 * microcontroller device. For systems with variable clock speed it also updates
AnnaBridge 171:3a7713b1edbc 137 * the variable SystemCoreClock. SystemInit is called from startup_device file.
AnnaBridge 171:3a7713b1edbc 138 */
AnnaBridge 171:3a7713b1edbc 139 void SystemInit (void);
AnnaBridge 171:3a7713b1edbc 140
AnnaBridge 171:3a7713b1edbc 141 /**
AnnaBridge 171:3a7713b1edbc 142 * @brief Updates the SystemCoreClock variable.
AnnaBridge 171:3a7713b1edbc 143 *
AnnaBridge 171:3a7713b1edbc 144 * It must be called whenever the core clock is changed during program
AnnaBridge 171:3a7713b1edbc 145 * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
AnnaBridge 171:3a7713b1edbc 146 * the current core clock.
AnnaBridge 171:3a7713b1edbc 147 */
AnnaBridge 171:3a7713b1edbc 148 void SystemCoreClockUpdate (void);
AnnaBridge 171:3a7713b1edbc 149
AnnaBridge 171:3a7713b1edbc 150 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 151 }
AnnaBridge 171:3a7713b1edbc 152 #endif
AnnaBridge 171:3a7713b1edbc 153
AnnaBridge 171:3a7713b1edbc 154 #endif /* _SYSTEM_MK66F18_H_ */