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

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

?? stm32l1xx_flash.c

?? STM32+Grlib
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/**
  ******************************************************************************
  * @file    stm32l1xx_flash.c
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    31-December-2010
  * @brief   This file provides all the Flash firmware functions. These functions 
  *          can be executed from Internal FLASH or Internal SRAM memories. 
  *          The functions that should be called from SRAM are defined inside 
  *          the "stm32l1xx_flash_ramfunc.c" file.
  *          This file provides firmware functions to manage the following 
  *          functionalities of the FLASH peripheral:
  *            - FLASH Interface configuration
  *            - FLASH Memory Programming
  *            - DATA EEPROM Programming
  *            - Option Bytes Programming
  *            - Interrupts and flags management
  *               
  *  @verbatim
  *  
  *          ===================================================================
  *                                 How to use this driver
  *          ===================================================================
  *                           
  *          This driver provides functions to configure and program the Flash 
  *          memory of all STM32L1xx devices
  *          These functions are split in 5 groups
  * 
  *           1. FLASH Interface configuration functions: this group includes 
  *              the management of following features:
  *                    - Set the latency
  *                    - Enable/Disable the prefetch buffer
  *                    - Enable/Disable the 64 bit Read Access 
  *                    - Enable/Disable the RUN PowerDown mode
  *                    - Enable/Disable the SLEEP PowerDown mode  
  *  
  *           2. FLASH Memory Programming functions: this group includes all 
  *              needed functions to erase and program the main memory:
  *                    - Lock and Unlock the Flash interface.
  *                    - Erase function: Erase Page.
  *                    - Program functions: Fast Word and Half Page(should be 
  *                      executed from internal SRAM).
  *   
  *           3. DATA EEPROM Programming functions: this group includes all 
  *              needed functions to erase and program the DATA EEPROM memory:
  *                    - Lock and Unlock the DATA EEPROM interface.
  *                    - Erase function: Erase Word, erase Double Word (should be 
  *                      executed from internal SRAM).
  *                    - Program functions: Fast Program Byte, Fast Program Half-Word, 
  *                      FastProgramWord, Program Byte, Program Half-Word, 
  *                      Program Word and Program Double-Word (should be executed 
  *                      from internal SRAM).
  *    
  *           4. FLASH Option Bytes Programming functions: this group includes 
  *              all needed functions to:
  *                    - Lock and Unlock the Flash Option bytes.  
  *                    - Set/Reset the write protection
  *                    - Set the Read protection Level
  *                    - Set the BOR level
  *                    - Program the user option Bytes 
  *                    - Launch the Option Bytes loader
  *                    - Get the Write protection
  *                    - Get the read protection status
  *                    - Get the BOR level
  *                    - Get the user option bytes        
  *  
  *           5. FLASH Interrupts and flag management functions: this group 
  *              includes all needed functions to:
  *                    - Enable/Disable the flash interrupt sources
  *                    - Get flags status
  *                    - Clear flags
  *                    - Get Flash operation status
  *                    - Wait for last flash operation   
  * 
  *  @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_flash.h"

/** @addtogroup STM32L1xx_StdPeriph_Driver
  * @{
  */

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

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
  
/* FLASH Mask */
#define RDPRT_MASK                 ((uint32_t)0x00000002)
#define WRP01_MASK                 ((uint32_t)0x0000FFFF)
#define WRP23_MASK                 ((uint32_t)0xFFFF0000)

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
 
/** @defgroup FLASH_Private_Functions
  * @{
  */ 

