MG32F10x Standard Peripherals Firmware Library
Macros | Functions | Variables
system_mg32f10x.c File Reference

CMSIS Device System Source File for MG32F10x Device Series. More...

#include "mg32f10x.h"

Macros

#define VECT_TAB_OFFSET   0x0
 

Functions

void SystemInit (void)
 Setup the microcontroller system. More...
 
void SystemCoreClockUpdate (void)
 Update SystemCoreClock variable according to Clock Register Values. The SystemCoreClock variable contains the core clock (HCLK), it can be used by the user application to setup the SysTick timer or configure other parameters. More...
 

Variables

uint32_t SystemCoreClock = MHSI_VALUE
 

Detailed Description

CMSIS Device System Source File for MG32F10x Device Series.

Version
V0.1.10
Date
05-January-2023

Macro Definition Documentation

◆ VECT_TAB_OFFSET

#define VECT_TAB_OFFSET   0x0

< Uncomment the line corresponding to the desired Main clock (MAINCLK) frequency (after reset, the MHSI is used as MAINCLK source)

Tip: To avoid modifying this file each time you need to use different Main clock, you can define the MAINCLK_FREQ_x in your toolchain compiler preprocessor.

IMPORTANT NOTE:

  1. After reset the MHSI is used as Main clock source.
  2. If none of the following definitions is enabled, the MHSI is used as main clock source.
  3. Please make sure that the selected Main clock doesn't exceed your device's maximum frequency.
  4. If the external crystal is used, the HSE_VALUE macro (defined in mg32f10x.h) must be defined as the frequency value of the external crystal.
  5. In the Main clock configuration functions provided within this file which enabled by MAINCLK_FREQ_xMHz macro:
    • The PLL clock is used as clock source of the Main Clock.
    • When the MAINCLK_PLLSRC_MHSI macro is defined, MHSI is used as PLL clock source, otherwise HSE is used as PLL clock source.
    • If HSE is used as PLL clock source, the desired clock frequency is configured depending on the external crystal frequency defined by HSE_VALUE.

< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. Vector Table base offset field. This value must be a multiple of 0x100.

Function Documentation

◆ SystemCoreClockUpdate()

void SystemCoreClockUpdate ( void  )

Update SystemCoreClock variable according to Clock Register Values. The SystemCoreClock variable contains the core clock (HCLK), it can be used by the user application to setup the SysTick timer or configure other parameters.

Update SystemCoreClock variable.

Note
Each time the core clock (HCLK) changes, this function must be called to update SystemCoreClock variable value. Otherwise, any configuration based on this variable will be incorrect.
Parameters
None
Returns
None

◆ SystemInit()

void SystemInit ( void  )

Setup the microcontroller system.

Note
This function should be used only after reset.
Parameters
None
Returns
None

Variable Documentation

◆ SystemCoreClock

uint32_t SystemCoreClock = MHSI_VALUE

System Clock Frequency (Core Clock)