1 /**************************************************************************//**
2 * @file
3 * @brief CMSIS system header file for EFR32BG27
4 ******************************************************************************
5 * # License
6 * <b>Copyright 2023 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_EFR32BG27_H
32 #define SYSTEM_EFR32BG27_H
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <stdint.h>
39
40 /***************************************************************************//**
41 * @addtogroup Parts
42 * @{
43 ******************************************************************************/
44 /***************************************************************************//**
45 * @addtogroup EFR32BG27 EFR32BG27
46 * @{
47 ******************************************************************************/
48
49 /*******************************************************************************
50 ****************************** TYPEDEFS ***********************************
51 ******************************************************************************/
52
53 /* Interrupt vectortable entry */
54 typedef union {
55 void (*VECTOR_TABLE_Type)(void);
56 void *topOfStack;
57 } tVectorEntry;
58
59 /*******************************************************************************
60 ************************** GLOBAL VARIABLES *******************************
61 ******************************************************************************/
62
63 #if !defined(SYSTEM_NO_STATIC_MEMORY)
64 extern uint32_t SystemCoreClock; /**< System Clock Frequency (Core Clock) */
65 extern uint32_t SystemHfrcoFreq; /**< System HFRCO frequency */
66 #endif
67
68 /*Re-direction of IRQn.*/
69 #if defined (SL_TRUSTZONE_SECURE)
70 #define SMU_PRIVILEGED_IRQn SMU_S_PRIVILEGED_IRQn
71 #else
72 #define SMU_PRIVILEGED_IRQn SMU_NS_PRIVILEGED_IRQn
73 #endif /* SL_TRUSTZONE_SECURE */
74
75 /*Re-direction of IRQHandler.*/
76 #if defined (SL_TRUSTZONE_SECURE)
77 #define SMU_PRIVILEGED_IRQHandler SMU_S_PRIVILEGED_IRQHandler
78 #else
79 #define SMU_PRIVILEGED_IRQHandler SMU_NS_PRIVILEGED_IRQHandler
80 #endif /* SL_TRUSTZONE_SECURE */
81
82 /*******************************************************************************
83 ***************************** PROTOTYPES **********************************
84 ******************************************************************************/
85
86 void Reset_Handler(void); /**< Reset Handler */
87 void NMI_Handler(void); /**< NMI Handler */
88 void HardFault_Handler(void); /**< Hard Fault Handler */
89 void MemManage_Handler(void); /**< MPU Fault Handler */
90 void BusFault_Handler(void); /**< Bus Fault Handler */
91 void UsageFault_Handler(void); /**< Usage Fault Handler */
92 void SecureFault_Handler(void); /**< Secure Fault Handler */
93 void SVC_Handler(void); /**< SVCall Handler */
94 void DebugMon_Handler(void); /**< Debug Monitor Handler */
95 void PendSV_Handler(void); /**< PendSV Handler */
96 void SysTick_Handler(void); /**< SysTick Handler */
97
98 /* Part Specific Interrupts */
99 void CRYPTOACC_IRQHandler(void); /**< CRYPTOACC IRQ Handler */
100 void TRNG_IRQHandler(void); /**< TRNG IRQ Handler */
101 void PKE_IRQHandler(void); /**< PKE IRQ Handler */
102 void SMU_SECURE_IRQHandler(void); /**< SMU_SECURE IRQ Handler */
103 void SMU_S_PRIVILEGED_IRQHandler(void); /**< SMU_S_PRIVILEGED IRQ Handler */
104 void SMU_NS_PRIVILEGED_IRQHandler(void); /**< SMU_NS_PRIVILEGED IRQ Handler */
105 void EMU_IRQHandler(void); /**< EMU IRQ Handler */
106 void EMUEFP_IRQHandler(void); /**< EMUEFP IRQ Handler */
107 void DCDC_IRQHandler(void); /**< DCDC IRQ Handler */
108 void ETAMPDET_IRQHandler(void); /**< ETAMPDET IRQ Handler */
109 void TIMER0_IRQHandler(void); /**< TIMER0 IRQ Handler */
110 void TIMER1_IRQHandler(void); /**< TIMER1 IRQ Handler */
111 void TIMER2_IRQHandler(void); /**< TIMER2 IRQ Handler */
112 void TIMER3_IRQHandler(void); /**< TIMER3 IRQ Handler */
113 void TIMER4_IRQHandler(void); /**< TIMER4 IRQ Handler */
114 void RTCC_IRQHandler(void); /**< RTCC IRQ Handler */
115 void USART0_RX_IRQHandler(void); /**< USART0_RX IRQ Handler */
116 void USART0_TX_IRQHandler(void); /**< USART0_TX IRQ Handler */
117 void USART1_RX_IRQHandler(void); /**< USART1_RX IRQ Handler */
118 void USART1_TX_IRQHandler(void); /**< USART1_TX IRQ Handler */
119 void EUSART0_RX_IRQHandler(void); /**< EUSART0_RX IRQ Handler */
120 void EUSART0_TX_IRQHandler(void); /**< EUSART0_TX IRQ Handler */
121 void ICACHE0_IRQHandler(void); /**< ICACHE0 IRQ Handler */
122 void BURTC_IRQHandler(void); /**< BURTC IRQ Handler */
123 void LETIMER0_IRQHandler(void); /**< LETIMER0 IRQ Handler */
124 void SYSCFG_IRQHandler(void); /**< SYSCFG IRQ Handler */
125 void LDMA_IRQHandler(void); /**< LDMA IRQ Handler */
126 void LFXO_IRQHandler(void); /**< LFXO IRQ Handler */
127 void LFRCO_IRQHandler(void); /**< LFRCO IRQ Handler */
128 void ULFRCO_IRQHandler(void); /**< ULFRCO IRQ Handler */
129 void GPIO_ODD_IRQHandler(void); /**< GPIO_ODD IRQ Handler */
130 void GPIO_EVEN_IRQHandler(void); /**< GPIO_EVEN IRQ Handler */
131 void I2C0_IRQHandler(void); /**< I2C0 IRQ Handler */
132 void I2C1_IRQHandler(void); /**< I2C1 IRQ Handler */
133 void EMUDG_IRQHandler(void); /**< EMUDG IRQ Handler */
134 void EMUSE_IRQHandler(void); /**< EMUSE IRQ Handler */
135 void AGC_IRQHandler(void); /**< AGC IRQ Handler */
136 void BUFC_IRQHandler(void); /**< BUFC IRQ Handler */
137 void FRC_PRI_IRQHandler(void); /**< FRC_PRI IRQ Handler */
138 void FRC_IRQHandler(void); /**< FRC IRQ Handler */
139 void MODEM_IRQHandler(void); /**< MODEM IRQ Handler */
140 void PROTIMER_IRQHandler(void); /**< PROTIMER IRQ Handler */
141 void RAC_RSM_IRQHandler(void); /**< RAC_RSM IRQ Handler */
142 void RAC_SEQ_IRQHandler(void); /**< RAC_SEQ IRQ Handler */
143 void RDMAILBOX_IRQHandler(void); /**< RDMAILBOX IRQ Handler */
144 void RFSENSE_IRQHandler(void); /**< RFSENSE IRQ Handler */
145 void SYNTH_IRQHandler(void); /**< SYNTH IRQ Handler */
146 void PRORTC_IRQHandler(void); /**< PRORTC IRQ Handler */
147 void ACMP0_IRQHandler(void); /**< ACMP0 IRQ Handler */
148 void WDOG0_IRQHandler(void); /**< WDOG0 IRQ Handler */
149 void HFXO0_IRQHandler(void); /**< HFXO0 IRQ Handler */
150 void HFRCO0_IRQHandler(void); /**< HFRCO0 IRQ Handler */
151 void CMU_IRQHandler(void); /**< CMU IRQ Handler */
152 void AES_IRQHandler(void); /**< AES IRQ Handler */
153 void IADC_IRQHandler(void); /**< IADC IRQ Handler */
154 void MSC_IRQHandler(void); /**< MSC IRQ Handler */
155 void DPLL0_IRQHandler(void); /**< DPLL0 IRQ Handler */
156 void PDM_IRQHandler(void); /**< PDM IRQ Handler */
157 void SW0_IRQHandler(void); /**< SW0 IRQ Handler */
158 void SW1_IRQHandler(void); /**< SW1 IRQ Handler */
159 void SW2_IRQHandler(void); /**< SW2 IRQ Handler */
160 void SW3_IRQHandler(void); /**< SW3 IRQ Handler */
161 void KERNEL0_IRQHandler(void); /**< KERNEL0 IRQ Handler */
162 void KERNEL1_IRQHandler(void); /**< KERNEL1 IRQ Handler */
163 void M33CTI0_IRQHandler(void); /**< M33CTI0 IRQ Handler */
164 void M33CTI1_IRQHandler(void); /**< M33CTI1 IRQ Handler */
165 void FPUEXH_IRQHandler(void); /**< FPUEXH IRQ Handler */
166
167 #if (__FPU_PRESENT == 1)
168 void FPUEH_IRQHandler(void); /**< FPU IRQ Handler */
169 #endif
170
171 uint32_t SystemHCLKGet(void);
172
173 /**************************************************************************//**
174 * @brief
175 * Update CMSIS SystemCoreClock variable.
176 *
177 * @details
178 * CMSIS defines a global variable SystemCoreClock that shall hold the
179 * core frequency in Hz. If the core frequency is dynamically changed, the
180 * variable must be kept updated in order to be CMSIS compliant.
181 *
182 * Notice that only if changing the core clock frequency through the EMLIB
183 * CMU API, this variable will be kept updated. This function is only
184 * provided for CMSIS compliance and if a user modifies the the core clock
185 * outside the EMLIB CMU API.
186 *****************************************************************************/
SystemCoreClockGet(void)187 static __INLINE uint32_t SystemCoreClockGet(void)
188 {
189 return SystemHCLKGet();
190 }
191
192 /**************************************************************************//**
193 * @brief
194 * Update CMSIS SystemCoreClock variable.
195 *
196 * @details
197 * CMSIS defines a global variable SystemCoreClock that shall hold the
198 * core frequency in Hz. If the core frequency is dynamically changed, the
199 * variable must be kept updated in order to be CMSIS compliant.
200 *
201 * Notice that only if changing the core clock frequency through the EMLIB
202 * CMU API, this variable will be kept updated. This function is only
203 * provided for CMSIS compliance and if a user modifies the the core clock
204 * outside the EMLIB CMU API.
205 *****************************************************************************/
SystemCoreClockUpdate(void)206 static __INLINE void SystemCoreClockUpdate(void)
207 {
208 SystemHCLKGet();
209 }
210
211 void SystemInit(void);
212 #if !defined(SL_LEGACY_LINKER)
213 void FlashToRamCopy(uint32_t *from,
214 uint32_t *to,
215 uint32_t size);
216 #endif
217 uint32_t SystemHFRCODPLLClockGet(void);
218 void SystemHFRCODPLLClockSet(uint32_t freq);
219 uint32_t SystemSYSCLKGet(void);
220 uint32_t SystemMaxCoreClockGet(void);
221 uint32_t SystemFSRCOClockGet(void);
222 uint32_t SystemHFXOClockGet(void);
223 void SystemHFXOClockSet(uint32_t freq);
224 uint32_t SystemCLKIN0Get(void);
225 uint32_t SystemLFXOClockGet(void);
226 void SystemLFXOClockSet(uint32_t freq);
227 uint32_t SystemLFRCOClockGet(void);
228 uint32_t SystemULFRCOClockGet(void);
229
230 /** @} End of group */
231 /** @} End of group Parts */
232
233 #ifdef __cplusplus
234 }
235 #endif
236 #endif /* SYSTEM_EFR32BG27_H */
237