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