release/EM_CMSIS_P1_4.0.0/Device/SiliconLabs/EFM32TG/Source/system_efm32tg.c File Reference

CMSIS Cortex-M3 System Layer for EFM32TG devices. More...

Go to the source code of this file.

Defines

#define EFM32_LFRCO_FREQ   (32768UL)
#define EFM32_ULFRCO_FREQ   (1000UL)
#define EFM32_HFXO_FREQ   (32000000UL)
#define EFM32_LFXO_FREQ   (EFM32_LFRCO_FREQ)

Functions

__STATIC_INLINE uint8_t GetProdRev (void)
uint32_t SystemCoreClockGet (void)
 Get the current core clock frequency.
uint32_t SystemHFClockGet (void)
 Get the current HFCLK frequency.
uint32_t SystemHFXOClockGet (void)
 Get high frequency crystal oscillator clock frequency for target system.
void SystemHFXOClockSet (uint32_t freq)
 Set high frequency crystal oscillator clock frequency for target system.
void SystemInit (void)
 Initialize the system.
uint32_t SystemLFRCOClockGet (void)
 Get low frequency RC oscillator clock frequency for target system.
uint32_t SystemULFRCOClockGet (void)
 Get ultra low frequency RC oscillator clock frequency for target system.
uint32_t SystemLFXOClockGet (void)
 Get low frequency crystal oscillator clock frequency for target system.
void SystemLFXOClockSet (uint32_t freq)
 Set low frequency crystal oscillator clock frequency for target system.

Variables

uint32_t SystemCoreClock
 System System Clock Frequency (Core Clock).


Detailed Description

CMSIS Cortex-M3 System Layer for EFM32TG devices.

Version:
4.0.0

License

(C) Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc. has no obligation to support this Software. Silicon Laboratories, Inc. is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Silicon Laboratories, Inc. will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Definition in file system_efm32tg.c.


Define Documentation

#define EFM32_LFRCO_FREQ   (32768UL)

LFRCO frequency, tuned to below frequency during manufacturing.

Definition at line 41 of file system_efm32tg.c.

Referenced by SystemHFClockGet(), and SystemLFRCOClockGet().


Function Documentation

uint32_t SystemCoreClockGet ( void   ) 

Get the current core clock frequency.

Calculate and get the current core clock frequency based on the current configuration. Assuming that the SystemCoreClock global variable is maintained, the core clock frequency is stored in that variable as well. This function will however calculate the core clock based on actual HW configuration. It will also update the SystemCoreClock global variable.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
The current core clock frequency in Hz.

Definition at line 123 of file system_efm32tg.c.

References _CMU_HFCORECLKDIV_HFCORECLKDIV_MASK, _CMU_HFCORECLKDIV_HFCORECLKDIV_SHIFT, CMU, SystemCoreClock, and SystemHFClockGet().

Referenced by SystemCoreClockUpdate(), SystemHFXOClockSet(), and SystemLFXOClockSet().

uint32_t SystemHFClockGet ( void   ) 

Get the current HFCLK frequency.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
The current HFCLK frequency in Hz.

Definition at line 152 of file system_efm32tg.c.

References _CMU_HFRCOCTRL_BAND_MASK, CMU, CMU_HFRCOCTRL_BAND_11MHZ, CMU_HFRCOCTRL_BAND_14MHZ, CMU_HFRCOCTRL_BAND_1MHZ, CMU_HFRCOCTRL_BAND_21MHZ, CMU_HFRCOCTRL_BAND_28MHZ, CMU_HFRCOCTRL_BAND_7MHZ, CMU_STATUS_HFRCOSEL, CMU_STATUS_HFXOSEL, CMU_STATUS_LFRCOSEL, CMU_STATUS_LFXOSEL, EFM32_LFRCO_FREQ, and GetProdRev().

Referenced by SystemCoreClockGet().

uint32_t SystemHFXOClockGet ( void   ) 

Get high frequency crystal oscillator clock frequency for target system.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
HFXO frequency in Hz.

Definition at line 237 of file system_efm32tg.c.

void SystemHFXOClockSet ( uint32_t  freq  ) 

Set high frequency crystal oscillator clock frequency for target system.

Note:
This function is mainly provided for being able to handle target systems with different HF crystal oscillator frequencies run-time. If used, it should probably only be used once during system startup.

This is an EFM32 proprietary function, not part of the CMSIS definition.

Parameters:
[in] freq HFXO frequency in Hz used for target.

Definition at line 263 of file system_efm32tg.c.

References CMU, CMU_STATUS_HFXOSEL, and SystemCoreClockGet().

void SystemInit ( void   ) 

Initialize the system.

Do required generic HW system init.

Note:
This function is invoked during system init, before the main() routine and any data has been initialized. For this reason, it cannot do any initialization of variables etc.

Definition at line 293 of file system_efm32tg.c.

uint32_t SystemLFRCOClockGet ( void   ) 

Get low frequency RC oscillator clock frequency for target system.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
LFRCO frequency in Hz.

Definition at line 308 of file system_efm32tg.c.

References EFM32_LFRCO_FREQ.

uint32_t SystemLFXOClockGet ( void   ) 

Get low frequency crystal oscillator clock frequency for target system.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
LFXO frequency in Hz.

Definition at line 344 of file system_efm32tg.c.

void SystemLFXOClockSet ( uint32_t  freq  ) 

Set low frequency crystal oscillator clock frequency for target system.

Note:
This function is mainly provided for being able to handle target systems with different HF crystal oscillator frequencies run-time. If used, it should probably only be used once during system startup.

This is an EFM32 proprietary function, not part of the CMSIS definition.

Parameters:
[in] freq LFXO frequency in Hz used for target.

Definition at line 370 of file system_efm32tg.c.

References CMU, CMU_STATUS_LFXOSEL, and SystemCoreClockGet().

uint32_t SystemULFRCOClockGet ( void   ) 

Get ultra low frequency RC oscillator clock frequency for target system.

Note:
This is an EFM32 proprietary function, not part of the CMSIS definition.
Returns:
ULFRCO frequency in Hz.

Definition at line 327 of file system_efm32tg.c.

References EFM32_ULFRCO_FREQ.


Variable Documentation

uint32_t SystemCoreClock

System System Clock Frequency (Core Clock).

Required CMSIS global variable that must be kept up-to-date.

Definition at line 100 of file system_efm32tg.c.

Referenced by SystemCoreClockGet().