diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/MK63F12/system_MK63F12.h')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/devices/MK63F12/system_MK63F12.h | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/MK63F12/system_MK63F12.h b/lib/chibios-contrib/ext/mcux-sdk/devices/MK63F12/system_MK63F12.h new file mode 100644 index 000000000..694d67e20 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/MK63F12/system_MK63F12.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | ** ################################################################### | ||
3 | ** Processors: MK63FN1M0VLQ12 | ||
4 | ** MK63FN1M0VMD12 | ||
5 | ** | ||
6 | ** Compilers: Freescale C/C++ for Embedded ARM | ||
7 | ** GNU C Compiler | ||
8 | ** IAR ANSI C/C++ Compiler for ARM | ||
9 | ** Keil ARM C/C++ Compiler | ||
10 | ** MCUXpresso Compiler | ||
11 | ** | ||
12 | ** Reference manual: K63P144M120SF5RM, Rev.2, January 2014 | ||
13 | ** Version: rev. 2.7, 2015-02-19 | ||
14 | ** Build: b181105 | ||
15 | ** | ||
16 | ** Abstract: | ||
17 | ** Provides a system configuration function and a global variable that | ||
18 | ** contains the system frequency. It configures the device and initializes | ||
19 | ** the oscillator (PLL) that is part of the microcontroller device. | ||
20 | ** | ||
21 | ** Copyright 2016 Freescale Semiconductor, Inc. | ||
22 | ** Copyright 2016-2018 NXP | ||
23 | ** All rights reserved. | ||
24 | ** | ||
25 | ** SPDX-License-Identifier: BSD-3-Clause | ||
26 | ** | ||
27 | ** http: www.nxp.com | ||
28 | ** mail: [email protected] | ||
29 | ** | ||
30 | ** Revisions: | ||
31 | ** - rev. 1.0 (2013-05-03) | ||
32 | ** Initial version. | ||
33 | ** - rev. 2.0 (2013-10-29) | ||
34 | ** Register accessor macros added to the memory map. | ||
35 | ** Symbols for Processor Expert memory map compatibility added to the memory map. | ||
36 | ** Startup file for gcc has been updated according to CMSIS 3.2. | ||
37 | ** System initialization updated. | ||
38 | ** MCG - registers updated. | ||
39 | ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed. | ||
40 | ** - rev. 2.1 (2013-10-30) | ||
41 | ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled. | ||
42 | ** - rev. 2.2 (2013-12-09) | ||
43 | ** DMA - EARS register removed. | ||
44 | ** AIPS0, AIPS1 - MPRA register updated. | ||
45 | ** - rev. 2.3 (2014-01-24) | ||
46 | ** Update according to reference manual rev. 2 | ||
47 | ** ENET, MCG, MCM, SIM, USB - registers updated | ||
48 | ** - rev. 2.4 (2014-02-10) | ||
49 | ** The declaration of clock configurations has been moved to separate header file system_MK63F12.h | ||
50 | ** Update of SystemInit() and SystemCoreClockUpdate() functions. | ||
51 | ** Module access macro module_BASES replaced by module_BASE_PTRS. | ||
52 | ** - rev. 2.5 (2014-08-28) | ||
53 | ** Update of system files - default clock configuration changed. | ||
54 | ** Update of startup files - possibility to override DefaultISR added. | ||
55 | ** - rev. 2.6 (2014-10-14) | ||
56 | ** Interrupt INT_LPTimer renamed to INT_LPTMR0, interrupt INT_Watchdog renamed to INT_WDOG_EWM. | ||
57 | ** - rev. 2.7 (2015-02-19) | ||
58 | ** Renamed interrupt vector LLW to LLWU. | ||
59 | ** | ||
60 | ** ################################################################### | ||
61 | */ | ||
62 | |||
63 | /*! | ||
64 | * @file MK63F12 | ||
65 | * @version 2.7 | ||
66 | * @date 2015-02-19 | ||
67 | * @brief Device specific configuration file for MK63F12 (header file) | ||
68 | * | ||
69 | * Provides a system configuration function and a global variable that contains | ||
70 | * the system frequency. It configures the device and initializes the oscillator | ||
71 | * (PLL) that is part of the microcontroller device. | ||
72 | */ | ||
73 | |||
74 | #ifndef _SYSTEM_MK63F12_H_ | ||
75 | #define _SYSTEM_MK63F12_H_ /**< Symbol preventing repeated inclusion */ | ||
76 | |||
77 | #ifdef __cplusplus | ||
78 | extern "C" { | ||
79 | #endif | ||
80 | |||
81 | #include <stdint.h> | ||
82 | |||
83 | |||
84 | #ifndef DISABLE_WDOG | ||
85 | #define DISABLE_WDOG 1 | ||
86 | #endif | ||
87 | |||
88 | /* Define clock source values */ | ||
89 | |||
90 | #define CPU_XTAL_CLK_HZ 50000000u /* Value of the external crystal or oscillator clock frequency in Hz */ | ||
91 | #define CPU_XTAL32k_CLK_HZ 32768u /* Value of the external 32k crystal or oscillator clock frequency in Hz */ | ||
92 | #define CPU_INT_SLOW_CLK_HZ 32768u /* Value of the slow internal oscillator clock frequency in Hz */ | ||
93 | #define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz */ | ||
94 | #define CPU_INT_IRC_CLK_HZ 48000000u /* Value of the 48M internal oscillator clock frequency in Hz */ | ||
95 | |||
96 | /* RTC oscillator setting */ | ||
97 | /* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */ | ||
98 | #define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */ | ||
99 | |||
100 | /* Low power mode enable */ | ||
101 | /* SMC_PMPROT: AVLP=1,ALLS=1,AVLLS=1 */ | ||
102 | #define SYSTEM_SMC_PMPROT_VALUE 0x2AU /* SMC_PMPROT */ | ||
103 | |||
104 | #define DEFAULT_SYSTEM_CLOCK 20971520u /* Default System clock value */ | ||
105 | |||
106 | |||
107 | /** | ||
108 | * @brief System clock frequency (core clock) | ||
109 | * | ||
110 | * The system clock frequency supplied to the SysTick timer and the processor | ||
111 | * core clock. This variable can be used by the user application to setup the | ||
112 | * SysTick timer or configure other parameters. It may also be used by debugger to | ||
113 | * query the frequency of the debug timer or configure the trace clock speed | ||
114 | * SystemCoreClock is initialized with a correct predefined value. | ||
115 | */ | ||
116 | extern uint32_t SystemCoreClock; | ||
117 | |||
118 | /** | ||
119 | * @brief Setup the microcontroller system. | ||
120 | * | ||
121 | * Typically this function configures the oscillator (PLL) that is part of the | ||
122 | * microcontroller device. For systems with variable clock speed it also updates | ||
123 | * the variable SystemCoreClock. SystemInit is called from startup_device file. | ||
124 | */ | ||
125 | void SystemInit (void); | ||
126 | |||
127 | /** | ||
128 | * @brief Updates the SystemCoreClock variable. | ||
129 | * | ||
130 | * It must be called whenever the core clock is changed during program | ||
131 | * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates | ||
132 | * the current core clock. | ||
133 | */ | ||
134 | void SystemCoreClockUpdate (void); | ||
135 | |||
136 | /** | ||
137 | * @brief SystemInit function hook. | ||
138 | * | ||
139 | * This weak function allows to call specific initialization code during the | ||
140 | * SystemInit() execution.This can be used when an application specific code needs | ||
141 | * to be called as close to the reset entry as possible (for example the Multicore | ||
142 | * Manager MCMGR_EarlyInit() function call). | ||
143 | * NOTE: No global r/w variables can be used in this hook function because the | ||
144 | * initialization of these variables happens after this function. | ||
145 | */ | ||
146 | void SystemInitHook (void); | ||
147 | |||
148 | #ifdef __cplusplus | ||
149 | } | ||
150 | #endif | ||
151 | |||
152 | #endif /* _SYSTEM_MK63F12_H_ */ | ||