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