1 /*
2 ** ###################################################################
3 **     Processors:          LPC824M201JDH20
4 **                          LPC824M201JHI33
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:    LPC82x User manual Rev.1.2  5 October 2016
12 **     Version:             rev. 1.1, 2018-02-25
13 **     Build:               b200526
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 (2018-02-09)
31 **         Initial version.
32 **     - rev. 1.1 (2018-02-25)
33 **         Update some registers according to UM rev 1.2
34 **
35 ** ###################################################################
36 */
37 
38 /*!
39  * @file LPC824
40  * @version 1.1
41  * @date 2018-02-25
42  * @brief Device specific configuration file for LPC824 (header file)
43  *
44  * Provides a system configuration function and a global variable that contains
45  * the system frequency. It configures the device and initializes the oscillator
46  * (PLL) that is part of the microcontroller device.
47  */
48 
49 #ifndef _SYSTEM_LPC824_H_
50 #define _SYSTEM_LPC824_H_                        /**< Symbol preventing repeated inclusion */
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 #include <stdint.h>
57 
58 #define DEFAULT_SYSTEM_CLOCK           12000000u           /* Default System clock value */
59 #define CLK_RTC_32K_CLK                   32768u           /* RTC oscillator 32 kHz output (32k_clk */
60 #define CLK_IRC_12MHZ                  12000000u           /* FRO 12 MHz (fro_12m) */
61 #define CLK_OSC_IN                     12000000u           /* Oscillator input */
62 #define EXT_CLK_IN                     0u                  /* ext clkin  */
63 
64 
65 
66 
67 /**
68  * @brief System clock frequency (core clock)
69  *
70  * The system clock frequency supplied to the SysTick timer and the processor
71  * core clock. This variable can be used by the user application to setup the
72  * SysTick timer or configure other parameters. It may also be used by debugger to
73  * query the frequency of the debug timer or configure the trace clock speed
74  * SystemCoreClock is initialized with a correct predefined value.
75  */
76 extern uint32_t SystemCoreClock;
77 
78 /**
79  * @brief Setup the microcontroller system.
80  *
81  * Typically this function configures the oscillator (PLL) that is part of the
82  * microcontroller device. For systems with variable clock speed it also updates
83  * the variable SystemCoreClock. SystemInit is called from startup_device file.
84  */
85 void SystemInit (void);
86 
87 /**
88  * @brief Updates the SystemCoreClock variable.
89  *
90  * It must be called whenever the core clock is changed during program
91  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
92  * the current core clock.
93  */
94 void SystemCoreClockUpdate (void);
95 
96 /**
97  * @brief SystemInit function hook.
98  *
99  * This weak function allows to call specific initialization code during the
100  * SystemInit() execution.This can be used when an application specific code needs
101  * to be called as close to the reset entry as possible (for example the Multicore
102  * Manager MCMGR_EarlyInit() function call).
103  * NOTE: No global r/w variables can be used in this hook function because the
104  * initialization of these variables happens after this function.
105  */
106 void SystemInitHook (void);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif  /* _SYSTEM_LPC824_H_ */
113