1
0

system_efm32g.h 4.8 KB

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