MG32F157 Standard Peripherals Firmware Library
Macros | Functions | Variables
system_mg32f157.c File Reference

CMSIS Cortex-M3 Device Peripheral Access Layer System Source File. More...

#include "mg32f157.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 = HSI_VALUE
 

Detailed Description

CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.

Author
MegawinTech Application Team
Version
V0.0.4
Date
16-June-2023

Macro Definition Documentation

◆ VECT_TAB_OFFSET

#define VECT_TAB_OFFSET   0x0

< Uncomment the line corresponding to the desired System clock (SYSCLK) frequency (after reset the HSI is used as SYSCLK source)

IMPORTANT NOTE:

  1. After each device reset the HSI is used as System clock source.
  2. Please make sure that the selected System clock doesn't exceed your device's maximum frequency.
  3. If none of the define below is enabled, the HSI is used as System clock source.
  4. The System clock configuration functions provided within this file assume that:
    • For Low, Medium and High density Value line devices an external 8MHz crystal is used to drive the System clock.
    • For Low, Medium and High density devices an external 8MHz crystal is used to drive the System clock.
    • For Connectivity line devices an external 25MHz crystal is used to drive the System clock. If you are using different crystal you have to adapt those functions accordingly.

< 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 0x200.

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 = HSI_VALUE

< HSI Selected as System Clock source System Clock Frequency (Core Clock)