亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? system_stm32f10x.c

?? 學(xué)習(xí)stm32定時(shí)器
?? C
?? 第 1 頁 / 共 3 頁
字號:
/**
  ******************************************************************************
  * @file    SPI/SPI_FLASH/system_stm32f10x.c
  * @author  MCD Application Team
  * @version V3.5.0
  * @date    08-April-2011
  * @brief   CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
  * 
  * 1.  This file provides two functions and one global variable to be called from 
  *     user application:
  *      - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
  *                      factors, AHB/APBx prescalers and Flash settings). 
  *                      This function is called at startup just after reset and 
  *                      before branch to main program. This call is made inside
  *                      the "startup_stm32f10x_xx.s" file.
  *
  *      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
  *                                  by the user application to setup the SysTick 
  *                                  timer or configure other parameters.
  *                                     
  *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
  *                                 be called whenever the core clock is changed
  *                                 during program execution.
  *
  * 2. After each device reset the HSI (8 MHz) is used as system clock source.
  *    Then SystemInit() function is called, in "startup_stm32f10x_xx.s" file, to
  *    configure the system clock before to branch to main program.
  *
  * 3. If the system clock source selected by user fails to startup, the SystemInit()
  *    function will do nothing and HSI still used as system clock source. User can 
  *    add some code to deal with this issue inside the SetSysClock() function.
  *
  * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depedning on
  *    the product used), refer to "HSE_VALUE" define in "stm32f10x.h" file. 
  *    When HSE is used as system clock source, directly or through PLL, and you
  *    are using different crystal you have to adapt the HSE value to your own
  *    configuration.
  *        
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************
  */

/** @addtogroup CMSIS
  * @{
  */

/** @addtogroup stm32f10x_system
  * @{
  */  
  
/** @addtogroup STM32F10x_System_Private_Includes
  * @{
  */

#include "stm32f10x.h"

