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: MKL27Z32VDA4
AnnaBridge 171:3a7713b1edbc 4 ** MKL27Z32VFM4
AnnaBridge 171:3a7713b1edbc 5 ** MKL27Z32VFT4
AnnaBridge 171:3a7713b1edbc 6 ** MKL27Z32VLH4
AnnaBridge 171:3a7713b1edbc 7 ** MKL27Z32VMP4
AnnaBridge 171:3a7713b1edbc 8 ** MKL27Z64VDA4
AnnaBridge 171:3a7713b1edbc 9 ** MKL27Z64VFM4
AnnaBridge 171:3a7713b1edbc 10 ** MKL27Z64VFT4
AnnaBridge 171:3a7713b1edbc 11 ** MKL27Z64VLH4
AnnaBridge 171:3a7713b1edbc 12 ** MKL27Z64VMP4
AnnaBridge 171:3a7713b1edbc 13 **
AnnaBridge 171:3a7713b1edbc 14 ** Compilers: Keil ARM C/C++ Compiler
AnnaBridge 171:3a7713b1edbc 15 ** Freescale C/C++ for Embedded ARM
AnnaBridge 171:3a7713b1edbc 16 ** GNU C Compiler
AnnaBridge 171:3a7713b1edbc 17 ** IAR ANSI C/C++ Compiler for ARM
AnnaBridge 171:3a7713b1edbc 18 **
AnnaBridge 171:3a7713b1edbc 19 ** Reference manual: KL27P64M48SF2RM, Rev. 1, Sep 2014
AnnaBridge 171:3a7713b1edbc 20 ** Version: rev. 1.4, 2014-09-22
AnnaBridge 171:3a7713b1edbc 21 ** Build: b151217
AnnaBridge 171:3a7713b1edbc 22 **
AnnaBridge 171:3a7713b1edbc 23 ** Abstract:
AnnaBridge 171:3a7713b1edbc 24 ** Provides a system configuration function and a global variable that
AnnaBridge 171:3a7713b1edbc 25 ** contains the system frequency. It configures the device and initializes
AnnaBridge 171:3a7713b1edbc 26 ** the oscillator (PLL) that is part of the microcontroller device.
AnnaBridge 171:3a7713b1edbc 27 **
AnnaBridge 171:3a7713b1edbc 28 ** Copyright (c) 2015 Freescale Semiconductor, Inc.
AnnaBridge 171:3a7713b1edbc 29 ** All rights reserved.
AnnaBridge 171:3a7713b1edbc 30 **
AnnaBridge 171:3a7713b1edbc 31 ** Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 171:3a7713b1edbc 32 ** are permitted provided that the following conditions are met:
AnnaBridge 171:3a7713b1edbc 33 **
AnnaBridge 171:3a7713b1edbc 34 ** o Redistributions of source code must retain the above copyright notice, this list
AnnaBridge 171:3a7713b1edbc 35 ** of conditions and the following disclaimer.
AnnaBridge 171:3a7713b1edbc 36 **
AnnaBridge 171:3a7713b1edbc 37 ** o Redistributions in binary form must reproduce the above copyright notice, this
AnnaBridge 171:3a7713b1edbc 38 ** list of conditions and the following disclaimer in the documentation and/or
AnnaBridge 171:3a7713b1edbc 39 ** other materials provided with the distribution.
AnnaBridge 171:3a7713b1edbc 40 **
AnnaBridge 171:3a7713b1edbc 41 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
AnnaBridge 171:3a7713b1edbc 42 ** contributors may be used to endorse or promote products derived from this
AnnaBridge 171:3a7713b1edbc 43 ** software without specific prior written permission.
AnnaBridge 171:3a7713b1edbc 44 **
AnnaBridge 171:3a7713b1edbc 45 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
AnnaBridge 171:3a7713b1edbc 46 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
AnnaBridge 171:3a7713b1edbc 47 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 171:3a7713b1edbc 48 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
AnnaBridge 171:3a7713b1edbc 49 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
AnnaBridge 171:3a7713b1edbc 50 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
AnnaBridge 171:3a7713b1edbc 51 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
AnnaBridge 171:3a7713b1edbc 52 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
AnnaBridge 171:3a7713b1edbc 53 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
AnnaBridge 171:3a7713b1edbc 54 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 171:3a7713b1edbc 55 **
AnnaBridge 171:3a7713b1edbc 56 ** http: www.freescale.com
AnnaBridge 171:3a7713b1edbc 57 ** mail: support@freescale.com
AnnaBridge 171:3a7713b1edbc 58 **
AnnaBridge 171:3a7713b1edbc 59 ** Revisions:
AnnaBridge 171:3a7713b1edbc 60 ** - rev. 1.0 (2014-05-12)
AnnaBridge 171:3a7713b1edbc 61 ** Initial version.
AnnaBridge 171:3a7713b1edbc 62 ** - rev. 1.1 (2014-07-10)
AnnaBridge 171:3a7713b1edbc 63 ** UART0 - UART0 module renamed to UART2.
AnnaBridge 171:3a7713b1edbc 64 ** - rev. 1.2 (2014-08-12)
AnnaBridge 171:3a7713b1edbc 65 ** CRC - CRC register renamed to DATA.
AnnaBridge 171:3a7713b1edbc 66 ** - rev. 1.3 (2014-09-02)
AnnaBridge 171:3a7713b1edbc 67 ** USB - USB0_CTL0 was renamed to USB0_OTGCTL register.
AnnaBridge 171:3a7713b1edbc 68 ** USB - USB0_CTL1 was renamed to USB0_CTL register.
AnnaBridge 171:3a7713b1edbc 69 ** USB - Two new bitfields (STOP_ACK_DLY_EN, AHB_DLY_EN) was added to the USB0_KEEP_ALIVE_CTRL register.
AnnaBridge 171:3a7713b1edbc 70 ** - rev. 1.4 (2014-09-22)
AnnaBridge 171:3a7713b1edbc 71 ** FLEXIO - Offsets of the SHIFTBUFBIS registers were interchanged with offsets of the SHIFTBUFBBS registers.
AnnaBridge 171:3a7713b1edbc 72 ** SIM - Changed bitfield value MCGIRCLK to LIRC_CLK of bitfield CLKOUTSEL in SOPT2 register.
AnnaBridge 171:3a7713b1edbc 73 ** SIM - Removed bitfield DIEID in SDID register.
AnnaBridge 171:3a7713b1edbc 74 ** UART2 - Removed ED register.
AnnaBridge 171:3a7713b1edbc 75 ** UART2 - Removed MODEM register.
AnnaBridge 171:3a7713b1edbc 76 ** UART2 - Removed IR register.
AnnaBridge 171:3a7713b1edbc 77 ** UART2 - Removed PFIFO register.
AnnaBridge 171:3a7713b1edbc 78 ** UART2 - Removed CFIFO register.
AnnaBridge 171:3a7713b1edbc 79 ** UART2 - Removed SFIFO register.
AnnaBridge 171:3a7713b1edbc 80 ** UART2 - Removed TWFIFO register.
AnnaBridge 171:3a7713b1edbc 81 ** UART2 - Removed TCFIFO register.
AnnaBridge 171:3a7713b1edbc 82 ** UART2 - Removed RWFIFO register.
AnnaBridge 171:3a7713b1edbc 83 ** UART2 - Removed RCFIFO register.
AnnaBridge 171:3a7713b1edbc 84 ** USB - Removed bitfield REG_EN in CLK_RECOVER_IRC_EN register.
AnnaBridge 171:3a7713b1edbc 85 ** USB - Renamed USBEN bitfield of USB0_CTL was renamed to USBENSOFEN.
AnnaBridge 171:3a7713b1edbc 86 **
AnnaBridge 171:3a7713b1edbc 87 ** ###################################################################
AnnaBridge 171:3a7713b1edbc 88 */
AnnaBridge 171:3a7713b1edbc 89
AnnaBridge 171:3a7713b1edbc 90 /*!
AnnaBridge 171:3a7713b1edbc 91 * @file MKL27Z644
AnnaBridge 171:3a7713b1edbc 92 * @version 1.4
AnnaBridge 171:3a7713b1edbc 93 * @date 2014-09-22
AnnaBridge 171:3a7713b1edbc 94 * @brief Device specific configuration file for MKL27Z644 (header file)
AnnaBridge 171:3a7713b1edbc 95 *
AnnaBridge 171:3a7713b1edbc 96 * Provides a system configuration function and a global variable that contains
AnnaBridge 171:3a7713b1edbc 97 * the system frequency. It configures the device and initializes the oscillator
AnnaBridge 171:3a7713b1edbc 98 * (PLL) that is part of the microcontroller device.
AnnaBridge 171:3a7713b1edbc 99 */
AnnaBridge 171:3a7713b1edbc 100
AnnaBridge 171:3a7713b1edbc 101 #ifndef _SYSTEM_MKL27Z644_H_
AnnaBridge 171:3a7713b1edbc 102 #define _SYSTEM_MKL27Z644_H_ /**< Symbol preventing repeated inclusion */
AnnaBridge 171:3a7713b1edbc 103
AnnaBridge 171:3a7713b1edbc 104 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 105 extern "C" {
AnnaBridge 171:3a7713b1edbc 106 #endif
AnnaBridge 171:3a7713b1edbc 107
AnnaBridge 171:3a7713b1edbc 108 #include <stdint.h>
AnnaBridge 171:3a7713b1edbc 109
AnnaBridge 171:3a7713b1edbc 110
AnnaBridge 171:3a7713b1edbc 111 #ifndef DISABLE_WDOG
AnnaBridge 171:3a7713b1edbc 112 #define DISABLE_WDOG 1
AnnaBridge 171:3a7713b1edbc 113 #endif
AnnaBridge 171:3a7713b1edbc 114
AnnaBridge 171:3a7713b1edbc 115 #ifndef ACK_ISOLATION
AnnaBridge 171:3a7713b1edbc 116 #define ACK_ISOLATION 1
AnnaBridge 171:3a7713b1edbc 117 #endif
AnnaBridge 171:3a7713b1edbc 118
AnnaBridge 171:3a7713b1edbc 119 /* Define clock source values */
AnnaBridge 171:3a7713b1edbc 120
AnnaBridge 171:3a7713b1edbc 121 #define CPU_XTAL_CLK_HZ 32768u /* Value of the external crystal or oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 122 #define CPU_INT_FAST_CLK_HZ 48000000u /* Value of the fast internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 123 #define CPU_INT_IRC_CLK_HZ 48000000u /* Value of the 48M internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 124
AnnaBridge 171:3a7713b1edbc 125 /* Low power mode enable */
AnnaBridge 171:3a7713b1edbc 126 /* SMC_PMPROT: AVLP=1,AVLLS=1 */
AnnaBridge 171:3a7713b1edbc 127 #define SYSTEM_SMC_PMPROT_VALUE 0x2Au /* SMC_PMPROT */
AnnaBridge 171:3a7713b1edbc 128
AnnaBridge 171:3a7713b1edbc 129 #define DEFAULT_SYSTEM_CLOCK 8000000u /* Default System clock value */
AnnaBridge 171:3a7713b1edbc 130 #define CPU_INT_SLOW_CLK_HZ 8000000u /* Value of the slow internal oscillator clock frequency in Hz */
AnnaBridge 171:3a7713b1edbc 131
AnnaBridge 171:3a7713b1edbc 132
AnnaBridge 171:3a7713b1edbc 133 /**
AnnaBridge 171:3a7713b1edbc 134 * @brief System clock frequency (core clock)
AnnaBridge 171:3a7713b1edbc 135 *
AnnaBridge 171:3a7713b1edbc 136 * The system clock frequency supplied to the SysTick timer and the processor
AnnaBridge 171:3a7713b1edbc 137 * core clock. This variable can be used by the user application to setup the
AnnaBridge 171:3a7713b1edbc 138 * SysTick timer or configure other parameters. It may also be used by debugger to
AnnaBridge 171:3a7713b1edbc 139 * query the frequency of the debug timer or configure the trace clock speed
AnnaBridge 171:3a7713b1edbc 140 * SystemCoreClock is initialized with a correct predefined value.
AnnaBridge 171:3a7713b1edbc 141 */
AnnaBridge 171:3a7713b1edbc 142 extern uint32_t SystemCoreClock;
AnnaBridge 171:3a7713b1edbc 143
AnnaBridge 171:3a7713b1edbc 144 /**
AnnaBridge 171:3a7713b1edbc 145 * @brief Setup the microcontroller system.
AnnaBridge 171:3a7713b1edbc 146 *
AnnaBridge 171:3a7713b1edbc 147 * Typically this function configures the oscillator (PLL) that is part of the
AnnaBridge 171:3a7713b1edbc 148 * microcontroller device. For systems with variable clock speed it also updates
AnnaBridge 171:3a7713b1edbc 149 * the variable SystemCoreClock. SystemInit is called from startup_device file.
AnnaBridge 171:3a7713b1edbc 150 */
AnnaBridge 171:3a7713b1edbc 151 void SystemInit (void);
AnnaBridge 171:3a7713b1edbc 152
AnnaBridge 171:3a7713b1edbc 153 /**
AnnaBridge 171:3a7713b1edbc 154 * @brief Updates the SystemCoreClock variable.
AnnaBridge 171:3a7713b1edbc 155 *
AnnaBridge 171:3a7713b1edbc 156 * It must be called whenever the core clock is changed during program
AnnaBridge 171:3a7713b1edbc 157 * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
AnnaBridge 171:3a7713b1edbc 158 * the current core clock.
AnnaBridge 171:3a7713b1edbc 159 */
AnnaBridge 171:3a7713b1edbc 160 void SystemCoreClockUpdate (void);
AnnaBridge 171:3a7713b1edbc 161
AnnaBridge 171:3a7713b1edbc 162 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 163 }
AnnaBridge 171:3a7713b1edbc 164 #endif
AnnaBridge 171:3a7713b1edbc 165
AnnaBridge 171:3a7713b1edbc 166 #endif /* _SYSTEM_MKL27Z644_H_ */