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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32f10x_rcc.c

?? STM32手持式示波器源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/**
  ******************************************************************************
  * @file    stm32f10x_rcc.c
  * @author  MCD Application Team
  * @version V3.1.2
  * @date    09/28/2009
  * @brief   This file provides all the RCC firmware functions.
  ******************************************************************************
  * @copy
  *
  * 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 2009 STMicroelectronics</center></h2>
  */ 

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_rcc.h"

/** @addtogroup STM32F10x_StdPeriph_Driver
  * @{
  */

/** @defgroup RCC 
  * @brief RCC driver modules
  * @{
  */ 

/** @defgroup RCC_Private_TypesDefinitions
  * @{
  */

/**
  * @}
  */

/** @defgroup RCC_Private_Defines
  * @{
  */

/* ------------ RCC registers bit address in the alias region ----------- */
#define RCC_OFFSET                (RCC_BASE - PERIPH_BASE)

/* --- CR Register ---*/

/* Alias word address of HSION bit */
#define CR_OFFSET                 (RCC_OFFSET + 0x00)
#define HSION_BitNumber           0x00
#define CR_HSION_BB               (PERIPH_BB_BASE + (CR_OFFSET * 32) + (HSION_BitNumber * 4))

/* Alias word address of PLLON bit */
#define PLLON_BitNumber           0x18
#define CR_PLLON_BB               (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLON_BitNumber * 4))

#ifdef STM32F10X_CL
 /* Alias word address of PLL2ON bit */
 #define PLL2ON_BitNumber          0x1A
 #define CR_PLL2ON_BB              (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLL2ON_BitNumber * 4))

 /* Alias word address of PLL3ON bit */
 #define PLL3ON_BitNumber          0x1C
 #define CR_PLL3ON_BB              (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLL3ON_BitNumber * 4))
#endif /* STM32F10X_CL */ 

/* Alias word address of CSSON bit */
#define CSSON_BitNumber           0x13
#define CR_CSSON_BB               (PERIPH_BB_BASE + (CR_OFFSET * 32) + (CSSON_BitNumber * 4))

/* --- CFGR Register ---*/

/* Alias word address of USBPRE bit */
#define CFGR_OFFSET               (RCC_OFFSET + 0x04)

#ifndef STM32F10X_CL
 #define USBPRE_BitNumber          0x16
 #define CFGR_USBPRE_BB            (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (USBPRE_BitNumber * 4))
#else
 #define OTGFSPRE_BitNumber        0x16
 #define CFGR_OTGFSPRE_BB          (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (OTGFSPRE_BitNumber * 4))
#endif /* STM32F10X_CL */ 

/* --- BDCR Register ---*/

/* Alias word address of RTCEN bit */
#define BDCR_OFFSET               (RCC_OFFSET + 0x20)
#define RTCEN_BitNumber           0x0F
#define BDCR_RTCEN_BB             (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (RTCEN_BitNumber * 4))

/* Alias word address of BDRST bit */
#define BDRST_BitNumber           0x10
#define BDCR_BDRST_BB             (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4))

/* --- CSR Register ---*/

/* Alias word address of LSION bit */
#define CSR_OFFSET                (RCC_OFFSET + 0x24)
#define LSION_BitNumber           0x00
#define CSR_LSION_BB              (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (LSION_BitNumber * 4))

#ifdef STM32F10X_CL
/* --- CFGR2 Register ---*/

 /* Alias word address of I2S2SRC bit */
 #define CFGR2_OFFSET              (RCC_OFFSET + 0x2C)
 #define I2S2SRC_BitNumber         0x11
 #define CFGR2_I2S2SRC_BB          (PERIPH_BB_BASE + (CFGR2_OFFSET * 32) + (I2S2SRC_BitNumber * 4))

 /* Alias word address of I2S3SRC bit */
 #define I2S3SRC_BitNumber         0x12
 #define CFGR2_I2S3SRC_BB          (PERIPH_BB_BASE + (CFGR2_OFFSET * 32) + (I2S3SRC_BitNumber * 4))
#endif /* STM32F10X_CL */

/* ---------------------- RCC registers bit mask ------------------------ */

/* CR register bit mask */
#define CR_HSEBYP_Reset           ((uint32_t)0xFFFBFFFF)
#define CR_HSEBYP_Set             ((uint32_t)0x00040000)
#define CR_HSEON_Reset            ((uint32_t)0xFFFEFFFF)
#define CR_HSEON_Set              ((uint32_t)0x00010000)
#define CR_HSITRIM_Mask           ((uint32_t)0xFFFFFF07)

/* CFGR register bit mask */
#ifndef STM32F10X_CL
 #define CFGR_PLL_Mask            ((uint32_t)0xFFC0FFFF)
