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