1 /* 2 ** ################################################################### 3 ** Processors: MIMXRT1042DFP6B 4 ** MIMXRT1042DJM6B 5 ** MIMXRT1042XFP5B 6 ** MIMXRT1042XJM5B 7 ** 8 ** Compilers: Freescale C/C++ for Embedded ARM 9 ** GNU C Compiler 10 ** IAR ANSI C/C++ Compiler for ARM 11 ** Keil ARM C/C++ Compiler 12 ** MCUXpresso Compiler 13 ** 14 ** Reference manual: IMXRT1040RM Rev.1, 09/2022 15 ** Version: rev. 0.1, 2021-07-20 16 ** Build: b230821 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-2023 NXP 25 ** SPDX-License-Identifier: BSD-3-Clause 26 ** 27 ** http: www.nxp.com 28 ** mail: support@nxp.com 29 ** 30 ** Revisions: 31 ** - rev. 0.1 (2021-07-20) 32 ** Initial version. 33 ** 34 ** ################################################################### 35 */ 36 37 /*! 38 * @file MIMXRT1042 39 * @version 0.1 40 * @date 2021-07-20 41 * @brief Device specific configuration file for MIMXRT1042 (header file) 42 * 43 * Provides a system configuration function and a global variable that contains 44 * the system frequency. It configures the device and initializes the oscillator 45 * (PLL) that is part of the microcontroller device. 46 */ 47 48 #ifndef _SYSTEM_MIMXRT1042_H_ 49 #define _SYSTEM_MIMXRT1042_H_ /**< Symbol preventing repeated inclusion */ 50 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 #include <stdint.h> 56 57 58 #ifndef DISABLE_WDOG 59 #define DISABLE_WDOG 1 60 #endif 61 62 /* Define clock source values */ 63 64 #define CPU_XTAL_CLK_HZ 24000000UL /* Value of the external crystal or oscillator clock frequency in Hz */ 65 66 #define CPU_CLK1_HZ 0UL /* Value of the CLK1 (select the CLK1_N/CLK1_P as source) frequency in Hz */ 67 /* If CLOCK1_P,CLOCK1_N is choose as the pll bypass clock source, please implement the CLKPN_FREQ define, otherwise 0 will be returned. */ 68 69 #define DEFAULT_SYSTEM_CLOCK 528000000UL /* Default System clock value */ 70 71 72 /** 73 * @brief System clock frequency (core clock) 74 * 75 * The system clock frequency supplied to the SysTick timer and the processor 76 * core clock. This variable can be used by the user application to setup the 77 * SysTick timer or configure other parameters. It may also be used by debugger to 78 * query the frequency of the debug timer or configure the trace clock speed 79 * SystemCoreClock is initialized with a correct predefined value. 80 */ 81 extern uint32_t SystemCoreClock; 82 83 /** 84 * @brief Setup the microcontroller system. 85 * 86 * Typically this function configures the oscillator (PLL) that is part of the 87 * microcontroller device. For systems with variable clock speed it also updates 88 * the variable SystemCoreClock. SystemInit is called from startup_device file. 89 */ 90 void SystemInit (void); 91 92 /** 93 * @brief Updates the SystemCoreClock variable. 94 * 95 * It must be called whenever the core clock is changed during program 96 * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates 97 * the current core clock. 98 */ 99 void SystemCoreClockUpdate (void); 100 101 /** 102 * @brief SystemInit function hook. 103 * 104 * This weak function allows to call specific initialization code during the 105 * SystemInit() execution.This can be used when an application specific code needs 106 * to be called as close to the reset entry as possible (for example the Multicore 107 * Manager MCMGR_EarlyInit() function call). 108 * NOTE: No global r/w variables can be used in this hook function because the 109 * initialization of these variables happens after this function. 110 */ 111 void SystemInitHook (void); 112 113 #ifdef __cplusplus 114 } 115 #endif 116 117 #endif /* _SYSTEM_MIMXRT1042_H_ */ 118