#else
 #define CFGR_PLL_Mask           ((uint32_t)0xFFC2FFFF)
#endif /* STM32F10X_CL */ 

#define CFGR_PLLMull_Mask         ((uint32_t)0x003C0000)
#define CFGR_PLLSRC_Mask          ((uint32_t)0x00010000)
#define CFGR_PLLXTPRE_Mask        ((uint32_t)0x00020000)
#define CFGR_SWS_Mask             ((uint32_t)0x0000000C)
#define CFGR_SW_Mask              ((uint32_t)0xFFFFFFFC)
#define CFGR_HPRE_Reset_Mask      ((uint32_t)0xFFFFFF0F)
#define CFGR_HPRE_Set_Mask        ((uint32_t)0x000000F0)
#define CFGR_PPRE1_Reset_Mask     ((uint32_t)0xFFFFF8FF)
#define CFGR_PPRE1_Set_Mask       ((uint32_t)0x00000700)
#define CFGR_PPRE2_Reset_Mask     ((uint32_t)0xFFFFC7FF)
#define CFGR_PPRE2_Set_Mask       ((uint32_t)0x00003800)
#define CFGR_ADCPRE_Reset_Mask    ((uint32_t)0xFFFF3FFF)
#define CFGR_ADCPRE_Set_Mask      ((uint32_t)0x0000C000)

/* CSR register bit mask */
#define CSR_RMVF_Set              ((uint32_t)0x01000000)

#ifdef STM32F10X_CL
/* CFGR2 register bit mask */
 #define CFGR2_PREDIV1SRC         ((uint32_t)0x00010000)
 #define CFGR2_PREDIV1            ((uint32_t)0x0000000F)
 #define CFGR2_PREDIV2            ((uint32_t)0x000000F0)
 #define CFGR2_PLL2MUL            ((uint32_t)0x00000F00)
 #define CFGR2_PLL3MUL            ((uint32_t)0x0000F000)
#endif /* STM32F10X_CL */ 

/* RCC Flag Mask */
#define FLAG_Mask                 ((uint8_t)0x1F)

#ifndef HSI_Value
/* Typical Value of the HSI in Hz */
 #define HSI_Value                 ((uint32_t)8000000)
#endif /* HSI_Value */

/* CIR register byte 2 (Bits[15:8]) base address */
#define CIR_BYTE2_ADDRESS         ((uint32_t)0x40021009)

/* CIR register byte 3 (Bits[23:16]) base address */
#define CIR_BYTE3_ADDRESS         ((uint32_t)0x4002100A)

/* CFGR register byte 4 (Bits[31:24]) base address */
#define CFGR_BYTE4_ADDRESS        ((uint32_t)0x40021007)

/* BDCR register base address */
#define BDCR_ADDRESS              (PERIPH_BASE + BDCR_OFFSET)

#ifndef HSEStartUp_TimeOut
/* Time out for HSE start up */
 #define HSEStartUp_TimeOut        ((uint16_t)0x0500)
#endif /* HSEStartUp_TimeOut */

/**
  * @}
  */ 

/** @defgroup RCC_Private_Macros
  * @{
  */ 

/**
  * @}
  */ 

/** @defgroup RCC_Private_Variables
  * @{
  */ 

static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
static __I uint8_t ADCPrescTable[4] = {2, 4, 6, 8};

/**
  * @}
  */

/** @defgroup RCC_Private_FunctionPrototypes
  * @{
  */

/**
  * @}
  */

/** @defgroup RCC_Private_Functions
  * @{
  */

/**
  * @brief  Resets the RCC clock configuration to the default reset state.
  * @param  None
  * @retval None
  */
void RCC_DeInit(void)
{
  /* 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;

#ifndef STM32F10X_CL
  /* Disable all interrupts and clear pending bits  */
  RCC->CIR = 0x009F0000;
#else
  /* 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;
#endif /* STM32F10X_CL */
}

/**
  * @brief  Configures the External High Speed oscillator (HSE).
  * @note   HSE can not be stopped if it is used directly or through the PLL as system clock.
  * @param  RCC_HSE: specifies the new state of the HSE.
  *   This parameter can be one of the following values:
  *     @arg RCC_HSE_OFF: HSE oscillator OFF
  *     @arg RCC_HSE_ON: HSE oscillator ON
  *     @arg RCC_HSE_Bypass: HSE oscillator bypassed with external clock
  * @retval None
  */
