Sergey Pastor / grbl1
Embed: (wiki syntax)

« Back to documentation index

STM32F10x_System_Private_Functions

STM32F10x_System_Private_Functions
[Stm32f10x_system]

Functions

void SystemInit (void)
 Setup the microcontroller system Initialize the Embedded Flash Interface, the PLL and update the SystemCoreClock variable.
void SystemCoreClockUpdate (void)
 Update SystemCoreClock variable according to Clock Register Values.
static void SetSysClock (void)
 Configures the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers.
static void SystemInit_ExtMemCtl (void)
 Setup the external memory controller.
static void SetSysClockToHSE (void)
 Selects HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.
static void SetSysClockTo24 (void)
 Sets System clock frequency to 24MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
static void SetSysClockTo36 (void)
 Sets System clock frequency to 36MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
static void SetSysClockTo48 (void)
 Sets System clock frequency to 48MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
static void SetSysClockTo56 (void)
 Sets System clock frequency to 56MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
static void SetSysClockTo72 (void)
 Sets System clock frequency to 72MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Function Documentation

static void SetSysClock ( void   ) [static]

Configures the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers.

Parameters:
None
Return values:
None

Definition at line 419 of file system_stm32f10x.c.

static void SetSysClockTo24 ( void   ) [static]

Sets System clock frequency to 24MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 579 of file system_stm32f10x.c.

static void SetSysClockTo36 ( void   ) [static]

Sets System clock frequency to 36MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

< PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz

Definition at line 683 of file system_stm32f10x.c.

static void SetSysClockTo48 ( void   ) [static]

Sets System clock frequency to 48MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 784 of file system_stm32f10x.c.

static void SetSysClockTo56 ( void   ) [static]

Sets System clock frequency to 56MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 885 of file system_stm32f10x.c.

static void SetSysClockTo72 ( void   ) [static]

Sets System clock frequency to 72MHz and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 987 of file system_stm32f10x.c.

static void SetSysClockToHSE ( void   ) [static]

Selects HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 500 of file system_stm32f10x.c.

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.

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.
- The system frequency computed by this function is not the real frequency in the chip. It is calculated based on the predefined constant and the selected clock source:
  • If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
  • If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
  • If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) or HSI_VALUE(*) multiplied by the PLL factors.

(*) HSI_VALUE is a constant defined in stm32f1xx.h file (default value 8 MHz) but the real value may vary depending on the variations in voltage and temperature.

(**) HSE_VALUE is a constant defined in stm32f1xx.h file (default value 8 MHz or 25 MHz, depedning on the product used), user has to ensure that HSE_VALUE is same as the real frequency of the crystal used. Otherwise, this function may have wrong result.

  • The result of this function could be not correct when using fractional value for HSE crystal.
    Parameters:
    None
    Return values:
    None

Definition at line 306 of file system_stm32f10x.c.

void SystemInit ( void   )

Setup the microcontroller system Initialize the Embedded Flash Interface, the PLL and update the SystemCoreClock variable.

Note:
This function should be used only after reset.
Parameters:
None
Return values:
None

Definition at line 212 of file system_stm32f10x.c.

void SystemInit_ExtMemCtl ( void   ) [static]

Setup the external memory controller.

Called in startup_stm32f10x.s before jump to __main

Parameters:
None
Return values:
NoneSetup the external memory controller. Called in startup_stm32f10x_xx.s/.c before jump to main. This function configures the external SRAM mounted on STM3210E-EVAL board (STM32 High density devices). This SRAM will be used as program data memory (including heap and stack).
Parameters:
None
Return values:
None

< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is required, then adjust the Register Addresses

Definition at line 455 of file system_stm32f10x.c.