]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/device/system_LPC54018.h
Add MPU demo project for LPC54018 board.
[freertos] / FreeRTOS / Demo / CORTEX_MPU_LPC54018_MCUXpresso / NXP_Code / device / system_LPC54018.h
1 /*\r
2 ** ###################################################################\r
3 **     Processors:          LPC54018JBD208\r
4 **                          LPC54018JET180\r
5 **\r
6 **     Compilers:           GNU C Compiler\r
7 **                          IAR ANSI C/C++ Compiler for ARM\r
8 **                          Keil ARM C/C++ Compiler\r
9 **                          MCUXpresso Compiler\r
10 **\r
11 **     Reference manual:    LPC540xx/LPC54S0xx User manual Rev.0.8 5 June 2018\r
12 **     Version:             rev. 1.2, 2017-06-08\r
13 **     Build:               b191014\r
14 **\r
15 **     Abstract:\r
16 **         Provides a system configuration function and a global variable that\r
17 **         contains the system frequency. It configures the device and initializes\r
18 **         the oscillator (PLL) that is part of the microcontroller device.\r
19 **\r
20 **     Copyright 2016 Freescale Semiconductor, Inc.\r
21 **     Copyright 2016-2019 NXP\r
22 **     All rights reserved.\r
23 **\r
24 **     SPDX-License-Identifier: BSD-3-Clause\r
25 **\r
26 **     http:                 www.nxp.com\r
27 **     mail:                 support@nxp.com\r
28 **\r
29 **     Revisions:\r
30 **     - rev. 1.0 (2016-08-12)\r
31 **         Initial version.\r
32 **     - rev. 1.1 (2016-11-25)\r
33 **         Update CANFD and Classic CAN register.\r
34 **         Add MAC TIMERSTAMP registers.\r
35 **     - rev. 1.2 (2017-06-08)\r
36 **         Remove RTC_CTRL_RTC_OSC_BYPASS.\r
37 **         SYSCON_ARMTRCLKDIV rename to SYSCON_ARMTRACECLKDIV.\r
38 **         Remove RESET and HALT from SYSCON_AHBCLKDIV.\r
39 **\r
40 ** ###################################################################\r
41 */\r
42 \r
43 /*!\r
44  * @file LPC54018\r
45  * @version 1.2\r
46  * @date 2017-06-08\r
47  * @brief Device specific configuration file for LPC54018 (header file)\r
48  *\r
49  * Provides a system configuration function and a global variable that contains\r
50  * the system frequency. It configures the device and initializes the oscillator\r
51  * (PLL) that is part of the microcontroller device.\r
52  */\r
53 \r
54 #ifndef _SYSTEM_LPC54018_H_\r
55 #define _SYSTEM_LPC54018_H_                      /**< Symbol preventing repeated inclusion */\r
56 \r
57 #ifdef __cplusplus\r
58 extern "C" {\r
59 #endif\r
60 \r
61 #include <stdint.h>\r
62 \r
63 #define DEFAULT_SYSTEM_CLOCK           12000000u           /* Default System clock value */\r
64 #define CLK_RTC_32K_CLK                   32768u           /* RTC oscillator 32 kHz output (32k_clk */\r
65 #define CLK_FRO_12MHZ                  12000000u           /* FRO 12 MHz (fro_12m) */\r
66 #define CLK_FRO_48MHZ                  48000000u           /* FRO 48 MHz (fro_48m) */\r
67 #define CLK_FRO_96MHZ                  96000000u           /* FRO 96 MHz (fro_96m) */\r
68 #define CLK_CLK_IN                            0u           /* Default CLK_IN pin clock */\r
69 \r
70 \r
71 /**\r
72  * @brief System clock frequency (core clock)\r
73  *\r
74  * The system clock frequency supplied to the SysTick timer and the processor\r
75  * core clock. This variable can be used by the user application to setup the\r
76  * SysTick timer or configure other parameters. It may also be used by debugger to\r
77  * query the frequency of the debug timer or configure the trace clock speed\r
78  * SystemCoreClock is initialized with a correct predefined value.\r
79  */\r
80 extern uint32_t SystemCoreClock;\r
81 \r
82 /**\r
83  * @brief Setup the microcontroller system.\r
84  *\r
85  * Typically this function configures the oscillator (PLL) that is part of the\r
86  * microcontroller device. For systems with variable clock speed it also updates\r
87  * the variable SystemCoreClock. SystemInit is called from startup_device file.\r
88  */\r
89 void SystemInit (void);\r
90 \r
91 /**\r
92  * @brief Updates the SystemCoreClock variable.\r
93  *\r
94  * It must be called whenever the core clock is changed during program\r
95  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates\r
96  * the current core clock.\r
97  */\r
98 void SystemCoreClockUpdate (void);\r
99 \r
100 /**\r
101  * @brief SystemInit function hook.\r
102  *\r
103  * This weak function allows to call specific initialization code during the\r
104  * SystemInit() execution.This can be used when an application specific code needs\r
105  * to be called as close to the reset entry as possible (for example the Multicore\r
106  * Manager MCMGR_EarlyInit() function call).\r
107  * NOTE: No global r/w variables can be used in this hook function because the\r
108  * initialization of these variables happens after this function.\r
109  */\r
110 void SystemInitHook (void);\r
111 \r
112 #ifdef __cplusplus\r
113 }\r
114 #endif\r
115 \r
116 #endif  /* _SYSTEM_LPC54018_H_ */\r