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_MAX32650_INCLUDE_SYSTEM_MAX32650_H_
22 #define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32650_INCLUDE_SYSTEM_MAX32650_H_
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <stdint.h>
29 
30 /*----------------------------------------------------------------------------
31   Define clocks
32  *----------------------------------------------------------------------------*/
33 
34 #ifndef CRYPTO_FREQ
35 #define CRYPTO_FREQ_A1 40000000
36 #define CRYPTO_FREQ_A3 50000000
37 #endif
38 
39 #ifndef HFX_FREQ
40 #define HFX_FREQ 24000000
41 #endif
42 
43 /* NOTE: This is the nominal value for NANORING. The actual value may vary from chip to chip.
44          Update if use of this oscillator requires precise timing.*/
45 #ifndef NANORING_FREQ
46 #define NANORING_FREQ 8000
47 #endif
48 
49 #ifndef HIRC96_FREQ
50 #define HIRC96_FREQ 120000000
51 #endif
52 
53 #ifndef HIRC8_FREQ
54 #define HIRC8_FREQ 8000000
55 #endif
56 
57 #ifndef IBRO_FREQ
58 #define IBRO_FREQ 7372800
59 #endif
60 
61 #ifndef ERTCO_FREQ
62 #define ERTCO_FREQ 32768
63 #endif
64 
65 extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock)  */
66 extern uint8_t ChipRevision; /*!< System Clock Frequency (Core Clock)  */
67 #ifndef PeripheralClock
68 #define PeripheralClock (SystemCoreClock / 2) /*!< Peripheral Clock Frequency */
69 #endif
70 
71 /*
72  * Initialize the system
73  *
74  * @brief  Setup the microcontroller system.
75  *         Initialize the System and update the SystemCoreClock variable.
76  */
77 void SystemInit(void);
78 
79 /*
80  * Update SystemCoreClock variable
81  *
82  * @brief  Updates the SystemCoreClock with current core Clock
83  *         retrieved from cpu registers.
84  */
85 void SystemCoreClockUpdate(void);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32650_INCLUDE_SYSTEM_MAX32650_H_
92