/** @defgroup FLASH_Group1 FLASH Interface configuration functions
  *  @brief   FLASH Interface configuration functions 
 *
@verbatim   
 ===============================================================================
                       FLASH Interface configuration functions
 ===============================================================================  

   FLASH_Interface configuration_Functions, includes the following functions:
   - void FLASH_SetLatency(uint32_t FLASH_Latency):
     To correctly read data from Flash memory, the number of wait states (LATENCY) 
     must be correctly programmed according to the frequency of the CPU clock 
     (HCLK) and the supply voltage of the device.
  ----------------------------------------------------------------     
 |  Wait states  |                HCLK clock frequency (MHz)      |
 |               |------------------------------------------------|     
 |   (Latency)   |            voltage range       | voltage range | 
 |               |            1.65 V - 3.6 V      | 2.0 V - 3.6 V |
 |               |----------------|---------------|---------------| 
 |               |  VCORE = 1.2 V | VCORE = 1.5 V | VCORE = 1.8 V |
 |-------------- |----------------|---------------|---------------|             
 |0WS(1CPU cycle)|0 < HCLK <= 2   |0 < HCLK <= 8  |0 < HCLK <= 16 |
 |---------------|----------------|---------------|---------------|  
 |1WS(2CPU cycle)|2 < HCLK <= 4   |8 < HCLK <= 16 |16 < HCLK <= 32| 
  ----------------------------------------------------------------   
   
   - void FLASH_PrefetchBufferCmd(FunctionalState NewState);
   - void FLASH_ReadAccess64Cmd(FunctionalState NewState);
   - void FLASH_RUNPowerDownCmd(FunctionalState NewState);
   - void FLASH_SLEEPPowerDownCmd(FunctionalState NewState);
   - void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState);
   
  Here below the allowed configuration of Latency, 64Bit access and prefetch buffer
  --------------------------------------------------------------------------------              
 |               |              ACC64 = 0         |              ACC64 = 1        |
 |   Latency     |----------------|---------------|---------------|---------------|   
 |               |   PRFTEN = 0   |   PRFTEN = 1  |   PRFTEN = 0  |   PRFTEN = 1  | 
 |---------------|----------------|---------------|---------------|---------------|   
 |0WS(1CPU cycle)|     YES        |     NO        |     YES       |     YES       |
 |---------------|----------------|---------------|---------------|---------------| 
 |1WS(2CPU cycle)|     NO         |     NO        |     YES       |     YES       | 
  --------------------------------------------------------------------------------   
   All these functions don't need the unlock sequence.

@endverbatim
  * @{
  */

/**
  * @brief  Sets the code latency value.
  * @param  FLASH_Latency: specifies the FLASH Latency value.
  *   This parameter can be one of the following values:
  *     @arg FLASH_Latency_0: FLASH Zero Latency cycle
  *     @arg FLASH_Latency_1: FLASH One Latency cycle
  * @retval None
  */
void FLASH_SetLatency(uint32_t FLASH_Latency)
{
   uint32_t tmpreg = 0;
  
  /* Check the parameters */
  assert_param(IS_FLASH_LATENCY(FLASH_Latency));
  
  /* Read the ACR register */
  tmpreg = FLASH->ACR;  
  
  /* Sets the Latency value */
  tmpreg &= (uint32_t) (~((uint32_t)FLASH_ACR_LATENCY));
  tmpreg |= FLASH_Latency;
  
  /* Write the ACR register */
  FLASH->ACR = tmpreg;
}

/**
  * @brief  Enables or disables the Prefetch Buffer.
  * @param  NewState: new state of the FLASH prefetch buffer.
  *              This parameter can be: ENABLE or DISABLE. 
  * @retval None
  */
void FLASH_PrefetchBufferCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
   
  if(NewState != DISABLE)
  {
    FLASH->ACR |= FLASH_ACR_PRFTEN;
  }
  else
  {
    FLASH->ACR &= (uint32_t)(~((uint32_t)FLASH_ACR_PRFTEN));
  }
}

/**
  * @brief  Enables or disables read access to flash by 64 bits.
  * @param  NewState: new state of the FLASH read access mode.
  *              This parameter can be: ENABLE or DISABLE.  
  * @note   - If this bit is set, the Read access 64 bit is used.
  *         - If this bit is reset, the Read access 32 bit is used.
  * @note   - This bit cannot be written at the same time as the LATENCY and 
  *           PRFTEN bits. 
  *         - To reset this bit, the LATENCY should be zero wait state and the 
  *           prefetch off.
  * @retval None
  */
void FLASH_ReadAccess64Cmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if(NewState != DISABLE)
  {
    FLASH->ACR |= FLASH_ACR_ACC64;
  }
  else
  {
    FLASH->ACR &= (uint32_t)(~((uint32_t)FLASH_ACR_ACC64));
  }
}

/**
  * @brief  Enable or disable the power down mode during Sleep mode.
  * @note   This function is used to power down the FLASH when the system is in SLEEP LP mode.  
  * @param  NewState: new state of the power down mode during sleep mode.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void FLASH_SLEEPPowerDownCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set the SLEEP_PD bit to put Flash in power down mode during sleep mode */
    FLASH->ACR |= FLASH_ACR_SLEEP_PD;
  }
  else
  {
    /* Clear the SLEEP_PD bit in to put Flash in idle mode during sleep mode */
    FLASH->ACR &= (uint32_t)(~((uint32_t)FLASH_ACR_SLEEP_PD));
  }
}

