1 #include "efm32g_af_pins.h"
2 #include "efm32g_af_ports.h"
3 #include "efm32g_af_channels.h"
4 #include "efm32g_prs_signals.h"
5 
6 /***************************************************************************//**
7  * @file
8  * @brief CMSIS Cortex-M3 System Layer for EFM32G devices.
9  * @author Energy Micro AS
10  * @version 3.0.0
11  *******************************************************************************
12  * @section License
13  * <b>(C) Copyright 2012 Energy Micro AS, http://www.energymicro.com</b>
14  *******************************************************************************
15  *
16  * Permission is granted to anyone to use this software for any purpose,
17  * including commercial applications, and to alter it and redistribute it
18  * freely, subject to the following restrictions:
19  *
20  * 1. The origin of this software must not be misrepresented; you must not
21  *    claim that you wrote the original software.
22  * 2. Altered source versions must be plainly marked as such, and must not be
23  *    misrepresented as being the original software.
24  * 3. This notice may not be removed or altered from any source distribution.
25  *
26  * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
27  * obligation to support this Software. Energy Micro AS is providing the
28  * Software "AS IS", with no express or implied warranties of any kind,
29  * including, but not limited to, any implied warranties of merchantability
30  * or fitness for any particular purpose or warranties against infringement
31  * of any proprietary rights of a third party.
32  *
33  * Energy Micro AS will not be liable for any consequential, incidental, or
34  * special damages, or any other relief, or for any claim by any third party,
35  * arising from your use of this Software.
36  *
37  ******************************************************************************/
38 
39 #ifndef __SYSTEM_EFM32G_H
40 #define __SYSTEM_EFM32G_H
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #include <stdint.h>
47 
48 /*******************************************************************************
49  **************************   GLOBAL VARIABLES   *******************************
50  ******************************************************************************/
51 
52 extern uint32_t SystemCoreClock;    /**< System Clock Frequency (Core Clock) */
53 
54 /*******************************************************************************
55  *****************************   PROTOTYPES   **********************************
56  ******************************************************************************/
57 
58 /* Interrupt routines - prototypes */
59 #if defined(_EFM32_GECKO_FAMILY)
60 void Reset_Handler(void);
61 void NMI_Handler(void);
62 void HardFault_Handler(void);
63 void MemManage_Handler(void);
64 void BusFault_Handler(void);
65 void UsageFault_Handler(void);
66 void SVC_Handler(void);
67 void DebugMon_Handler(void);
68 void PendSV_Handler(void);
69 void SysTick_Handler(void);
70 void DMA_IRQHandler(void);
71 void GPIO_EVEN_IRQHandler(void);
72 void TIMER0_IRQHandler(void);
73 void USART0_RX_IRQHandler(void);
74 void USART0_TX_IRQHandler(void);
75 void ACMP0_IRQHandler(void);
76 void ADC0_IRQHandler(void);
77 void DAC0_IRQHandler(void);
78 void I2C0_IRQHandler(void);
79 void GPIO_ODD_IRQHandler(void);
80 void TIMER1_IRQHandler(void);
81 void TIMER2_IRQHandler(void);
82 void USART1_RX_IRQHandler(void);
83 void USART1_TX_IRQHandler(void);
84 void USART2_RX_IRQHandler(void);
85 void USART2_TX_IRQHandler(void);
86 void UART0_RX_IRQHandler(void);
87 void UART0_TX_IRQHandler(void);
88 void LEUART0_IRQHandler(void);
89 void LEUART1_IRQHandler(void);
90 void LETIMER0_IRQHandler(void);
91 void PCNT0_IRQHandler(void);
92 void PCNT1_IRQHandler(void);
93 void PCNT2_IRQHandler(void);
94 void RTC_IRQHandler(void);
95 void CMU_IRQHandler(void);
96 void VCMP_IRQHandler(void);
97 void LCD_IRQHandler(void);
98 void MSC_IRQHandler(void);
99 void AES_IRQHandler(void);
100 #endif
101 
102 uint32_t SystemCoreClockGet(void);
103 
104 /**************************************************************************//**
105  * @brief
106  *   Update CMSIS SystemCoreClock variable.
107  *
108  * @details
109  *   CMSIS defines a global variable SystemCoreClock that shall hold the
110  *   core frequency in Hz. If the core frequency is dynamically changed, the
111  *   variable must be kept updated in order to be CMSIS compliant.
112  *
113  *   Notice that if only changing core clock frequency through the EFM32 CMU
114  *   API, this variable will be kept updated. This function is only provided
115  *   for CMSIS compliance and if a user modifies the the core clock outside
116  *   the CMU API.
117  *****************************************************************************/
SystemCoreClockUpdate(void)118 static __INLINE void SystemCoreClockUpdate(void)
119 {
120   SystemCoreClockGet();
121 }
122 
123 void SystemInit(void);
124 uint32_t SystemHFClockGet(void);
125 uint32_t SystemHFXOClockGet(void);
126 void SystemHFXOClockSet(uint32_t freq);
127 uint32_t SystemLFRCOClockGet(void);
128 uint32_t SystemULFRCOClockGet(void);
129 uint32_t SystemLFXOClockGet(void);
130 void SystemLFXOClockSet(uint32_t freq);
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* __SYSTEM_EFM32G_H */
137