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

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

?? stm32l1xx_flash_ramfunc.c

?? STM32+Grlib
?? C
字號:
/**
  ******************************************************************************
  * @file    stm32l1xx_flash_ramfunc.c
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    31-December-2010
  * @brief   This file provides all the Flash firmware functions which should be
  *          executed from the internal SRAM. This file should be placed in 
  *          internal SRAM. 
  *          Other FLASH memory functions that can be used from the FLASH are 
  *          defined in the "stm32l1xx_flash.c" file. 
  *  @verbatim   
  *    
  *          ARM Compiler
  *          ------------
  *          RAM functions are defined using the toolchain options. 
  *          Functions that are be executed in RAM should reside in a separate
  *          source module. Using the 'Options for File' dialog you can simply change
  *          the 'Code / Const' area of a module to a memory space in physical RAM.
  *          Available memory areas are declared in the 'Target' tab of the 
  *          'Options for Target' dialog.
  *          
  *          ICCARM Compiler
  *          ---------------
  *          RAM functions are defined using a specific toolchain keyword "__ramfunc".  
  *          
  *          GNU Compiler
  *          ------------
  *          RAM functions are defined using a specific toolchain attribute
  *          "__attribute__((section(".data")))".
  *          
  *          TASKING Compiler
  *          ----------------
  *          RAM functions are defined using a specific toolchain pragma. This 
  *          pragma is defined inside this file.  
  *          
  *  @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 ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static __RAM_FUNC GetStatus(void);
static __RAM_FUNC WaitForLastOperation(uint32_t Timeout);

/* Private functions ---------------------------------------------------------*/
 
/** @defgroup FLASH_Private_Functions
  * @{
  */ 

/** @addtogroup FLASH_Group1
 *
@verbatim  
@endverbatim
  * @{
  */  
#if defined (  __TASKING__  )
#pragma section_code_init on
#endif

/**
  * @brief  Enable or disable the power down mode during RUN mode.
  * @note: This function can be used only when the user code is running from Internal SRAM
  * @param  NewState: new state of the power down mode during RUN mode.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
__RAM_FUNC FLASH_RUNPowerDownCmd(FunctionalState NewState)
{
  FLASH_Status status = FLASH_COMPLETE;
 
  if (NewState != DISABLE)
  {
     /* Unlock the RUN_PD bit */
     FLASH->PDKEYR = FLASH_PDKEY1;
     FLASH->PDKEYR = FLASH_PDKEY2;
     
     /* Set the RUN_PD bit in  FLASH_ACR register to put Flash in power down mode */
     FLASH->ACR |= (uint32_t)FLASH_ACR_RUN_PD;

     if((FLASH->ACR & FLASH_ACR_RUN_PD) != FLASH_ACR_RUN_PD)
     {
       status = FLASH_ERROR_PROGRAM;
     }
  }
  else
  {
    /* Clear the RUN_PD bit in  FLASH_ACR register to put Flash in idle  mode */
    FLASH->ACR &= (uint32_t)(~(uint32_t)FLASH_ACR_RUN_PD);
  }

  /* Return the Write Status */
  return status;  
}

/**
  * @}
  */

/** @addtogroup FLASH_Group2
 *
@verbatim  
@endverbatim
  * @{
  */

/**
  * @brief  Programs a half page in program memory.
  * @param  Address: specifies the address to be written.
  * @param  pBuffer: pointer to the buffer  containing the data to be  written to 
  *         the half page.
  * @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)
  * @note   Half page write is possible only from SRAM.
  * @note   If there are more than 32 words to write, after 32 words another 
  *         Half Page programming operation starts and has to be finished.
  * @note   A half page is written to the program memory only if the first 
  *         address to load is the start address of a half page (multiple of 128 
  *         bytes) and the 31 remaining words to load are in the same half page.
  * @note   During the Program memory half page write all read operations are 
  *         forbidden (this includes DMA read operations and debugger read 
  *         operations such as breakpoints, periodic updates, etc.)
  * @note   If a PGAERR is set during a Program memory half page write, the 
  *         complete write operation is aborted. Software should then reset the 
  *         FPRG and PROG/DATA bits and restart the write operation from the 
  *         beginning.                             
  * @retval FLASH Status: The returned value can be:  
  *   FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. 
  */
