File nut/arch/cm3/dev/stm/system_stm32f2xx.c

(C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE


Included Files

@addtogroup STM32F2xx_System_Private_Includes * @{


Preprocessor definitions

@addtogroup STM32F2xx_System_Private_Defines * @{

#define VECT_TAB_OFFSET 0x00

#define PLL_M 25

#define PLL_N 240

#define PLL_P 2

#define PLL_Q 5


Global Variable SystemCoreClock

@addtogroup STM32F2xx_System_Private_Variables * @{

uint32_t SystemCoreClock

Visible in:   nut/arch/cm3/dev/stm/system_stm32f2xx.c
Used in: SystemCoreClockUpdate() nut/arch/cm3/dev/stm/system_stm32f2xx.c

Local Variables

AHBPrescTable
static const uint8_t AHBPrescTable[16]
Used in: SystemCoreClockUpdate()  

Global Function SystemCoreClockUpdate()

* @brief 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. * * @note - 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/divided by the PLL factors. * * (*) HSI_VALUE is a constant defined in stm32f2xx.h file (default value * 16 MHz) but the real value may vary depending on the variations * in voltage and temperature. * * (**) HSE_VALUE is a constant defined in stm32f2xx.h file (default value * 25 MHz), 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. * * @param None * @retval None

void SystemCoreClockUpdate ( void )

Prototyped in: nut/include/arch/cm3/stm/system_stm32f2xx.h
References Variables: AHBPrescTable nut/arch/cm3/dev/stm/system_stm32f2xx.c
  SystemCoreClock nut/arch/cm3/dev/stm/system_stm32f2xx.c

Global Function SystemInit()

* @brief Setup the microcontroller system * Initialize the Embedded Flash Interface, the PLL and update the * SystemFrequency variable. * @param None * @retval None

void SystemInit ( void )

Prototyped in: nut/include/arch/cm3/stm/system_stm32f2xx.h