/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_TypesDefinitions
  * @{
  */

/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_Defines
  * @{
  */

/*!< 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.
    */
    
#if defined (STM32F10X_LD_VL) || (defined STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
/* #define SYSCLK_FREQ_HSE    HSE_VALUE */
 #define SYSCLK_FREQ_24MHz  24000000
#else
/* #define SYSCLK_FREQ_HSE    HSE_VALUE */
/* #define SYSCLK_FREQ_24MHz  24000000 */ 
/* #define SYSCLK_FREQ_36MHz  36000000 */
/* #define SYSCLK_FREQ_48MHz  48000000 */
/* #define SYSCLK_FREQ_56MHz  56000000 */
#define SYSCLK_FREQ_72MHz  72000000
#endif

/*!< Uncomment the following line if you need to use external SRAM mounted
     on STM3210E-EVAL board (STM32 High density and XL-density devices) or on 
     STM32100E-EVAL board (STM32 High-density value line devices) as data memory */ 
#if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
/* #define DATA_IN_ExtSRAM */
#endif

/*!< Uncomment the following line if you need to relocate your vector Table in
     Internal SRAM. */ 
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET  0x0 /*!< Vector Table base offset field. 
                                  This value must be a multiple of 0x200. */


/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_Macros
  * @{
  */

/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_Variables
  * @{
  */

/*******************************************************************************
*  Clock Definitions
*******************************************************************************/
#ifdef SYSCLK_FREQ_HSE
  uint32_t SystemCoreClock         = SYSCLK_FREQ_HSE;        /*!< System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_24MHz
  uint32_t SystemCoreClock         = SYSCLK_FREQ_24MHz;        /*!< System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_36MHz
  uint32_t SystemCoreClock         = SYSCLK_FREQ_36MHz;        /*!< System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_48MHz
  uint32_t SystemCoreClock         = SYSCLK_FREQ_48MHz;        /*!< System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_56MHz
  uint32_t SystemCoreClock         = SYSCLK_FREQ_56MHz;        /*!< System Clock Frequency (Core Clock) */
#elif defined SYSCLK_FREQ_72MHz
  uint32_t SystemCoreClock         = SYSCLK_FREQ_72MHz;        /*!< System Clock Frequency (Core Clock) */
#else /*!< HSI Selected as System Clock source */
  uint32_t SystemCoreClock         = HSI_VALUE;        /*!< System Clock Frequency (Core Clock) */
#endif

__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_FunctionPrototypes
  * @{
  */

static void SetSysClock(void);

#ifdef SYSCLK_FREQ_HSE
  static void SetSysClockToHSE(void);
#elif defined SYSCLK_FREQ_24MHz
  static void SetSysClockTo24(void);
#elif defined SYSCLK_FREQ_36MHz
  static void SetSysClockTo36(void);
#elif defined SYSCLK_FREQ_48MHz
  static void SetSysClockTo48(void);
#elif defined SYSCLK_FREQ_56MHz
  static void SetSysClockTo56(void);  
#elif defined SYSCLK_FREQ_72MHz
  static void SetSysClockTo72(void);
#endif

#ifdef DATA_IN_ExtSRAM
  static void SystemInit_ExtMemCtl(void); 
#endif /* DATA_IN_ExtSRAM */

/**
  * @}
  */

/** @addtogroup STM32F10x_System_Private_Functions
  * @{
  */

/**
  * @brief  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.
  * @param  None
  * @retval None
  */
void SystemInit (void)
{
  /* Reset the RCC clock configuration to the default reset state(for debug purpose) */
  /* Set HSION bit */
  RCC->CR |= (uint32_t)0x00000001;

  /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */
#ifndef STM32F10X_CL
  RCC->CFGR &= (uint32_t)0xF8FF0000;
#else
  RCC->CFGR &= (uint32_t)0xF0FF0000;
#endif /* STM32F10X_CL */   
  
  /* Reset HSEON, CSSON and PLLON bits */
  RCC->CR &= (uint32_t)0xFEF6FFFF;

  /* Reset HSEBYP bit */
  RCC->CR &= (uint32_t)0xFFFBFFFF;

  /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */
  RCC->CFGR &= (uint32_t)0xFF80FFFF;

#ifdef STM32F10X_CL
  /* Reset PLL2ON and PLL3ON bits */
  RCC->CR &= (uint32_t)0xEBFFFFFF;

  /* Disable all interrupts and clear pending bits  */
  RCC->CIR = 0x00FF0000;

  /* Reset CFGR2 register */
  RCC->CFGR2 = 0x00000000;
#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
  /* Disable all interrupts and clear pending bits  */
  RCC->CIR = 0x009F0000;

  /* Reset CFGR2 register */
  RCC->CFGR2 = 0x00000000;      
#else
  /* Disable all interrupts and clear pending bits  */
  RCC->CIR = 0x009F0000;
#endif /* STM32F10X_CL */
    
#if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
  #ifdef DATA_IN_ExtSRAM
    SystemInit_ExtMemCtl(); 
  #endif /* DATA_IN_ExtSRAM */
#endif 

  /* Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
  /* Configure the Flash Latency cycles and enable prefetch buffer */
  SetSysClock();

#ifdef VECT_TAB_SRAM
  SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
#else
  SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
#endif 
}

/**
  * @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 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.
  * @param  None
  * @retval None
  */
void SystemCoreClockUpdate (void)
{
  uint32_t tmp = 0, pllmull = 0, pllsource = 0;

#ifdef  STM32F10X_CL
  uint32_t prediv1source = 0, prediv1factor = 0, prediv2factor = 0, pll2mull = 0;
#endif /* STM32F10X_CL */

#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
  uint32_t prediv1factor = 0;
#endif /* STM32F10X_LD_VL or STM32F10X_MD_VL or STM32F10X_HD_VL */
    
  /* Get SYSCLK source -------------------------------------------------------*/
  tmp = RCC->CFGR & RCC_CFGR_SWS;
  
  switch (tmp)
  {
    case 0x00:  /* HSI used as system clock */
      SystemCoreClock = HSI_VALUE;
      break;
    case 0x04:  /* HSE used as system clock */
      SystemCoreClock = HSE_VALUE;
      break;
    case 0x08:  /* PLL used as system clock */

      /* Get PLL clock source and multiplication factor ----------------------*/
      pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
      pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
      
#ifndef STM32F10X_CL      
      pllmull = ( pllmull >> 18) + 2;
      
      if (pllsource == 0x00)
      {
        /* HSI oscillator clock divided by 2 selected as PLL clock entry */
        SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
      }
      else
      {
 #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
       prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
       /* HSE oscillator clock selected as PREDIV1 clock entry */
       SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull; 
 #else
        /* HSE selected as PLL clock entry */
        if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
        {/* HSE oscillator clock divided by 2 */
          SystemCoreClock = (HSE_VALUE >> 1) * pllmull;
        }
        else
        {
          SystemCoreClock = HSE_VALUE * pllmull;
        }
 #endif
      }
#else
      pllmull = pllmull >> 18;
      
      if (pllmull != 0x0D)
      {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费av资源| 成人黄色软件下载| 国产精品久久久久三级| 欧美日韩极品在线观看一区| 精品在线你懂的| 国产精品久久看| 欧美一级高清片| 91麻豆swag| 福利一区福利二区| 日本欧美在线看| 亚洲午夜一区二区| 欧美高清在线一区二区| 日韩一本二本av| 在线影院国内精品| 不卡一区二区三区四区| 国产一区二区主播在线| 天天操天天干天天综合网| 国产精品第四页| 久久亚洲一区二区三区四区| 日韩一区二区三区三四区视频在线观看| 成人高清伦理免费影院在线观看| 麻豆精品蜜桃视频网站| 视频在线在亚洲| 亚洲最新在线观看| 亚洲图片你懂的| 国产精品久久久久aaaa樱花 | 国产午夜精品一区二区三区视频| 欧美日韩一本到| 色88888久久久久久影院野外| 国产激情一区二区三区| 国产主播一区二区| 美女在线一区二区| 日韩电影在线观看电影| 亚洲精品久久久蜜桃| 最新高清无码专区| 亚洲欧美在线高清| 国产精品二三区| 18欧美乱大交hd1984| 中文字幕av一区二区三区| 国产欧美精品一区二区色综合| 久久夜色精品一区| 国产女主播一区| 欧美国产成人精品| 国产精品久久免费看| 国产精品国产三级国产普通话三级| 国产欧美一区二区精品性色| 国产午夜精品一区二区| 国产精品免费久久| 亚洲视频一二区| 亚洲午夜影视影院在线观看| 午夜久久久久久久久| 亚洲成人免费视| 麻豆一区二区99久久久久| 国产在线视视频有精品| 国产精品综合一区二区| 成人国产电影网| 在线一区二区视频| 欧美精品 国产精品| 欧美一级二级三级蜜桃| 久久久蜜桃精品| 中文字幕在线不卡国产视频| 亚洲欧洲精品成人久久奇米网| 亚洲乱码精品一二三四区日韩在线| 亚洲男人电影天堂| 亚洲国产wwwccc36天堂| 日本不卡视频一二三区| 麻豆精品久久精品色综合| 国产精品亚洲а∨天堂免在线| 波多野结衣中文字幕一区| 91蝌蚪国产九色| 欧美日韩激情一区二区| 久久久久久久久岛国免费| 国产精品国产自产拍在线| 亚洲综合久久久| 蜜桃视频第一区免费观看| 国产一区二区在线影院| 色噜噜狠狠色综合中国| 69久久夜色精品国产69蝌蚪网| 久久久精品黄色| 亚洲自拍偷拍综合| 精品影视av免费| 99国产精品久| 制服丝袜亚洲精品中文字幕| 欧美va亚洲va| 亚洲欧美激情在线| 老司机免费视频一区二区三区| 国产超碰在线一区| 欧美熟乱第一页| 国产网站一区二区三区| 亚洲一区二区四区蜜桃| 国产呦萝稀缺另类资源| 欧美视频三区在线播放| 久久精品夜色噜噜亚洲aⅴ| 亚洲在线观看免费视频| 国产精品自产自拍| 欧美日韩二区三区| 日韩一区日韩二区| 国产在线麻豆精品观看| 在线观看免费亚洲| 国产欧美日韩亚州综合 | 亚洲九九爱视频| 久久99精品网久久| 在线观看欧美黄色| 国产女人aaa级久久久级| 日韩精品久久理论片| 95精品视频在线| 久久精品日韩一区二区三区| 视频一区在线播放| 91丝袜高跟美女视频| 久久欧美一区二区| 青青草国产精品97视觉盛宴| 成熟亚洲日本毛茸茸凸凹| 日韩视频免费直播| 日韩激情中文字幕| 91福利资源站| 日韩理论片在线| 波多野结衣亚洲一区| 久久伊99综合婷婷久久伊| 天堂午夜影视日韩欧美一区二区| 99re这里都是精品| 日本一区二区三区国色天香| 麻豆精品视频在线| 日韩一区二区免费在线观看| 亚洲v中文字幕| 不卡一卡二卡三乱码免费网站| 2024国产精品视频| 精品一区二区三区久久| 欧美一区二区福利在线| 亚洲国产日韩a在线播放性色| 一本色道a无线码一区v| 中文字幕亚洲精品在线观看| 粗大黑人巨茎大战欧美成人| 久久久久九九视频| 国产福利一区在线| 久久久久国产一区二区三区四区| 蜜臀av一区二区在线观看| 在线综合视频播放| 男人操女人的视频在线观看欧美| 欧美影院午夜播放| 亚洲综合免费观看高清在线观看| 色88888久久久久久影院野外| 一区二区视频免费在线观看| 色综合一区二区三区| 尤物在线观看一区| 欧美性生交片4| 午夜av电影一区| 欧美一级片免费看| 久久精品国产一区二区三| 久久在线观看免费| 国产乱码精品1区2区3区| 日本一区二区三区高清不卡| 99国产精品久久久久久久久久久| 亚洲日本青草视频在线怡红院| 91女厕偷拍女厕偷拍高清| 综合在线观看色| 在线精品视频免费观看| 午夜不卡av免费| 日韩精品一区二区三区在线观看 | av一区二区三区四区| 日韩毛片在线免费观看| 欧美性欧美巨大黑白大战| 欧美96一区二区免费视频| 精品国产第一区二区三区观看体验 | 中文字幕成人网| 色欧美88888久久久久久影院| 亚洲成人免费观看| 91精品国产品国语在线不卡| 国产乱色国产精品免费视频| 中文字幕一区二区三区不卡| 欧美性生活久久| 韩国欧美一区二区| 中文字幕一区二区三区蜜月| 欧美精品一卡两卡| 国产精品影视网| 亚洲国产精品自拍| 久久精品一区八戒影视| 在线观看日韩国产| 国产精品88888| 午夜精品久久久久久久久久久| 精品成人一区二区三区四区| 97se亚洲国产综合自在线观| 日本亚洲欧美天堂免费| 国产精品久久久久一区二区三区| 欧美日韩在线精品一区二区三区激情 | 国产电影精品久久禁18| 亚洲五月六月丁香激情| 26uuu亚洲综合色欧美| 91论坛在线播放| 久久se精品一区精品二区| 久久久不卡影院| 9191久久久久久久久久久| 国产尤物一区二区| 一区av在线播放| 中文一区在线播放| 欧美日韩视频在线观看一区二区三区 | 亚洲大片精品永久免费| 国产精品视频一二三| 欧美日韩成人综合| 国产91在线|亚洲| 蜜桃av噜噜一区|