__RAM_FUNC FLASH_ProgramHalfPage(uint32_t Address, uint32_t* pBuffer)
{
  uint32_t count = 0; 
   
  FLASH_Status status = FLASH_COMPLETE;

  /* Wait for last operation to be completed */
  status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to program the new  
    half page */
    FLASH->PECR |= FLASH_PECR_FPRG;
    FLASH->PECR |= FLASH_PECR_PROG;
    
    /* Write one half page directly with 32 different words */
    while(count < 32)
    {
      *(__IO uint32_t*) (Address + (4 * count)) = *(pBuffer++);
      count ++;  
    }
    /* Wait for last operation to be completed */
    status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
 
    /* if the write operation is completed, disable the PROG and FPRG bits */
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_PROG);
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_FPRG);
  }
  /* Return the Write Status */
  return status;
}

/**
  * @}
  */

/** @addtogroup FLASH_Group3
 *
@verbatim  
@endverbatim
  * @{
  */

/**
  * @brief  Erase a double word in data memory.
  * @param  Address: specifies the address to be erased
  * @note   - To correctly run this function, the DATA_EEPROM_Unlock() function
  *           must be called before.
  *         - Call the DATA_EEPROM_Lock() to he data EEPROM access
  *           and Flash program erase control register access(recommended to protect 
  *           the DATA_EEPROM against possible unwanted operation)   
  * @note   Data memory double word erase is possible only from SRAM.
  * @note   A double word is erased to the data memory only if the first address 
  *         to load is the start address of a double word (multiple of 8 bytes)  
  * @note   During the Data memory double word erase, all read operations are 
  *         forbidden (this includes DMA read operations and debugger read 
  *         operations such as breakpoints, periodic updates, etc.)  
  * @retval FLASH Status: The returned value can be: 
  *   FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */

__RAM_FUNC DATA_EEPROM_EraseDoubleWord(uint32_t Address)
{
  FLASH_Status status = FLASH_COMPLETE;
    
  /* Wait for last operation to be completed */
  status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  
  if(status == FLASH_COMPLETE)
  {
    /* If the previous operation is completed, proceed to erase the next double word */
    /* Set the ERASE bit */
    FLASH->PECR |= FLASH_PECR_ERASE;

    /* Set DATA bit */
    FLASH->PECR |= FLASH_PECR_DATA;
   
    /* Write 00000000h to the 2 words to erase */
    *(__IO uint64_t *)Address = 0x00000000;
 
    /* Wait for last operation to be completed */
    status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    
    /* If the erase operation is completed, disable the ERASE and DATA bits */
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_ERASE);
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_DATA);
  }  
  /* Return the erase status */
  return status;
}

/**
  * @brief  Write a double word in data memory without erase.
  * @param  Address: specifies the address to be written.
  * @param  Data: specifies the data to be written.
  * @note   - To correctly run this function, the DATA_EEPROM_Unlock() function
  *           must be called before.
  *         - Call the DATA_EEPROM_Lock() to he data EEPROM access
  *           and Flash program erase control register access(recommended to protect 
  *           the DATA_EEPROM against possible unwanted operation)   
  * @note   Data memory double word write is possible only from SRAM.
  * @note   A data memory double word is written to the data memory only if the 
  *         first address to load is the start address of a double word (multiple 
  *         of double word).  
  * @note   During the Data memory double word write, all read operations are 
  *         forbidden (this includes DMA read operations and debugger read 
  *         operations such as breakpoints, periodic updates, etc.)    
  * @retval FLASH Status: The returned value can be: 
  *   FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. 
  */ 
__RAM_FUNC DATA_EEPROM_ProgramDoubleWord(uint32_t Address, uint64_t Data)
{
  FLASH_Status status = FLASH_COMPLETE;
    
  /* Wait for last operation to be completed */
  status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  
  if(status == FLASH_COMPLETE)
  {
    /* If the previous operation is completed, proceed to program the new data*/
    FLASH->PECR |= FLASH_PECR_FPRG;
    FLASH->PECR |= FLASH_PECR_DATA;
    
    /* Write the 2 words */  
     *(__IO uint32_t *)Address = (uint32_t) Data;
     Address += 4;
     *(__IO uint32_t *)Address = (uint32_t) (Data >> 32);
    
    /* Wait for last operation to be completed */
    status = WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    
    /* If the write operation is completed, disable the FPRG and DATA bits */
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_FPRG);
    FLASH->PECR &= (uint32_t)(~FLASH_PECR_DATA);     
  }
  /* Return the Write Status */
  return status;
}

/**
  * @}
  */

