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

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

?? stm32l1xx_rcc.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 5 頁
字號:
/**
  ******************************************************************************
  * @file    stm32l1xx_rcc.c
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    31-December-2010
  * @brief   This file provides firmware functions to manage the following 
  *          functionalities of the Reset and clock control (RCC) peripheral:           
  *           - Internal/external clocks, PLL, CSS and MCO configuration
  *           - System, AHB and APB busses clocks configuration
  *           - Peripheral clocks configuration
  *           - Interrupts and flags management
  *
  *  @verbatim
  *               
  *          ===================================================================
  *                               RCC specific features
  *          ===================================================================
  *    
  *          After reset the device is running from MSI (2 MHz) with Flash 0 WS, 
  *          all peripherals are off except internal SRAM, Flash and JTAG.
  *           - There is no prescaler on High speed (AHB) and Low speed (APB) busses;
  *             all peripherals mapped on these busses are running at MSI speed.
  *       	  - The clock for all peripherals is switched off, except the SRAM and FLASH.
  *           - All GPIOs are in input floating state, except the JTAG pins which
  *             are assigned to be used for debug purpose.
  *        
  *          Once the device started from reset, the user application has to:        
  *           - Configure the clock source to be used to drive the System clock
  *             (if the application needs higher frequency/performance)
  *           - Configure the System clock frequency and Flash settings  
  *           - Configure the AHB and APB busses prescalers
  *           - Enable the clock for the peripheral(s) to be used
  *           - Configure the clock source(s) for peripherals whose clocks are not
  *             derived from the System clock (ADC, RTC/LCD and IWDG)      
  *                        
  *  @endverbatim
  *    
  ******************************************************************************
  * @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 2010 STMicroelectronics</center></h2>
  ******************************************************************************  
  */ 

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

/** @addtogroup STM32L1xx_StdPeriph_Driver
  * @{
  */

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

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/

/* ------------ 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 MSION bit */
#define MSION_BitNumber           0x08
#define CR_MSION_BB               (PERIPH_BB_BASE + (CR_OFFSET * 32) + (MSION_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))

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

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

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

/* Alias word address of RTCEN bit */
#define RTCEN_BitNumber           0x16
#define CSR_RTCEN_BB              (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (RTCEN_BitNumber * 4))

/* Alias word address of RTCRST bit */
#define RTCRST_BitNumber          0x17
#define CSR_RTCRST_BB             (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (RTCRST_BitNumber * 4))


/* ---------------------- RCC registers mask -------------------------------- */
/* RCC Flag Mask */
#define FLAG_MASK                 ((uint8_t)0x1F)

/* CR register byte 3 (Bits[23:16]) base address */
#define CR_BYTE3_ADDRESS          ((uint32_t)0x40023802)

/* ICSCR register byte 4 (Bits[31:24]) base address */
#define ICSCR_BYTE4_ADDRESS       ((uint32_t)0x40023807)

/* CFGR register byte 3 (Bits[23:16]) base address */
#define CFGR_BYTE3_ADDRESS        ((uint32_t)0x4002380A)

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

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

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

/* CSR register byte 2 (Bits[15:8]) base address */
#define CSR_BYTE2_ADDRESS         ((uint32_t)0x40023835)

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/

static __I uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48};
static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};

/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/** @defgroup RCC_Private_Functions
  * @{
  */

/** @defgroup RCC_Group1 Internal and external clocks, PLL, CSS and MCO configuration functions
 *  @brief   Internal and external clocks, PLL, CSS and MCO configuration functions 
 *
@verbatim   
 ===============================================================================
      Internal/external clocks, PLL, CSS and MCO configuration functions
 ===============================================================================  

  This section provide functions allowing to configure the internal/external clocks,
  PLL, CSS and MCO.
  
  1. HSI (high-speed internal), 16 MHz factory-trimmed RC used directly or through
     the PLL as System clock source.

  2. MSI (multi-speed internal), multispeed low power RC (65.536 KHz to 4.194 MHz)
     MHz used as System clock source.

  3. LSI (low-speed internal), 37 KHz low consumption RC used as IWDG and/or RTC
     clock source.

  4. HSE (high-speed external), 1 to 24 MHz crystal oscillator used directly or
     through the PLL as System clock source. Can be used also as RTC clock source.

  5. LSE (low-speed external), 32 KHz oscillator used as RTC clock source.   

  6. PLL (clocked by HSI or HSE), for System clock and USB (48 MHz).

  7. CSS (Clock security system), once enable and if a HSE clock failure occurs 
     (HSE used directly or through PLL as System clock source), the System clock
     is automatically switched to MSI and an interrupt is generated if enabled. 
     The interrupt is linked to the Cortex-M3 NMI (Non-Maskable Interrupt) 
     exception vector.   

  8. MCO (microcontroller clock output), used to output SYSCLK, HSI, MSI, HSE, PLL,
     LSI or LSE clock (through a configurable prescaler) on PA8 pin.

@endverbatim
  * @{
  */