/**
  * @}
  */

/** @defgroup FLASH_Group2 FLASH Memory Programming functions
 *  @brief   FLASH Memory Programming functions
 *
@verbatim   
 ===============================================================================
                      FLASH Memory Programming functions
 ===============================================================================  

   The FLASH Memory Programming functions, includes the following functions:
    - void FLASH_Unlock(void);
    - void FLASH_Lock(void);
    - FLASH_Status FLASH_ErasePage(uint32_t Page_Address);
    - FLASH_Status FLASH_FastProgramWord(uint32_t Address, uint32_t Data);
   
   Any operation of erase or program should follow these steps:

   1. Call the FLASH_Unlock() function to enable the flash control register and 
     program memory access

   2. Call the desired function to erase page or program data

   3. Call the FLASH_Lock() to disable the flash program memory access 
     (recommended to protect the FLASH memory against possible unwanted operation)

@endverbatim
  * @{
  */

/**
  * @brief  Unlocks the FLASH control register and program memory access.
  * @param  None
  * @retval None
  */
void FLASH_Unlock(void)
{
  if((FLASH->PECR & FLASH_PECR_PRGLOCK) != RESET)
  {
    /* Unlocking the data memory and FLASH_PECR register access */
    DATA_EEPROM_Unlock();
  
    /* Unlocking the program memory access */
    FLASH->PRGKEYR = FLASH_PRGKEY1;
    FLASH->PRGKEYR = FLASH_PRGKEY2;  
  }
}

/**
  * @brief  Locks the Program memory access.
  * @param  None
  * @retval None
  */
void FLASH_Lock(void)
{
  /* Set the PRGLOCK Bit to lock the program memory access */
  FLASH->PECR |= FLASH_PECR_PRGLOCK;
}

