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