1 /****************************************************************************** 2 * 3 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by 4 * Analog Devices, Inc.), 5 * Copyright (C) 2023-2024 Analog Devices, Inc. 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 ******************************************************************************/ 20 21 #ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32572_INCLUDE_SYSTEM_MAX32572_H_ 22 #define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32572_INCLUDE_SYSTEM_MAX32572_H_ 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 #include <stdint.h> 29 30 /*---------------------------------------------------------------------------- 31 Define clocks 32 *----------------------------------------------------------------------------*/ 33 34 /* NOTE: ISO was previously HIRC. */ 35 36 // TODO(SW): Remove ISO 37 #ifndef ISO_FREQ 38 #define ISO_FREQ 10000000 39 #endif 40 41 /* NOTE: This is the nominal value for INRO. The actual value may vary from chip to chip. 42 Update if use of this oscillator requires precise timing.*/ 43 /* NOTE: INO was previosly LIRC8 */ 44 #ifndef INRO_FREQ 45 #define INRO_FREQ 8000 46 #endif 47 48 /* NOTE: IPO was previously HIRC96. */ 49 #ifndef IPO_FREQ 50 #define IPO_FREQ 96000000 51 #endif 52 53 /* NOTE: IBRO was previously HIRC8M. */ 54 #ifndef IBRO_FREQ 55 #define IBRO_FREQ 7372800 56 #endif 57 58 /* NOTE: ERFO was previously XTAL27M. */ 59 #ifndef ERFO_FREQ 60 #define ERFO_FREQ 27120000 61 #endif 62 63 /* NOTE: ERTCO was previously XTAL32K. */ 64 #ifndef ERTCO_FREQ 65 #define ERTCO_FREQ 32768 66 #endif 67 68 extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 69 #ifdef PeripheralClock 70 #warning PeripheralClock define is being overidden. 71 #else 72 #define PeripheralClock (SystemCoreClock / 2) /*!< Peripheral Clock Frequency */ 73 #endif 74 75 /* 76 * Initialize the system 77 * 78 * @brief Setup the microcontroller system. 79 * Initialize the System and update the SystemCoreClock variable. 80 */ 81 void SystemInit(void); 82 83 /* 84 * Update SystemCoreClock variable 85 * 86 * @brief Updates the SystemCoreClock with current core Clock 87 * retrieved from cpu registers. 88 */ 89 void SystemCoreClockUpdate(void); 90 91 #ifdef __cplusplus 92 } 93 #endif 94 95 #endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32572_INCLUDE_SYSTEM_MAX32572_H_ 96