1 /*
2 ** ###################################################################
3 **     Processors:          MCXC244VFM
4 **                          MCXC244VFT
5 **
6 **     Compilers:           Freescale C/C++ for Embedded ARM
7 **                          GNU C Compiler
8 **                          IAR ANSI C/C++ Compiler for ARM
9 **                          Keil ARM C/C++ Compiler
10 **                          MCUXpresso Compiler
11 **
12 **     Reference manual:    MCXC444RM, Rev.1, Mar 2024
13 **     Version:             rev. 1.0, 2024-03-11
14 **     Build:               b240401
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 (2024-03-11)
30 **         Initial version.
31 **
32 ** ###################################################################
33 */
34 
35 /*!
36  * @file MCXC244
37  * @version 1.0
38  * @date 2024-03-11
39  * @brief Device specific configuration file for MCXC244 (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_MCXC244_H_
47 #define _SYSTEM_MCXC244_H_                       /**< Symbol preventing repeated inclusion */
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <stdint.h>
54 
55 
56 #ifndef DISABLE_WDOG
57   #define DISABLE_WDOG  1
58 #endif
59 
60 #define ACK_ISOLATION                  1
61 
62 /* Define clock source values */
63 #define CPU_XTAL_CLK_HZ                32768U              /* Value of the external crystal or oscillator clock frequency in Hz */
64 #define CPU_INT_FAST_CLK_HZ            48000000U           /* Value of the fast internal oscillator clock frequency in Hz */
65 #define CPU_INT_IRC_CLK_HZ             48000000U           /* Value of the 48M internal oscillator clock frequency in Hz */
66 
67 /* Low power mode enable */
68 /* SMC_PMPROT: AVLP=1,AVLLS=1 */
69 #define SYSTEM_SMC_PMPROT_VALUE        0x2AU               /* SMC_PMPROT */
70 
71 #define DEFAULT_SYSTEM_CLOCK           8000000U            /* Default System clock value */
72 #define CPU_INT_SLOW_CLK_HZ            8000000U            /* Value of the slow internal oscillator clock frequency in Hz */
73 
74 
75 
76 /**
77  * @brief System clock frequency (core clock)
78  *
79  * The system clock frequency supplied to the SysTick timer and the processor
80  * core clock. This variable can be used by the user application to setup the
81  * SysTick timer or configure other parameters. It may also be used by debugger to
82  * query the frequency of the debug timer or configure the trace clock speed
83  * SystemCoreClock is initialized with a correct predefined value.
84  */
85 extern uint32_t SystemCoreClock;
86 
87 /**
88  * @brief Setup the microcontroller system.
89  *
90  * Typically this function configures the oscillator (PLL) that is part of the
91  * microcontroller device. For systems with variable clock speed it also updates
92  * the variable SystemCoreClock. SystemInit is called from startup_device file.
93  */
94 void SystemInit (void);
95 
96 /**
97  * @brief Updates the SystemCoreClock variable.
98  *
99  * It must be called whenever the core clock is changed during program
100  * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
101  * the current core clock.
102  */
103 void SystemCoreClockUpdate (void);
104 
105 /**
106  * @brief SystemInit function hook.
107  *
108  * This weak function allows to call specific initialization code during the
109  * SystemInit() execution.This can be used when an application specific code needs
110  * to be called as close to the reset entry as possible (for example the Multicore
111  * Manager MCMGR_EarlyInit() function call).
112  * NOTE: No global r/w variables can be used in this hook function because the
113  * initialization of these variables happens after this function.
114  */
115 void SystemInitHook (void);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif  /* _SYSTEM_MCXC244_H_ */
122