The official mbed C/C SDK provides the software platform and libraries to build your applications.
Fork of mbed by
TARGET_EFM32LG_STK3600/system_efm32lg.h@98:8ab26030e058, 2015-04-29 (annotated)
- Committer:
- Kojto
- Date:
- Wed Apr 29 10:16:23 2015 +0100
- Revision:
- 98:8ab26030e058
Release 98 of the mbed library
Changes:
- Silabs new targets (Giant, Zero, Happy, Leopard, Wonder Geckos)
- Asynchronous SPI, I2C, Serial
- LowPower classes
- Nordic - nordic SDK v8.0 update
- Teensy - gcc arm fix for startup
- Nucleo F411 - usb freq fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 98:8ab26030e058 | 1 | /***************************************************************************//** |
Kojto | 98:8ab26030e058 | 2 | * @file system_efm32lg.h |
Kojto | 98:8ab26030e058 | 3 | * @brief CMSIS Cortex-M3 System Layer for EFM32LG devices. |
Kojto | 98:8ab26030e058 | 4 | * @version 3.20.6 |
Kojto | 98:8ab26030e058 | 5 | ****************************************************************************** |
Kojto | 98:8ab26030e058 | 6 | * @section License |
Kojto | 98:8ab26030e058 | 7 | * <b>(C) Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> |
Kojto | 98:8ab26030e058 | 8 | ****************************************************************************** |
Kojto | 98:8ab26030e058 | 9 | * |
Kojto | 98:8ab26030e058 | 10 | * Permission is granted to anyone to use this software for any purpose, |
Kojto | 98:8ab26030e058 | 11 | * including commercial applications, and to alter it and redistribute it |
Kojto | 98:8ab26030e058 | 12 | * freely, subject to the following restrictions: |
Kojto | 98:8ab26030e058 | 13 | * |
Kojto | 98:8ab26030e058 | 14 | * 1. The origin of this software must not be misrepresented; you must not |
Kojto | 98:8ab26030e058 | 15 | * claim that you wrote the original software.@n |
Kojto | 98:8ab26030e058 | 16 | * 2. Altered source versions must be plainly marked as such, and must not be |
Kojto | 98:8ab26030e058 | 17 | * misrepresented as being the original software.@n |
Kojto | 98:8ab26030e058 | 18 | * 3. This notice may not be removed or altered from any source distribution. |
Kojto | 98:8ab26030e058 | 19 | * |
Kojto | 98:8ab26030e058 | 20 | * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc. |
Kojto | 98:8ab26030e058 | 21 | * has no obligation to support this Software. Silicon Laboratories, Inc. is |
Kojto | 98:8ab26030e058 | 22 | * providing the Software "AS IS", with no express or implied warranties of any |
Kojto | 98:8ab26030e058 | 23 | * kind, including, but not limited to, any implied warranties of |
Kojto | 98:8ab26030e058 | 24 | * merchantability or fitness for any particular purpose or warranties against |
Kojto | 98:8ab26030e058 | 25 | * infringement of any proprietary rights of a third party. |
Kojto | 98:8ab26030e058 | 26 | * |
Kojto | 98:8ab26030e058 | 27 | * Silicon Laboratories, Inc. will not be liable for any consequential, |
Kojto | 98:8ab26030e058 | 28 | * incidental, or special damages, or any other relief, or for any claim by |
Kojto | 98:8ab26030e058 | 29 | * any third party, arising from your use of this Software. |
Kojto | 98:8ab26030e058 | 30 | * |
Kojto | 98:8ab26030e058 | 31 | *****************************************************************************/ |
Kojto | 98:8ab26030e058 | 32 | |
Kojto | 98:8ab26030e058 | 33 | #ifndef __SYSTEM_EFM32LG_H |
Kojto | 98:8ab26030e058 | 34 | #define __SYSTEM_EFM32LG_H |
Kojto | 98:8ab26030e058 | 35 | |
Kojto | 98:8ab26030e058 | 36 | #ifdef __cplusplus |
Kojto | 98:8ab26030e058 | 37 | extern "C" { |
Kojto | 98:8ab26030e058 | 38 | #endif |
Kojto | 98:8ab26030e058 | 39 | |
Kojto | 98:8ab26030e058 | 40 | #include <stdint.h> |
Kojto | 98:8ab26030e058 | 41 | |
Kojto | 98:8ab26030e058 | 42 | /******************************************************************************* |
Kojto | 98:8ab26030e058 | 43 | ************************** GLOBAL VARIABLES ******************************* |
Kojto | 98:8ab26030e058 | 44 | ******************************************************************************/ |
Kojto | 98:8ab26030e058 | 45 | |
Kojto | 98:8ab26030e058 | 46 | extern uint32_t SystemCoreClock; /**< System Clock Frequency (Core Clock) */ |
Kojto | 98:8ab26030e058 | 47 | |
Kojto | 98:8ab26030e058 | 48 | /******************************************************************************* |
Kojto | 98:8ab26030e058 | 49 | ***************************** PROTOTYPES ********************************** |
Kojto | 98:8ab26030e058 | 50 | ******************************************************************************/ |
Kojto | 98:8ab26030e058 | 51 | |
Kojto | 98:8ab26030e058 | 52 | /* Interrupt routines - prototypes */ |
Kojto | 98:8ab26030e058 | 53 | #if defined(_EFM32_GIANT_FAMILY) |
Kojto | 98:8ab26030e058 | 54 | void Reset_Handler(void); |
Kojto | 98:8ab26030e058 | 55 | void NMI_Handler(void); |
Kojto | 98:8ab26030e058 | 56 | void HardFault_Handler(void); |
Kojto | 98:8ab26030e058 | 57 | void MemManage_Handler(void); |
Kojto | 98:8ab26030e058 | 58 | void BusFault_Handler(void); |
Kojto | 98:8ab26030e058 | 59 | void UsageFault_Handler(void); |
Kojto | 98:8ab26030e058 | 60 | void SVC_Handler(void); |
Kojto | 98:8ab26030e058 | 61 | void DebugMon_Handler(void); |
Kojto | 98:8ab26030e058 | 62 | void PendSV_Handler(void); |
Kojto | 98:8ab26030e058 | 63 | void SysTick_Handler(void); |
Kojto | 98:8ab26030e058 | 64 | void DMA_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 65 | void GPIO_EVEN_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 66 | void TIMER0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 67 | void USART0_RX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 68 | void USART0_TX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 69 | void USB_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 70 | void ACMP0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 71 | void ADC0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 72 | void DAC0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 73 | void I2C0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 74 | void I2C1_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 75 | void GPIO_ODD_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 76 | void TIMER1_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 77 | void TIMER2_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 78 | void TIMER3_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 79 | void USART1_RX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 80 | void USART1_TX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 81 | void LESENSE_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 82 | void USART2_RX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 83 | void USART2_TX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 84 | void UART0_RX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 85 | void UART0_TX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 86 | void UART1_RX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 87 | void UART1_TX_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 88 | void LEUART0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 89 | void LEUART1_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 90 | void LETIMER0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 91 | void PCNT0_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 92 | void PCNT1_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 93 | void PCNT2_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 94 | void RTC_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 95 | void BURTC_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 96 | void CMU_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 97 | void VCMP_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 98 | void LCD_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 99 | void MSC_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 100 | void AES_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 101 | void EBI_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 102 | void EMU_IRQHandler(void); |
Kojto | 98:8ab26030e058 | 103 | #endif |
Kojto | 98:8ab26030e058 | 104 | |
Kojto | 98:8ab26030e058 | 105 | uint32_t SystemCoreClockGet(void); |
Kojto | 98:8ab26030e058 | 106 | |
Kojto | 98:8ab26030e058 | 107 | /**************************************************************************//** |
Kojto | 98:8ab26030e058 | 108 | * @brief |
Kojto | 98:8ab26030e058 | 109 | * Update CMSIS SystemCoreClock variable. |
Kojto | 98:8ab26030e058 | 110 | * |
Kojto | 98:8ab26030e058 | 111 | * @details |
Kojto | 98:8ab26030e058 | 112 | * CMSIS defines a global variable SystemCoreClock that shall hold the |
Kojto | 98:8ab26030e058 | 113 | * core frequency in Hz. If the core frequency is dynamically changed, the |
Kojto | 98:8ab26030e058 | 114 | * variable must be kept updated in order to be CMSIS compliant. |
Kojto | 98:8ab26030e058 | 115 | * |
Kojto | 98:8ab26030e058 | 116 | * Notice that if only changing core clock frequency through the EFM32 CMU |
Kojto | 98:8ab26030e058 | 117 | * API, this variable will be kept updated. This function is only provided |
Kojto | 98:8ab26030e058 | 118 | * for CMSIS compliance and if a user modifies the the core clock outside |
Kojto | 98:8ab26030e058 | 119 | * the CMU API. |
Kojto | 98:8ab26030e058 | 120 | *****************************************************************************/ |
Kojto | 98:8ab26030e058 | 121 | static __INLINE void SystemCoreClockUpdate(void) |
Kojto | 98:8ab26030e058 | 122 | { |
Kojto | 98:8ab26030e058 | 123 | SystemCoreClockGet(); |
Kojto | 98:8ab26030e058 | 124 | } |
Kojto | 98:8ab26030e058 | 125 | |
Kojto | 98:8ab26030e058 | 126 | void SystemInit(void); |
Kojto | 98:8ab26030e058 | 127 | uint32_t SystemHFClockGet(void); |
Kojto | 98:8ab26030e058 | 128 | uint32_t SystemHFXOClockGet(void); |
Kojto | 98:8ab26030e058 | 129 | void SystemHFXOClockSet(uint32_t freq); |
Kojto | 98:8ab26030e058 | 130 | uint32_t SystemLFRCOClockGet(void); |
Kojto | 98:8ab26030e058 | 131 | uint32_t SystemULFRCOClockGet(void); |
Kojto | 98:8ab26030e058 | 132 | uint32_t SystemLFXOClockGet(void); |
Kojto | 98:8ab26030e058 | 133 | void SystemLFXOClockSet(uint32_t freq); |
Kojto | 98:8ab26030e058 | 134 | |
Kojto | 98:8ab26030e058 | 135 | #ifdef __cplusplus |
Kojto | 98:8ab26030e058 | 136 | } |
Kojto | 98:8ab26030e058 | 137 | #endif |
Kojto | 98:8ab26030e058 | 138 | #endif /* __SYSTEM_EFM32LG_H */ |