/**
  * @brief  Returns the FLASH Status.
  * @param  None
  * @retval FLASH Status: The returned value can be: FLASH_BUSY, 
  *   FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP or FLASH_COMPLETE
  */
static __RAM_FUNC GetStatus(void)
{
  FLASH_Status FLASHstatus = FLASH_COMPLETE;
  
  if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY) 
  {
    FLASHstatus = FLASH_BUSY;
  }
  else 
  {  
    if((FLASH->SR & (uint32_t)FLASH_FLAG_WRPERR)!= (uint32_t)0x00)
    { 
      FLASHstatus = FLASH_ERROR_WRP;
    }
    else 
    {
      if((FLASH->SR & (uint32_t)0xFEF0) != (uint32_t)0x00)
      {
        FLASHstatus = FLASH_ERROR_PROGRAM; 
      }
      else
      {
        FLASHstatus = FLASH_COMPLETE;
      }
    }
  }
  /* Return the FLASH Status */
  return FLASHstatus;
}

/**
  * @brief  Waits for a FLASH operation to complete or a TIMEOUT to occur.
  * @param  Timeout: FLASH programming Timeout
  * @retval FLASH Status: The returned value can be: FLASH_BUSY, 
  *   FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or 
  *   FLASH_TIMEOUT.
  */
static __RAM_FUNC  WaitForLastOperation(uint32_t Timeout)
{ 
  FLASH_Status status = FLASH_COMPLETE;
   
  /* Check for the FLASH Status */
  status = GetStatus();
  
  /* Wait for a FLASH operation to complete or a TIMEOUT to occur */
  while((status == FLASH_BUSY) && (Timeout != 0x00))
  {
    status = GetStatus();
    Timeout--;
  }
  
  if(Timeout == 0x00 )
  {
    status = FLASH_TIMEOUT;
  }
  /* Return the operation status */
  return status;
}

#if defined (  __TASKING__  )
#pragma section_code_init restore
#endif

/**
  * @}
  */
   
  /**
  * @}
  */ 

/**
  * @}
  */ 