void RCC_HSEConfig(uint32_t RCC_HSE)
{
  /* Check the parameters */
  assert_param(IS_RCC_HSE(RCC_HSE));
  /* Reset HSEON and HSEBYP bits before configuring the HSE ------------------*/
  /* Reset HSEON bit */
  RCC->CR &= CR_HSEON_Reset;
  /* Reset HSEBYP bit */
  RCC->CR &= CR_HSEBYP_Reset;
  /* Configure HSE (RCC_HSE_OFF is already covered by the code section above) */
  switch(RCC_HSE)
  {
    case RCC_HSE_ON:
      /* Set HSEON bit */
      RCC->CR |= CR_HSEON_Set;
      break;
      
    case RCC_HSE_Bypass:
      /* Set HSEBYP and HSEON bits */
      RCC->CR |= CR_HSEBYP_Set | CR_HSEON_Set;
      break;
      
    default:
      break;
  }
}

/**
  * @brief  Waits for HSE start-up.
  * @param  None
  * @retval An ErrorStatus enumuration value:
  * - SUCCESS: HSE oscillator is stable and ready to use
  * - ERROR: HSE oscillator not yet ready
  */
ErrorStatus RCC_WaitForHSEStartUp(void)
{
  __IO uint32_t StartUpCounter = 0;
  ErrorStatus status = ERROR;
  FlagStatus HSEStatus = RESET;
  
  /* Wait till HSE is ready and if Time out is reached exit */
  do
  {
    HSEStatus = RCC_GetFlagStatus(RCC_FLAG_HSERDY);
    StartUpCounter++;  
  } while((StartUpCounter != HSEStartUp_TimeOut) && (HSEStatus == RESET));
  
  if (RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET)
  {
    status = SUCCESS;
  }
  else
  {
    status = ERROR;
  }  
  return (status);
}

/**
  * @brief  Adjusts the Internal High Speed oscillator (HSI) calibration value.
  * @param  HSICalibrationValue: specifies the calibration trimming value.
  *   This parameter must be a number between 0 and 0x1F.
  * @retval None
  */
void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue)
{
  uint32_t tmpreg = 0;
  /* Check the parameters */
  assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue));
  tmpreg = RCC->CR;
  /* Clear HSITRIM[4:0] bits */
  tmpreg &= CR_HSITRIM_Mask;
  /* Set the HSITRIM[4:0] bits according to HSICalibrationValue value */
  tmpreg |= (uint32_t)HSICalibrationValue << 3;
  /* Store the new value */
  RCC->CR = tmpreg;
}