/**
  * @brief  Resets the RCC clock configuration to the default reset state.
  * @note   - The default reset state of the clock configuration is given below:
  *            - MSI ON and used as system clock source (MSI range is not modified
  *              by this function, it keep the value configured by user application)
  *            - HSI, HSE and PLL OFF
  *            - AHB, APB1 and APB2 prescaler set to 1.
  *            - CSS and MCO OFF
  *            - All interrupts disabled
  *         - However, this function doesn't modify the configuration of the
  *            - Peripheral clocks
  *            - LSI, LSE and RTC clocks                  
  * @param  None
  * @retval None
  */
void RCC_DeInit(void)
{
  
  /* Set MSION bit */
  RCC->CR |= (uint32_t)0x00000100;

  /* Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], MCOSEL[2:0] and MCOPRE[2:0] bits */
  RCC->CFGR &= (uint32_t)0x88FFC00C;
  
  /* Reset HSION, HSEON, CSSON and PLLON bits */
  RCC->CR &= (uint32_t)0xEEFEFFFE;

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

  /* Reset PLLSRC, PLLMUL[3:0] and PLLDIV[1:0] bits */
  RCC->CFGR &= (uint32_t)0xFF02FFFF;

  /* Disable all interrupts */
  RCC->CIR = 0x00000000;
}

/**
  * @brief  Configures the External High Speed oscillator (HSE).
  * @note   - After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application
  *           software should wait on HSERDY flag to be set indicating that HSE clock
  *           is stable and can be used to clock the PLL and/or system clock.
  *         - HSE state can not be changed if it is used directly or through the
  *           PLL as system clock. In this case, you have to select another source
  *           of the system clock then change the HSE state (ex. disable it).
  *         - The HSE is stopped by hardware when entering STOP and STANDBY modes.         
  * @note   This function reset the CSSON bit, so if the Clock security system(CSS)
  *         was previously enabled you have to enable it again after calling this
  *         function.
  * @param RCC_HSE: specifies the new state of the HSE.
  *   This parameter can be one of the following values:
  *     @arg RCC_HSE_OFF: turn OFF the HSE oscillator, HSERDY flag goes low after
  *                       6 HSE oscillator clock cycles.
  *     @arg RCC_HSE_ON: turn ON the HSE oscillator
  *     @arg RCC_HSE_Bypass: HSE oscillator bypassed with external clock
  * @retval None
  */
void RCC_HSEConfig(uint8_t RCC_HSE)
{
  /* Check the parameters */
  assert_param(IS_RCC_HSE(RCC_HSE));

  /* Reset HSEON and HSEBYP bits before configuring the HSE ------------------*/
  *(__IO uint8_t *) CR_BYTE3_ADDRESS = RCC_HSE_OFF;

  /* Set the new HSE configuration -------------------------------------------*/
  *(__IO uint8_t *) CR_BYTE3_ADDRESS = RCC_HSE;

}

/**
  * @brief  Waits for HSE start-up.
  * @note   This functions waits on HSERDY flag to be set and return SUCCESS if 
  *         this flag is set, otherwise returns ERROR if the timeout is reached 
  *         and this flag is not set. The timeout value is defined by the constant
  *         HSE_STARTUP_TIMEOUT in stm32l1xx.h file. You can tailor it depending
  *         on the HSE crystal used in your application. 
  * @param  None
  * @retval An ErrorStatus enumeration 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 timeout is reached exit */
  do
  {
    HSEStatus = RCC_GetFlagStatus(RCC_FLAG_HSERDY);
    StartUpCounter++;  
  } while((StartUpCounter != HSE_STARTUP_TIMEOUT) && (HSEStatus == RESET));
  
  if (RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET)
  {
    status = SUCCESS;
  }
  else
  {
    status = ERROR;
  }  
  return (status);
}