/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频123| 色综合夜色一区| 日本vs亚洲vs韩国一区三区二区| 国产精品成人免费精品自在线观看| 久久久久久免费| 国产日韩欧美综合在线| 亚洲国产成人在线| 亚洲精品视频自拍| 樱花影视一区二区| 五月综合激情婷婷六月色窝| 亚洲电影激情视频网站| 午夜a成v人精品| 久久国产精品第一页| 成人一级视频在线观看| 91日韩在线专区| 欧美剧情片在线观看| 欧美一二区视频| 国产精品全国免费观看高清| 国产精品国产精品国产专区不蜜| 久草在线在线精品观看| 日韩电影在线观看一区| 韩国成人福利片在线播放| 国产精品2024| 91免费小视频| 制服丝袜一区二区三区| 久久综合成人精品亚洲另类欧美| 国产欧美在线观看一区| 亚洲精品va在线观看| 日韩综合小视频| 成人免费观看av| 欧美在线观看18| 精品成人a区在线观看| 18欧美乱大交hd1984| 午夜精品免费在线| 国产成人av电影免费在线观看| 91久久精品一区二区三区| 欧美大尺度电影在线| 亚洲欧美自拍偷拍| 久久综合综合久久综合| 色综合天天天天做夜夜夜夜做| 欧美一区二区三区在线电影| 国产精品色眯眯| 日本美女一区二区三区视频| www.日韩在线| 精品国产在天天线2019| 伊人性伊人情综合网| 国产一区二区视频在线播放| 欧美人伦禁忌dvd放荡欲情| 国产网红主播福利一区二区| 日韩影院精彩在线| 色偷偷成人一区二区三区91| 久久久久99精品一区| 午夜精品福利一区二区三区av| 99热99精品| 久久综合色鬼综合色| 日韩高清电影一区| 色偷偷久久人人79超碰人人澡| 国产亚洲va综合人人澡精品| 另类调教123区| 欧美精品自拍偷拍动漫精品| 亚洲精品国产a久久久久久| 成人一区二区三区视频在线观看 | 亚洲成a人v欧美综合天堂| av在线不卡网| 久久亚洲一区二区三区明星换脸| 午夜精品久久久久久久99水蜜桃| 91免费观看视频| 一区免费观看视频| 风间由美一区二区三区在线观看| 精品少妇一区二区三区免费观看 | 一本久道久久综合中文字幕| 国产欧美精品一区二区三区四区| 久久99久久99小草精品免视看| 9191国产精品| 蜜桃久久久久久| 欧美一二三四在线| 精品亚洲免费视频| 久久亚洲精品国产精品紫薇| 极品美女销魂一区二区三区免费| 欧美成人猛片aaaaaaa| 另类综合日韩欧美亚洲| 日韩精品一区二区三区中文精品| 九一九一国产精品| 久久久蜜桃精品| 成人动漫一区二区三区| 亚洲三级在线观看| 欧美日韩亚洲国产综合| 日韩精品乱码免费| 精品免费一区二区三区| 国产麻豆9l精品三级站| 国产精品久久久久久久午夜片| 99久久精品国产导航| 亚洲国产精品久久久男人的天堂| 欧美日韩一区二区不卡| 美女视频一区二区三区| 久久久久久亚洲综合影院红桃 | 久久精品国产77777蜜臀| 日韩一区二区三区在线观看 | 亚洲国产精品成人综合| 99久久99久久精品国产片果冻| 亚洲欧美色图小说| 91精品国产麻豆| 国产资源在线一区| 亚洲免费av在线| 日韩欧美中文字幕精品| 成人免费毛片app| 香蕉加勒比综合久久| 日韩一级二级三级精品视频| 成人丝袜视频网| 日日夜夜精品视频免费 | 91色乱码一区二区三区| 蜜桃免费网站一区二区三区| 亚洲国产成人午夜在线一区| 欧美日韩精品欧美日韩精品| 国产成a人亚洲精品| 亚洲观看高清完整版在线观看| 久久一日本道色综合| 欧美日韩一区不卡| 99精品欧美一区二区蜜桃免费| 日韩在线一区二区三区| 中文字幕一区日韩精品欧美| 日韩亚洲欧美一区| 欧美视频在线一区| 国产福利精品一区二区| 日韩成人一级大片| 亚洲视频在线一区二区| 久久欧美一区二区| 日韩欧美久久一区| 欧美视频一区二区三区| 丁香一区二区三区| 日本亚洲视频在线| 亚洲愉拍自拍另类高清精品| 国产欧美精品区一区二区三区| 日韩视频国产视频| 777色狠狠一区二区三区| 日本韩国一区二区| 99久久精品国产观看| 国产凹凸在线观看一区二区| 男男视频亚洲欧美| 亚洲第一电影网| 亚洲一区在线电影| 夜夜爽夜夜爽精品视频| 亚洲欧美视频一区| 亚洲久本草在线中文字幕| 国产精品久久久久aaaa| 国产精品污www在线观看| 国产午夜亚洲精品理论片色戒 | 国产精品国产三级国产aⅴ中文| 久久综合久久久久88| 精品久久一二三区| 日韩午夜激情视频| 欧美成人免费网站| 久久久久久久免费视频了| 2023国产精品| 久久久不卡网国产精品一区| 26uuu精品一区二区在线观看| 91精品国产综合久久精品| 91精品欧美福利在线观看| 日韩欧美中文字幕精品| 欧美成人精品二区三区99精品| 日韩欧美激情四射| 精品va天堂亚洲国产| 久久久青草青青国产亚洲免观| 国产欧美一区二区精品婷婷| 国产三区在线成人av| 国产精品国模大尺度视频| 一区二区三区在线观看国产| 亚洲一区在线播放| 免费在线观看日韩欧美| 国产一区二区三区最好精华液| 成人黄色小视频| 色综合天天综合在线视频| 欧美日韩在线观看一区二区| 日韩美女一区二区三区| 国产日韩欧美a| 亚洲精品老司机| 久久综合综合久久综合| 成人免费毛片app| 欧美日韩精品一区二区天天拍小说| 日韩欧美国产三级电影视频| 国产调教视频一区| 一级日本不卡的影视| 另类综合日韩欧美亚洲| 99精品国产一区二区三区不卡| 欧美日韩免费不卡视频一区二区三区 | 国产精品白丝jk白祙喷水网站| www.66久久| 欧美一区二区三区四区在线观看| 国产夜色精品一区二区av| 亚洲乱码国产乱码精品精小说| 日本不卡视频一二三区| 大胆亚洲人体视频| 91精品在线免费| 亚洲视频在线观看三级| 狠狠狠色丁香婷婷综合激情| 欧美亚洲高清一区| 国产女人18毛片水真多成人如厕| 午夜激情一区二区| 99精品欧美一区二区三区小说| 精品国产百合女同互慰|