/**
  * @brief  Erases a specified page in program memory.
  * @note   - To correctly run this function, the FLASH_Unlock() function
  *           must be called before.
  *         - Call the FLASH_Lock() to disable the flash memory access 
  *          (recommended to protect the FLASH memory against possible unwanted operation)  
  * @param  Page_Address: The page address in program memory to be erased.
  * @note   A Page is erased in the Program memory only if the address to load 

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高清免费成人av| 9191成人精品久久| 日韩av网站在线观看| 欧美韩国一区二区| 欧美一区二区三区爱爱| 色先锋资源久久综合| 国产激情精品久久久第一区二区 | 免费成人深夜小野草| 国产精品久久看| 26uuu国产一区二区三区| 精品污污网站免费看| www.66久久| 成人综合日日夜夜| 国产在线视频精品一区| 日韩成人免费看| 亚洲国产人成综合网站| 亚洲另类春色国产| 国产精品久久久久aaaa樱花 | 欧美三区在线观看| 99久久综合精品| 国产99久久久精品| 国内欧美视频一区二区 | 91小视频免费观看| 国产成人自拍在线| 狠狠色丁香九九婷婷综合五月| 亚洲bt欧美bt精品| 亚洲一二三四区不卡| 成人欧美一区二区三区在线播放| 日韩美女视频在线| 国产69精品久久久久777| 丝袜美腿亚洲综合| 一片黄亚洲嫩模| 国产精品国产三级国产普通话蜜臀| 精品国产三级电影在线观看| 日韩午夜在线播放| 91精品国产品国语在线不卡| 欧美日韩成人综合天天影院| 欧美人牲a欧美精品| 在线观看日韩国产| 欧美在线免费观看视频| 日本精品一级二级| 欧美日韩一区精品| 欧美三级电影在线看| 欧美三级电影在线观看| 欧美性一区二区| 欧美日产国产精品| 91精品国产aⅴ一区二区| 欧美一级一区二区| 亚洲精品一线二线三线 | 国产精品久久久久aaaa| 国产精品成人午夜| 亚洲欧美日韩成人高清在线一区| 亚洲精品视频在线看| 亚洲一区在线免费观看| 日韩精品欧美精品| 精品无码三级在线观看视频| 国产成人啪午夜精品网站男同| 成人av片在线观看| 欧美自拍丝袜亚洲| 欧美成人综合网站| 国产精品你懂的在线| 亚洲精品国产成人久久av盗摄| 亚洲最色的网站| 久久精品久久99精品久久| 国产成人在线电影| 在线精品视频免费播放| 91精品国产入口在线| 国产欧美日韩不卡| 亚洲福利一二三区| 国产一区二区免费看| 91日韩在线专区| 91麻豆精品国产91久久久资源速度| 久久综合九色综合欧美就去吻| 国产精品护士白丝一区av| 亚洲成av人片在线观看无码| 国产一区二区三区精品视频| 99精品国产91久久久久久| 欧美高清视频一二三区 | 久久99国产精品免费网站| 国产福利一区二区三区视频在线 | 亚洲精品国产无套在线观| 日韩av中文字幕一区二区三区| 国产一区二区剧情av在线| 91成人网在线| 久久久久久久久久久99999| 亚洲在线视频免费观看| 国产成人免费网站| 欧美高清视频在线高清观看mv色露露十八 | 一个色综合av| 国产二区国产一区在线观看| 欧美在线影院一区二区| 久久久久综合网| 午夜精品福利在线| www.综合网.com| 精品久久久久av影院| 一卡二卡欧美日韩| 成人一级片网址| 日韩欧美国产三级| 亚洲一二三区在线观看| 国产a久久麻豆| 欧美一区二区三区四区久久| 亚洲精品中文在线| 国产裸体歌舞团一区二区| 欧美精品vⅰdeose4hd| 一二三四区精品视频| voyeur盗摄精品| 国产校园另类小说区| 麻豆成人在线观看| 4438x亚洲最大成人网| 亚洲欧美日韩在线不卡| 国产传媒一区在线| 精品久久久久久亚洲综合网| 亚洲精品视频在线观看免费| 成人一区二区三区视频在线观看| 日韩欧美一级片| 日韩和的一区二区| 欧美图片一区二区三区| 综合久久久久久| 丁香啪啪综合成人亚洲小说| 欧美精品一区二区久久婷婷| 日韩精品一区第一页| 欧美网站一区二区| 亚洲综合色区另类av| 色网站国产精品| 伊人开心综合网| 色欧美88888久久久久久影院| 成人欧美一区二区三区小说| 成人午夜短视频| 国产精品黄色在线观看| 成人av网站免费观看| 国产精品少妇自拍| 成人激情免费电影网址| 国产精品免费视频一区| 99久久精品久久久久久清纯| 国产亚洲精品bt天堂精选| 国产成人精品免费| 国产精品人人做人人爽人人添| 国产福利一区二区三区视频在线| 国产拍欧美日韩视频二区| 国产aⅴ综合色| 国产精品女主播在线观看| 成人va在线观看| 成人免费在线视频| 欧美自拍丝袜亚洲| 五月综合激情网| 欧美一级艳片视频免费观看| 老色鬼精品视频在线观看播放| 欧美精品一区二区久久婷婷| 东方aⅴ免费观看久久av| 国产精品电影一区二区三区| 色狠狠综合天天综合综合| 午夜私人影院久久久久| 日韩欧美国产一区二区三区| 国产一区二区三区四区五区入口| 欧美高清在线视频| 91黄色免费网站| 青娱乐精品视频| 国产日韩影视精品| 日本丶国产丶欧美色综合| 午夜精品久久久久影视| 久久男人中文字幕资源站| 成人高清伦理免费影院在线观看| 一区二区三国产精华液| 日韩三级视频在线观看| 粉嫩蜜臀av国产精品网站| 夜夜精品视频一区二区| 日韩三级视频在线观看| 国产91精品欧美| 亚洲成人你懂的| 国产网站一区二区三区| 欧美中文字幕一区| 国内成人精品2018免费看| 日韩理论片在线| 日韩欧美专区在线| 99视频在线观看一区三区| 三级精品在线观看| 国产精品久久毛片av大全日韩| 欧美日韩aaa| 99视频一区二区| 久久精品国产成人一区二区三区| 国产精品―色哟哟| 欧美一级艳片视频免费观看| 91在线看国产| 国产综合色产在线精品| 亚洲欧美激情在线| 久久久综合视频| 欧美顶级少妇做爰| 99精品国产视频| 国产乱码精品一区二区三区五月婷| 亚洲欧美一区二区三区久本道91| 日韩精品一区二区三区三区免费 | 在线综合+亚洲+欧美中文字幕| 成人一级视频在线观看| 人禽交欧美网站| 夜夜操天天操亚洲| 国产精品传媒入口麻豆| 26uuu国产电影一区二区| 欧美精品vⅰdeose4hd| 一本大道久久a久久综合| 国产乱码精品一品二品|