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