/**
  * @brief  Adjusts the Internal Multi Speed oscillator (MSI) calibration value.
  * @note   The calibration is used to compensate for the variations in voltage
  *         and temperature that influence the frequency of the internal MSI RC.
  *         Refer to the Application Note AN3300 for more details on how to  
  *         calibrate the MSI.
  * @param  MSICalibrationValue: specifies the MSI calibration trimming value.
  *   This parameter must be a number between 0 and 0xFF.
  * @retval None
  */
void RCC_AdjustMSICalibrationValue(uint8_t MSICalibrationValue)
{
  
  /* Check the parameters */
  assert_param(IS_RCC_MSI_CALIBRATION_VALUE(MSICalibrationValue));

  *(__IO uint8_t *) ICSCR_BYTE4_ADDRESS = MSICalibrationValue;  
}

/**
  * @brief  Configures the Internal Multi Speed oscillator (MSI) clock range.
  * @note   - After restart from Reset or wakeup from STANDBY, the MSI clock is 
  *           around 2.097 MHz. The MSI clock does not change after wake-up from
  *           STOP mode.
  *         - The MSI clock range can be modified on the fly.     
  * @param  RCC_MSIRange: specifies the MSI Clock range.
  *   This parameter must be one of the following values:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品丝袜在线| 91啪亚洲精品| 亚洲另类在线制服丝袜| 久久日一线二线三线suv| 在线观看欧美黄色| 96av麻豆蜜桃一区二区| 亚洲精品国产一区二区精华液| 久久久美女艺术照精彩视频福利播放| 69堂成人精品免费视频| 国产成人免费av在线| 蜜臀99久久精品久久久久久软件| 亚洲电影在线播放| 亚洲综合另类小说| 亚洲美女屁股眼交3| 亚洲另类春色校园小说| 亚洲视频一区二区在线| 国产精品丝袜久久久久久app| 欧美精品色综合| 欧美丝袜丝交足nylons图片| 91丨九色丨蝌蚪丨老版| 色哟哟一区二区在线观看| 91在线观看一区二区| 91视视频在线观看入口直接观看www| 国产成人免费在线视频| av成人老司机| jlzzjlzz亚洲女人18| 国产传媒日韩欧美成人| 成人激情动漫在线观看| 色综合久久99| 欧美日韩dvd在线观看| 欧美绝品在线观看成人午夜影视| 欧美日韩成人高清| 日韩精品自拍偷拍| 国产欧美日韩在线| 亚洲色图另类专区| 中文字幕综合网| 亚洲一区精品在线| 日韩一区欧美二区| 91看片淫黄大片一级在线观看| 日韩一区二区三免费高清| 国产精品二三区| 久久99精品国产| 欧美日韩在线播放三区四区| 久久综合久久鬼色| 亚洲成人av一区二区| 不卡av在线网| 久久久久久久久久电影| 日韩av一二三| 色诱视频网站一区| 国产欧美日韩激情| 久久99久久久久| 欧美日韩免费观看一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美电影免费观看高清完整版在线| 欧美高清在线一区| 极品美女销魂一区二区三区 | 精品久久久久香蕉网| 亚洲欧美欧美一区二区三区| 国内成人自拍视频| 91精品婷婷国产综合久久| 亚洲情趣在线观看| 成a人片国产精品| 久久蜜桃一区二区| 久久se精品一区二区| 日韩亚洲欧美在线观看| 日韩av在线播放中文字幕| 欧美人狂配大交3d怪物一区| 亚洲欧美电影一区二区| 成人黄色电影在线| 中文字幕二三区不卡| 国产精品888| 国产女人水真多18毛片18精品视频| 美腿丝袜亚洲一区| 日韩欧美国产精品| 激情久久久久久久久久久久久久久久| 91精品国产麻豆国产自产在线 | 玉米视频成人免费看| 色综合久久久久综合体桃花网| 国产精品理伦片| 99视频在线精品| 亚洲精品免费视频| 欧美午夜精品一区二区三区| 综合激情网...| 色综合久久久网| 亚洲午夜免费电影| 91精品欧美久久久久久动漫 | 丁香五精品蜜臀久久久久99网站 | 欧美日韩免费高清一区色橹橹| 亚洲午夜久久久久久久久久久 | 国产成人精品综合在线观看| 国产精品污网站| 97se亚洲国产综合在线| 亚洲在线观看免费视频| 欧美一级久久久久久久大片| 极品少妇xxxx偷拍精品少妇| 2020国产精品| 99久久亚洲一区二区三区青草| 伊人色综合久久天天人手人婷| 欧美日韩久久久| 青青草国产成人av片免费 | 成人av电影免费观看| 亚洲欧美偷拍三级| 51精品视频一区二区三区| 精品一区二区国语对白| 国产精品久久看| 欧美一级免费观看| 成人av资源下载| 青娱乐精品在线视频| 国产精品国产三级国产普通话蜜臀 | 久久久久久久免费视频了| 高清在线成人网| 亚洲国产日韩a在线播放| 久久伊人蜜桃av一区二区| 在线免费观看日本欧美| 国模少妇一区二区三区| 成人免费在线视频观看| 日韩欧美电影一二三| 91亚洲男人天堂| 国模一区二区三区白浆| 亚洲成人av福利| 国产精品国产三级国产| 欧美一区二区三区精品| 99国产麻豆精品| 国产一区视频在线看| 三级精品在线观看| 中文字幕亚洲综合久久菠萝蜜| 欧美不卡视频一区| 欧美在线视频不卡| av在线综合网| 国产成人高清视频| 麻豆精品新av中文字幕| 亚洲国产aⅴ成人精品无吗| 国产精品嫩草久久久久| 26uuuu精品一区二区| 欧美一级在线视频| 欧美日韩中文国产| 色欲综合视频天天天| 91一区二区在线| jlzzjlzz欧美大全| 不卡免费追剧大全电视剧网站| 久久超碰97中文字幕| 日本中文字幕一区二区有限公司| 亚洲黄色性网站| 亚洲女同女同女同女同女同69| 亚洲国产成人在线| 久久久精品国产免大香伊| 91精品麻豆日日躁夜夜躁| 欧美日韩亚洲综合在线| 91黄色免费看| 色综合天天综合网天天狠天天| 成人综合激情网| 成人午夜av在线| av在线不卡网| 91麻豆自制传媒国产之光| 成人免费看视频| youjizz久久| 色呦呦一区二区三区| 日本精品视频一区二区| 欧美视频中文字幕| 欧美日韩亚州综合| 制服丝袜亚洲网站| 精品国产sm最大网站免费看| 日韩久久精品一区| 久久精品一区四区| 国产精品成人一区二区三区夜夜夜| 中文字幕成人网| 亚洲精品你懂的| 强制捆绑调教一区二区| 国内精品在线播放| 成人av资源站| 欧美三级在线播放| 精品久久国产字幕高潮| 国产精品区一区二区三区| 一区二区欧美国产| 老汉av免费一区二区三区| 国产成人av福利| 99久久精品久久久久久清纯| 欧美日韩一级二级| 久久久久久久久久久久久久久99 | 欧美日韩一区二区三区四区| 欧美一区二区三区在线| 久久久久国产精品人| 亚洲男人都懂的| 青青草原综合久久大伊人精品| 国产成人亚洲综合a∨婷婷图片 | 91精品国产全国免费观看| 精品国产区一区| 中文字幕日韩av资源站| 亚洲一区在线播放| 国产精品911| 91精品国产综合久久婷婷香蕉| 国产人成一区二区三区影院| 亚洲电影视频在线| 国产suv一区二区三区88区| 欧美日韩第一区日日骚| 国产精品嫩草影院av蜜臀| 麻豆成人综合网| 91极品视觉盛宴| 国产精品乱码久久久久久| 亚洲成人一区二区在线观看|