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.
TARGET_KL82Z/TOOLCHAIN_IAR/system_MKL82Z7.h@171:3a7713b1edbc, 2018-11-08 (annotated)
- Committer:
- AnnaBridge
- Date:
- Thu Nov 08 11:45:42 2018 +0000
- Revision:
- 171:3a7713b1edbc
- Parent:
- TARGET_USENSE/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/device/system_MKL82Z7.h@145:64910690c574
mbed library. Release version 164
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 145:64910690c574 | 1 | /* |
AnnaBridge | 145:64910690c574 | 2 | ** ################################################################### |
AnnaBridge | 145:64910690c574 | 3 | ** Processors: MKL82Z128VLH7 |
AnnaBridge | 145:64910690c574 | 4 | ** MKL82Z128VLK7 |
AnnaBridge | 145:64910690c574 | 5 | ** MKL82Z128VLL7 |
AnnaBridge | 145:64910690c574 | 6 | ** MKL82Z128VMC7 |
AnnaBridge | 145:64910690c574 | 7 | ** MKL82Z128VMP7 |
AnnaBridge | 145:64910690c574 | 8 | ** |
AnnaBridge | 145:64910690c574 | 9 | ** Compilers: Keil ARM C/C++ Compiler |
AnnaBridge | 145:64910690c574 | 10 | ** Freescale C/C++ for Embedded ARM |
AnnaBridge | 145:64910690c574 | 11 | ** GNU C Compiler |
AnnaBridge | 145:64910690c574 | 12 | ** IAR ANSI C/C++ Compiler for ARM |
AnnaBridge | 145:64910690c574 | 13 | ** |
AnnaBridge | 145:64910690c574 | 14 | ** Reference manual: KL82P121M72SF0RM, Rev.2 November 2015 |
AnnaBridge | 145:64910690c574 | 15 | ** Version: rev. 1.5, 2015-09-24 |
AnnaBridge | 145:64910690c574 | 16 | ** Build: b151217 |
AnnaBridge | 145:64910690c574 | 17 | ** |
AnnaBridge | 145:64910690c574 | 18 | ** Abstract: |
AnnaBridge | 145:64910690c574 | 19 | ** Provides a system configuration function and a global variable that |
AnnaBridge | 145:64910690c574 | 20 | ** contains the system frequency. It configures the device and initializes |
AnnaBridge | 145:64910690c574 | 21 | ** the oscillator (PLL) that is part of the microcontroller device. |
AnnaBridge | 145:64910690c574 | 22 | ** |
AnnaBridge | 145:64910690c574 | 23 | ** Copyright (c) 2015 Freescale Semiconductor, Inc. |
AnnaBridge | 145:64910690c574 | 24 | ** All rights reserved. |
AnnaBridge | 145:64910690c574 | 25 | ** |
AnnaBridge | 145:64910690c574 | 26 | ** Redistribution and use in source and binary forms, with or without modification, |
AnnaBridge | 145:64910690c574 | 27 | ** are permitted provided that the following conditions are met: |
AnnaBridge | 145:64910690c574 | 28 | ** |
AnnaBridge | 145:64910690c574 | 29 | ** o Redistributions of source code must retain the above copyright notice, this list |
AnnaBridge | 145:64910690c574 | 30 | ** of conditions and the following disclaimer. |
AnnaBridge | 145:64910690c574 | 31 | ** |
AnnaBridge | 145:64910690c574 | 32 | ** o Redistributions in binary form must reproduce the above copyright notice, this |
AnnaBridge | 145:64910690c574 | 33 | ** list of conditions and the following disclaimer in the documentation and/or |
AnnaBridge | 145:64910690c574 | 34 | ** other materials provided with the distribution. |
AnnaBridge | 145:64910690c574 | 35 | ** |
AnnaBridge | 145:64910690c574 | 36 | ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
AnnaBridge | 145:64910690c574 | 37 | ** contributors may be used to endorse or promote products derived from this |
AnnaBridge | 145:64910690c574 | 38 | ** software without specific prior written permission. |
AnnaBridge | 145:64910690c574 | 39 | ** |
AnnaBridge | 145:64910690c574 | 40 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
AnnaBridge | 145:64910690c574 | 41 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
AnnaBridge | 145:64910690c574 | 42 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
AnnaBridge | 145:64910690c574 | 43 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
AnnaBridge | 145:64910690c574 | 44 | ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
AnnaBridge | 145:64910690c574 | 45 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
AnnaBridge | 145:64910690c574 | 46 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
AnnaBridge | 145:64910690c574 | 47 | ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
AnnaBridge | 145:64910690c574 | 48 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
AnnaBridge | 145:64910690c574 | 49 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
AnnaBridge | 145:64910690c574 | 50 | ** |
AnnaBridge | 145:64910690c574 | 51 | ** http: www.freescale.com |
AnnaBridge | 145:64910690c574 | 52 | ** mail: support@freescale.com |
AnnaBridge | 145:64910690c574 | 53 | ** |
AnnaBridge | 145:64910690c574 | 54 | ** Revisions: |
AnnaBridge | 145:64910690c574 | 55 | ** - rev. 1.0 (2015-04-18) |
AnnaBridge | 145:64910690c574 | 56 | ** Initial version. |
AnnaBridge | 145:64910690c574 | 57 | ** - rev. 1.1 (2015-05-04) |
AnnaBridge | 145:64910690c574 | 58 | ** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document. |
AnnaBridge | 145:64910690c574 | 59 | ** - rev. 1.2 (2015-08-11) |
AnnaBridge | 145:64910690c574 | 60 | ** Correct clock configuration. |
AnnaBridge | 145:64910690c574 | 61 | ** - rev. 1.3 (2015-08-20) |
AnnaBridge | 145:64910690c574 | 62 | ** Align with RM Rev.1. |
AnnaBridge | 145:64910690c574 | 63 | ** - rev. 1.4 (2015-08-28) |
AnnaBridge | 145:64910690c574 | 64 | ** Update LPUART to add FIFO. |
AnnaBridge | 145:64910690c574 | 65 | ** - rev. 1.5 (2015-09-24) |
AnnaBridge | 145:64910690c574 | 66 | ** Update to align with RM Rev.1.2. |
AnnaBridge | 145:64910690c574 | 67 | ** |
AnnaBridge | 145:64910690c574 | 68 | ** ################################################################### |
AnnaBridge | 145:64910690c574 | 69 | */ |
AnnaBridge | 145:64910690c574 | 70 | |
AnnaBridge | 145:64910690c574 | 71 | /*! |
AnnaBridge | 145:64910690c574 | 72 | * @file MKL82Z7 |
AnnaBridge | 145:64910690c574 | 73 | * @version 1.5 |
AnnaBridge | 145:64910690c574 | 74 | * @date 2015-09-24 |
AnnaBridge | 145:64910690c574 | 75 | * @brief Device specific configuration file for MKL82Z7 (header file) |
AnnaBridge | 145:64910690c574 | 76 | * |
AnnaBridge | 145:64910690c574 | 77 | * Provides a system configuration function and a global variable that contains |
AnnaBridge | 145:64910690c574 | 78 | * the system frequency. It configures the device and initializes the oscillator |
AnnaBridge | 145:64910690c574 | 79 | * (PLL) that is part of the microcontroller device. |
AnnaBridge | 145:64910690c574 | 80 | */ |
AnnaBridge | 145:64910690c574 | 81 | |
AnnaBridge | 145:64910690c574 | 82 | #ifndef _SYSTEM_MKL82Z7_H_ |
AnnaBridge | 145:64910690c574 | 83 | #define _SYSTEM_MKL82Z7_H_ /**< Symbol preventing repeated inclusion */ |
AnnaBridge | 145:64910690c574 | 84 | |
AnnaBridge | 145:64910690c574 | 85 | #ifdef __cplusplus |
AnnaBridge | 145:64910690c574 | 86 | extern "C" { |
AnnaBridge | 145:64910690c574 | 87 | #endif |
AnnaBridge | 145:64910690c574 | 88 | |
AnnaBridge | 145:64910690c574 | 89 | #include <stdint.h> |
AnnaBridge | 145:64910690c574 | 90 | |
AnnaBridge | 145:64910690c574 | 91 | |
AnnaBridge | 145:64910690c574 | 92 | #ifndef DISABLE_WDOG |
AnnaBridge | 145:64910690c574 | 93 | #define DISABLE_WDOG 1 |
AnnaBridge | 145:64910690c574 | 94 | #endif |
AnnaBridge | 145:64910690c574 | 95 | |
AnnaBridge | 145:64910690c574 | 96 | /* Define clock source values */ |
AnnaBridge | 145:64910690c574 | 97 | |
AnnaBridge | 145:64910690c574 | 98 | #define CPU_XTAL_CLK_HZ 12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */ |
AnnaBridge | 145:64910690c574 | 99 | #define CPU_XTAL32k_CLK_HZ 32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC in Hz */ |
AnnaBridge | 145:64910690c574 | 100 | #define CPU_INT_SLOW_CLK_HZ 32768U /* Value of the slow internal oscillator clock frequency in Hz */ |
AnnaBridge | 145:64910690c574 | 101 | #define CPU_INT_FAST_CLK_HZ 4000000U /* Value of the fast internal oscillator clock frequency in Hz */ |
AnnaBridge | 145:64910690c574 | 102 | #define CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */ |
AnnaBridge | 145:64910690c574 | 103 | |
AnnaBridge | 145:64910690c574 | 104 | /* RTC oscillator setting */ |
AnnaBridge | 145:64910690c574 | 105 | /* 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 | 145:64910690c574 | 106 | #define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */ |
AnnaBridge | 145:64910690c574 | 107 | |
AnnaBridge | 145:64910690c574 | 108 | /* Low power mode enable */ |
AnnaBridge | 145:64910690c574 | 109 | /* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */ |
AnnaBridge | 145:64910690c574 | 110 | #define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */ |
AnnaBridge | 145:64910690c574 | 111 | |
AnnaBridge | 145:64910690c574 | 112 | #define DEFAULT_SYSTEM_CLOCK 20971520u |
AnnaBridge | 145:64910690c574 | 113 | |
AnnaBridge | 145:64910690c574 | 114 | |
AnnaBridge | 145:64910690c574 | 115 | /** |
AnnaBridge | 145:64910690c574 | 116 | * @brief System clock frequency (core clock) |
AnnaBridge | 145:64910690c574 | 117 | * |
AnnaBridge | 145:64910690c574 | 118 | * The system clock frequency supplied to the SysTick timer and the processor |
AnnaBridge | 145:64910690c574 | 119 | * core clock. This variable can be used by the user application to setup the |
AnnaBridge | 145:64910690c574 | 120 | * SysTick timer or configure other parameters. It may also be used by debugger to |
AnnaBridge | 145:64910690c574 | 121 | * query the frequency of the debug timer or configure the trace clock speed |
AnnaBridge | 145:64910690c574 | 122 | * SystemCoreClock is initialized with a correct predefined value. |
AnnaBridge | 145:64910690c574 | 123 | */ |
AnnaBridge | 145:64910690c574 | 124 | extern uint32_t SystemCoreClock; |
AnnaBridge | 145:64910690c574 | 125 | |
AnnaBridge | 145:64910690c574 | 126 | /** |
AnnaBridge | 145:64910690c574 | 127 | * @brief Setup the microcontroller system. |
AnnaBridge | 145:64910690c574 | 128 | * |
AnnaBridge | 145:64910690c574 | 129 | * Typically this function configures the oscillator (PLL) that is part of the |
AnnaBridge | 145:64910690c574 | 130 | * microcontroller device. For systems with variable clock speed it also updates |
AnnaBridge | 145:64910690c574 | 131 | * the variable SystemCoreClock. SystemInit is called from startup_device file. |
AnnaBridge | 145:64910690c574 | 132 | */ |
AnnaBridge | 145:64910690c574 | 133 | void SystemInit (void); |
AnnaBridge | 145:64910690c574 | 134 | |
AnnaBridge | 145:64910690c574 | 135 | /** |
AnnaBridge | 145:64910690c574 | 136 | * @brief Updates the SystemCoreClock variable. |
AnnaBridge | 145:64910690c574 | 137 | * |
AnnaBridge | 145:64910690c574 | 138 | * It must be called whenever the core clock is changed during program |
AnnaBridge | 145:64910690c574 | 139 | * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates |
AnnaBridge | 145:64910690c574 | 140 | * the current core clock. |
AnnaBridge | 145:64910690c574 | 141 | */ |
AnnaBridge | 145:64910690c574 | 142 | void SystemCoreClockUpdate (void); |
AnnaBridge | 145:64910690c574 | 143 | |
AnnaBridge | 145:64910690c574 | 144 | #ifdef __cplusplus |
AnnaBridge | 145:64910690c574 | 145 | } |
AnnaBridge | 145:64910690c574 | 146 | #endif |
AnnaBridge | 145:64910690c574 | 147 | |
AnnaBridge | 145:64910690c574 | 148 | #endif /* _SYSTEM_MKL82Z7_H_ */ |