/**
  * @brief  Enables or disables the Internal High Speed oscillator (HSI).
  * @note   HSI can not be stopped if it is used directly or through the PLL as system clock.
  * @param  NewState: new state of the HSI. This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void RCC_HSICmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  *(__IO uint32_t *) CR_HSION_BB = (uint32_t)NewState;
}

/**
  * @brief  Configures the PLL clock source and multiplication factor.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费高清在线| 午夜精品久久久久影视| 国产精品一区二区在线观看网站| 制服丝袜国产精品| 精品一区二区三区免费观看| 精品91自产拍在线观看一区| 国产精品99久久久久久似苏梦涵 | 精品国产乱码久久久久久浪潮| 捆绑紧缚一区二区三区视频| 久久综合九色综合97_久久久| 成人午夜免费电影| 亚洲精品自拍动漫在线| 3d动漫精品啪啪一区二区竹菊 | 久久久久久久久久久久电影| 国产成人免费网站| 亚洲资源中文字幕| 欧美不卡一区二区| 99re这里都是精品| 日韩精品高清不卡| 国产婷婷精品av在线| 91首页免费视频| 丝袜亚洲精品中文字幕一区| 久久久久综合网| 91捆绑美女网站| 蜜臀av国产精品久久久久| 国产无一区二区| 欧美视频在线不卡| 国产精品自拍一区| 亚洲一区二区三区小说| 久久色成人在线| 日本丰满少妇一区二区三区| 蜜臀av一级做a爰片久久| 国产精品久久久久久久久果冻传媒 | 亚洲国产va精品久久久不卡综合| 欧美电影免费观看完整版| 91在线一区二区| 麻豆成人91精品二区三区| 亚洲天堂2014| 精品国产乱码久久久久久老虎 | 精品一区二区三区蜜桃| 一区二区三区毛片| 国产午夜亚洲精品羞羞网站| 欧美久久久久久久久| 成人久久18免费网站麻豆| 美女视频网站久久| 亚洲自拍偷拍欧美| 国产精品久久久久久久久免费相片 | 老司机精品视频线观看86| 一区二区欧美视频| 国产蜜臀97一区二区三区| 欧美一区二区在线观看| 一本一道综合狠狠老| 国产精品亚洲第一| 九色|91porny| 天堂av在线一区| 亚洲精品国产第一综合99久久| 久久久高清一区二区三区| 欧美一区二区三区在线| 欧美图片一区二区三区| 91网站黄www| 久久久久国产精品人| 精品免费视频一区二区| 91麻豆精品国产91久久久久久久久 | 亚洲欧洲日韩综合一区二区| 精品sm捆绑视频| 91精品国模一区二区三区| 欧美日韩一级大片网址| 日本精品一级二级| 91浏览器在线视频| 色噜噜狠狠色综合欧洲selulu| www.日本不卡| 成人一区二区三区在线观看| 国产一区二区三区视频在线播放 | 国内精品久久久久影院一蜜桃| 免费观看在线综合| 看电视剧不卡顿的网站| 午夜视频一区二区三区| 亚洲mv在线观看| 亚洲成人久久影院| 视频在线观看91| 日韩精品久久久久久| 日本欧美加勒比视频| 蜜臀av亚洲一区中文字幕| 麻豆国产精品官网| 国产黄色成人av| 顶级嫩模精品视频在线看| 成人激情文学综合网| 97精品国产97久久久久久久久久久久 | 亚洲免费在线视频一区 二区| 亚洲女同ⅹxx女同tv| 亚洲欧美日韩一区| 亚洲午夜在线观看视频在线| 亚洲成a人片综合在线| 日韩av午夜在线观看| 久久97超碰国产精品超碰| 国产一区二区久久| av中文字幕不卡| 欧美体内she精高潮| 日韩一区二区在线看| 精品国产一区二区三区久久影院 | 99国产一区二区三精品乱码| 色哟哟国产精品| 欧美精品v国产精品v日韩精品| 日韩午夜激情电影| 国产日韩欧美综合一区| 亚洲欧美国产三级| 日本女优在线视频一区二区| 国产在线国偷精品免费看| jlzzjlzz亚洲日本少妇| 欧美日韩在线播放三区| 久久亚洲一区二区三区明星换脸 | 国产成人精品综合在线观看| 色婷婷综合久久久久中文| 4438亚洲最大| 国产精品久久久久久久午夜片| 五月天一区二区三区| 国产成人精品午夜视频免费| 777奇米四色成人影色区| 国产三级一区二区三区| 一区二区日韩av| 国产精品资源网| 欧美视频在线观看一区| 欧美激情艳妇裸体舞| 亚洲成av人片一区二区| 粉嫩嫩av羞羞动漫久久久| 欧美日韩美少妇 | 亚洲视频一区二区免费在线观看| 日韩国产欧美三级| 91视频精品在这里| 精品免费一区二区三区| 亚洲成人中文在线| av午夜一区麻豆| 欧美videossexotv100| 亚洲免费在线视频一区 二区| 国产麻豆一精品一av一免费| 在线观看视频欧美| 国产精品久久看| 久久不见久久见免费视频1| 欧美性大战久久久| 国产精品国产a级| 国产一区二区免费看| 7777精品伊人久久久大香线蕉超级流畅 | 欧美精品久久一区二区三区| 亚洲欧洲www| 国产激情一区二区三区| 日韩精品一区二区三区视频播放 | 精品免费日韩av| 亚洲电影视频在线| 99riav久久精品riav| 欧美激情一二三区| 国产乱对白刺激视频不卡| 欧美精选一区二区| 一区二区三区视频在线看| 99精品在线免费| 中文字幕av资源一区| 国产精品18久久久久久vr | 久久久五月婷婷| 精品无人区卡一卡二卡三乱码免费卡| 久久久蜜桃精品| 精品一区二区三区香蕉蜜桃 | 天天色天天爱天天射综合| 在线免费观看视频一区| 中文字幕欧美激情| 成人综合婷婷国产精品久久蜜臀 | 日韩三级视频中文字幕| 日本视频免费一区| 欧美一区二区三区视频在线| 日韩不卡一区二区| 日韩丝袜美女视频| 久久成人羞羞网站| 久久先锋资源网| 国产高清成人在线| 日本一区二区三区dvd视频在线| 国产成人在线看| 国产精品久久久久一区二区三区| 成人开心网精品视频| 最新高清无码专区| 日本精品一区二区三区高清| 亚洲国产中文字幕| 日韩精品一区二区三区在线播放| 麻豆91免费看| 国产日韩欧美麻豆| 波波电影院一区二区三区| 亚洲免费资源在线播放| 欧美日韩国产一级| 美美哒免费高清在线观看视频一区二区| 蜜臀精品一区二区三区在线观看| 精品国产乱码久久久久久久| 国产精品77777| 最近中文字幕一区二区三区| 日本韩国欧美一区| 免费成人在线观看视频| 久久久久久日产精品| 99国产精品国产精品毛片| 亚洲成av人影院在线观看网| 欧美一区二区大片| 成人一道本在线| 夜夜嗨av一区二区三区网页 | 精品国产一区二区三区四区四 | 国产视频一区二区在线|