1 /**************************************************************************//**
2  * @file
3  * @brief CMSIS system header file for EFR32MG24
4  ******************************************************************************
5  * # License
6  * <b>Copyright 2024 Silicon Laboratories, Inc. www.silabs.com</b>
7  ******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  *****************************************************************************/
30 
31 #ifndef SYSTEM_EFR32MG24_H
32 #define SYSTEM_EFR32MG24_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #include <stdint.h>
39 #include "sl_code_classification.h"
40 
41 /***************************************************************************//**
42  * @addtogroup Parts
43  * @{
44  ******************************************************************************/
45 /***************************************************************************//**
46  * @addtogroup EFR32MG24 EFR32MG24
47  * @{
48  ******************************************************************************/
49 
50 /*******************************************************************************
51  ******************************   TYPEDEFS   ***********************************
52  ******************************************************************************/
53 
54 /* Interrupt vectortable entry */
55 typedef union {
56   void (*VECTOR_TABLE_Type)(void);
57   void *topOfStack;
58 } tVectorEntry;
59 
60 /*******************************************************************************
61  **************************   GLOBAL VARIABLES   *******************************
62  ******************************************************************************/
63 
64 #if !defined(SYSTEM_NO_STATIC_MEMORY)
65 extern uint32_t SystemCoreClock;     /**< System Clock Frequency (Core Clock) */
66 extern uint32_t SystemHfrcoFreq;     /**< System HFRCO frequency */
67 #endif
68 
69 /*Re-direction of IRQn.*/
70 #if defined (SL_TRUSTZONE_SECURE)
71 #define SMU_PRIVILEGED_IRQn    SMU_S_PRIVILEGED_IRQn
72 #else
73 #define SMU_PRIVILEGED_IRQn    SMU_NS_PRIVILEGED_IRQn
74 #endif /* SL_TRUSTZONE_SECURE */
75 
76 /*Re-direction of IRQHandler.*/
77 #if defined (SL_TRUSTZONE_SECURE)
78 #define SMU_PRIVILEGED_IRQHandler    SMU_S_PRIVILEGED_IRQHandler
79 #else
80 #define SMU_PRIVILEGED_IRQHandler    SMU_NS_PRIVILEGED_IRQHandler
81 #endif /* SL_TRUSTZONE_SECURE */
82 
83 /*******************************************************************************
84  *****************************   PROTOTYPES   **********************************
85  ******************************************************************************/
86 
87 void Reset_Handler(void);           /**< Reset Handler */
88 void NMI_Handler(void);             /**< NMI Handler */
89 void HardFault_Handler(void);       /**< Hard Fault Handler */
90 void MemManage_Handler(void);       /**< MPU Fault Handler */
91 void BusFault_Handler(void);        /**< Bus Fault Handler */
92 void UsageFault_Handler(void);      /**< Usage Fault Handler */
93 void SecureFault_Handler(void);     /**< Secure Fault Handler */
94 void SVC_Handler(void);             /**< SVCall Handler */
95 void DebugMon_Handler(void);        /**< Debug Monitor Handler */
96 void PendSV_Handler(void);          /**< PendSV Handler */
97 void SysTick_Handler(void);         /**< SysTick Handler */
98 
99 /* Part Specific Interrupts */
100 void SMU_SECURE_IRQHandler(void);        /**< SMU_SECURE IRQ Handler */
101 void SMU_S_PRIVILEGED_IRQHandler(void);  /**< SMU_S_PRIVILEGED IRQ Handler */
102 void SMU_NS_PRIVILEGED_IRQHandler(void); /**< SMU_NS_PRIVILEGED IRQ Handler */
103 void EMU_IRQHandler(void);               /**< EMU IRQ Handler */
104 void TIMER0_IRQHandler(void);            /**< TIMER0 IRQ Handler */
105 void TIMER1_IRQHandler(void);            /**< TIMER1 IRQ Handler */
106 void TIMER2_IRQHandler(void);            /**< TIMER2 IRQ Handler */
107 void TIMER3_IRQHandler(void);            /**< TIMER3 IRQ Handler */
108 void TIMER4_IRQHandler(void);            /**< TIMER4 IRQ Handler */
109 void USART0_RX_IRQHandler(void);         /**< USART0_RX IRQ Handler */
110 void USART0_TX_IRQHandler(void);         /**< USART0_TX IRQ Handler */
111 void EUSART0_RX_IRQHandler(void);        /**< EUSART0_RX IRQ Handler */
112 void EUSART0_TX_IRQHandler(void);        /**< EUSART0_TX IRQ Handler */
113 void EUSART1_RX_IRQHandler(void);        /**< EUSART1_RX IRQ Handler */
114 void EUSART1_TX_IRQHandler(void);        /**< EUSART1_TX IRQ Handler */
115 void MVP_IRQHandler(void);               /**< MVP IRQ Handler */
116 void ICACHE0_IRQHandler(void);           /**< ICACHE0 IRQ Handler */
117 void BURTC_IRQHandler(void);             /**< BURTC IRQ Handler */
118 void LETIMER0_IRQHandler(void);          /**< LETIMER0 IRQ Handler */
119 void SYSCFG_IRQHandler(void);            /**< SYSCFG IRQ Handler */
120 void MPAHBRAM_IRQHandler(void);          /**< MPAHBRAM IRQ Handler */
121 void LDMA_IRQHandler(void);              /**< LDMA IRQ Handler */
122 void LFXO_IRQHandler(void);              /**< LFXO IRQ Handler */
123 void LFRCO_IRQHandler(void);             /**< LFRCO IRQ Handler */
124 void ULFRCO_IRQHandler(void);            /**< ULFRCO IRQ Handler */
125 void GPIO_ODD_IRQHandler(void);          /**< GPIO_ODD IRQ Handler */
126 void GPIO_EVEN_IRQHandler(void);         /**< GPIO_EVEN IRQ Handler */
127 void I2C0_IRQHandler(void);              /**< I2C0 IRQ Handler */
128 void I2C1_IRQHandler(void);              /**< I2C1 IRQ Handler */
129 void EMUDG_IRQHandler(void);             /**< EMUDG IRQ Handler */
130 void AGC_IRQHandler(void);               /**< AGC IRQ Handler */
131 void BUFC_IRQHandler(void);              /**< BUFC IRQ Handler */
132 void FRC_PRI_IRQHandler(void);           /**< FRC_PRI IRQ Handler */
133 void FRC_IRQHandler(void);               /**< FRC IRQ Handler */
134 void MODEM_IRQHandler(void);             /**< MODEM IRQ Handler */
135 void PROTIMER_IRQHandler(void);          /**< PROTIMER IRQ Handler */
136 void RAC_RSM_IRQHandler(void);           /**< RAC_RSM IRQ Handler */
137 void RAC_SEQ_IRQHandler(void);           /**< RAC_SEQ IRQ Handler */
138 void HOSTMAILBOX_IRQHandler(void);       /**< HOSTMAILBOX IRQ Handler */
139 void SYNTH_IRQHandler(void);             /**< SYNTH IRQ Handler */
140 void ACMP0_IRQHandler(void);             /**< ACMP0 IRQ Handler */
141 void ACMP1_IRQHandler(void);             /**< ACMP1 IRQ Handler */
142 void WDOG0_IRQHandler(void);             /**< WDOG0 IRQ Handler */
143 void WDOG1_IRQHandler(void);             /**< WDOG1 IRQ Handler */
144 void HFXO0_IRQHandler(void);             /**< HFXO0 IRQ Handler */
145 void HFRCO0_IRQHandler(void);            /**< HFRCO0 IRQ Handler */
146 void HFRCOEM23_IRQHandler(void);         /**< HFRCOEM23 IRQ Handler */
147 void CMU_IRQHandler(void);               /**< CMU IRQ Handler */
148 void AES_IRQHandler(void);               /**< AES IRQ Handler */
149 void IADC_IRQHandler(void);              /**< IADC IRQ Handler */
150 void MSC_IRQHandler(void);               /**< MSC IRQ Handler */
151 void DPLL0_IRQHandler(void);             /**< DPLL0 IRQ Handler */
152 void EMUEFP_IRQHandler(void);            /**< EMUEFP IRQ Handler */
153 void DCDC_IRQHandler(void);              /**< DCDC IRQ Handler */
154 void PCNT0_IRQHandler(void);             /**< PCNT0 IRQ Handler */
155 void SW0_IRQHandler(void);               /**< SW0 IRQ Handler */
156 void SW1_IRQHandler(void);               /**< SW1 IRQ Handler */
157 void SW2_IRQHandler(void);               /**< SW2 IRQ Handler */
158 void SW3_IRQHandler(void);               /**< SW3 IRQ Handler */
159 void KERNEL0_IRQHandler(void);           /**< KERNEL0 IRQ Handler */
160 void KERNEL1_IRQHandler(void);           /**< KERNEL1 IRQ Handler */
161 void M33CTI0_IRQHandler(void);           /**< M33CTI0 IRQ Handler */
162 void M33CTI1_IRQHandler(void);           /**< M33CTI1 IRQ Handler */
163 void FPUEXH_IRQHandler(void);            /**< FPUEXH IRQ Handler */
164 void SETAMPERHOST_IRQHandler(void);      /**< SETAMPERHOST IRQ Handler */
165 void SEMBRX_IRQHandler(void);            /**< SEMBRX IRQ Handler */
166 void SEMBTX_IRQHandler(void);            /**< SEMBTX IRQ Handler */
167 void SYSRTC_APP_IRQHandler(void);        /**< SYSRTC_APP IRQ Handler */
168 void SYSRTC_SEQ_IRQHandler(void);        /**< SYSRTC_SEQ IRQ Handler */
169 void KEYSCAN_IRQHandler(void);           /**< KEYSCAN IRQ Handler */
170 void RFECA0_IRQHandler(void);            /**< RFECA0 IRQ Handler */
171 void RFECA1_IRQHandler(void);            /**< RFECA1 IRQ Handler */
172 void VDAC0_IRQHandler(void);             /**< VDAC0 IRQ Handler */
173 void VDAC1_IRQHandler(void);             /**< VDAC1 IRQ Handler */
174 void AHB2AHB0_IRQHandler(void);          /**< AHB2AHB0 IRQ Handler */
175 void AHB2AHB1_IRQHandler(void);          /**< AHB2AHB1 IRQ Handler */
176 
177 #if (__FPU_PRESENT == 1)
178 void FPUEH_IRQHandler(void);        /**< FPU IRQ Handler */
179 #endif
180 
181 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
182 uint32_t SystemHCLKGet(void);
183 
184 /**************************************************************************//**
185  * @brief
186  *   Update CMSIS SystemCoreClock variable.
187  *
188  * @details
189  *   CMSIS defines a global variable SystemCoreClock that shall hold the
190  *   core frequency in Hz. If the core frequency is dynamically changed, the
191  *   variable must be kept updated in order to be CMSIS compliant.
192  *
193  *   Notice that only if changing the core clock frequency through the EMLIB
194  *   CMU API, this variable will be kept updated. This function is only
195  *   provided for CMSIS compliance and if a user modifies the the core clock
196  *   outside the EMLIB CMU API.
197  *****************************************************************************/
SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM,SL_CODE_CLASS_TIME_CRITICAL)198 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
199 static __INLINE uint32_t SystemCoreClockGet(void)
200 {
201   return SystemHCLKGet();
202 }
203 
204 /**************************************************************************//**
205  * @brief
206  *   Update CMSIS SystemCoreClock variable.
207  *
208  * @details
209  *   CMSIS defines a global variable SystemCoreClock that shall hold the
210  *   core frequency in Hz. If the core frequency is dynamically changed, the
211  *   variable must be kept updated in order to be CMSIS compliant.
212  *
213  *   Notice that only if changing the core clock frequency through the EMLIB
214  *   CMU API, this variable will be kept updated. This function is only
215  *   provided for CMSIS compliance and if a user modifies the the core clock
216  *   outside the EMLIB CMU API.
217  *****************************************************************************/
SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM,SL_CODE_CLASS_TIME_CRITICAL)218 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
219 static __INLINE void SystemCoreClockUpdate(void)
220 {
221   SystemHCLKGet();
222 }
223 
224 void     SystemInit(void);
225 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
226 uint32_t SystemHFRCODPLLClockGet(void);
227 void     SystemHFRCODPLLClockSet(uint32_t freq);
228 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
229 uint32_t SystemSYSCLKGet(void);
230 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
231 uint32_t SystemMaxCoreClockGet(void);
232 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
233 uint32_t SystemFSRCOClockGet(void);
234 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
235 uint32_t SystemHFXOClockGet(void);
236 void     SystemHFXOClockSet(uint32_t freq);
237 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
238 uint32_t SystemCLKIN0Get(void);
239 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
240 uint32_t SystemHFRCOEM23ClockGet(void);
241 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
242 uint32_t SystemLFXOClockGet(void);
243 void     SystemLFXOClockSet(uint32_t freq);
244 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
245 uint32_t SystemLFRCOClockGet(void);
246 SL_CODE_CLASSIFY(SL_CODE_COMPONENT_SYSTEM, SL_CODE_CLASS_TIME_CRITICAL)
247 uint32_t SystemULFRCOClockGet(void);
248 
249 /** @} End of group */
250 /** @} End of group Parts */
251 
252 #ifdef __cplusplus
253 }
254 #endif
255 #endif /* SYSTEM_EFR32MG24_H */
256