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

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

?? stm32f10x_flash.c

?? stm32+ucos-ii
?? C
?? 第 1 頁 / 共 5 頁
字號:
  */
void FLASH_UnlockBank1(void)
{
  /* Authorize the FPEC of Bank1 Access */
  FLASH->KEYR = FLASH_KEY1;
  FLASH->KEYR = FLASH_KEY2;
}

#ifdef STM32F10X_XL
/**
  * @brief  Unlocks the FLASH Bank2 Program Erase Controller.
  * @note   This function can be used only for STM32F10X_XL density devices.
  * @param  None
  * @retval None
  */
void FLASH_UnlockBank2(void)
{
  /* Authorize the FPEC of Bank2 Access */
  FLASH->KEYR2 = FLASH_KEY1;
  FLASH->KEYR2 = FLASH_KEY2;

}
#endif /* STM32F10X_XL */

/**
  * @brief  Locks the FLASH Program Erase Controller.
  * @note   This function can be used for all STM32F10x devices.
  *         - For STM32F10X_XL devices this function Locks Bank1 and Bank2.
  *         - For all other devices it Locks Bank1 and it is equivalent 
  *           to FLASH_LockBank1 function.
  * @param  None
  * @retval None
  */
void FLASH_Lock(void)
{
  /* Set the Lock Bit to lock the FPEC and the CR of  Bank1 */
  FLASH->CR |= CR_LOCK_Set;

#ifdef STM32F10X_XL
  /* Set the Lock Bit to lock the FPEC and the CR of  Bank2 */
  FLASH->CR2 |= CR_LOCK_Set;
#endif /* STM32F10X_XL */
}

/**
  * @brief  Locks the FLASH Bank1 Program Erase Controller.
  * @note   this function can be used for all STM32F10x devices.
  *         - For STM32F10X_XL devices this function Locks Bank1.
  *         - For all other devices it Locks Bank1 and it is equivalent 
  *           to FLASH_Lock function.
  * @param  None
  * @retval None
  */
void FLASH_LockBank1(void)
{
  /* Set the Lock Bit to lock the FPEC and the CR of  Bank1 */
  FLASH->CR |= CR_LOCK_Set;
}

#ifdef STM32F10X_XL
/**
  * @brief  Locks the FLASH Bank2 Program Erase Controller.
  * @note   This function can be used only for STM32F10X_XL density devices.
  * @param  None
  * @retval None
  */
void FLASH_LockBank2(void)
{
  /* Set the Lock Bit to lock the FPEC and the CR of  Bank2 */
  FLASH->CR2 |= CR_LOCK_Set;
}
#endif /* STM32F10X_XL */

/**
  * @brief  Erases a specified FLASH page.
  * @note   This function can be used for all STM32F10x devices.
  * @param  Page_Address: The page address to be erased.
  * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG,
  *   FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */
FLASH_Status FLASH_ErasePage(uint32_t Page_Address)
{
  FLASH_Status status = FLASH_COMPLETE;
  /* Check the parameters */
  assert_param(IS_FLASH_ADDRESS(Page_Address));

#ifdef STM32F10X_XL
  if(Page_Address < FLASH_BANK1_END_ADDRESS)  
  {
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank1Operation(EraseTimeout);
    if(status == FLASH_COMPLETE)
    { 
      /* if the previous operation is completed, proceed to erase the page */
      FLASH->CR|= CR_PER_Set;
      FLASH->AR = Page_Address; 
      FLASH->CR|= CR_STRT_Set;
    
      /* Wait for last operation to be completed */
      status = FLASH_WaitForLastBank1Operation(EraseTimeout);

      /* Disable the PER Bit */
      FLASH->CR &= CR_PER_Reset;
    }
  }
  else
  {
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank2Operation(EraseTimeout);
    if(status == FLASH_COMPLETE)
    { 
      /* if the previous operation is completed, proceed to erase the page */
      FLASH->CR2|= CR_PER_Set;
      FLASH->AR2 = Page_Address; 
      FLASH->CR2|= CR_STRT_Set;
    
      /* Wait for last operation to be completed */
      status = FLASH_WaitForLastBank2Operation(EraseTimeout);
      
      /* Disable the PER Bit */
      FLASH->CR2 &= CR_PER_Reset;
    }
  }
#else
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(EraseTimeout);
  
  if(status == FLASH_COMPLETE)
  { 
    /* if the previous operation is completed, proceed to erase the page */
    FLASH->CR|= CR_PER_Set;
    FLASH->AR = Page_Address; 
    FLASH->CR|= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(EraseTimeout);
    
    /* Disable the PER Bit */
    FLASH->CR &= CR_PER_Reset;
  }
#endif /* STM32F10X_XL */

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

/**
  * @brief  Erases all FLASH pages.
  * @note   This function can be used for all STM32F10x devices.
  * @param  None
  * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG,
  *   FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */
FLASH_Status FLASH_EraseAllPages(void)
{
  FLASH_Status status = FLASH_COMPLETE;

#ifdef STM32F10X_XL
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastBank1Operation(EraseTimeout);
  
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase all pages */
     FLASH->CR |= CR_MER_Set;
     FLASH->CR |= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank1Operation(EraseTimeout);
    
    /* Disable the MER Bit */
    FLASH->CR &= CR_MER_Reset;
  }    
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase all pages */
     FLASH->CR2 |= CR_MER_Set;
     FLASH->CR2 |= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank2Operation(EraseTimeout);
    
    /* Disable the MER Bit */
    FLASH->CR2 &= CR_MER_Reset;
  }
#else
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(EraseTimeout);
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase all pages */
     FLASH->CR |= CR_MER_Set;
     FLASH->CR |= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(EraseTimeout);

    /* Disable the MER Bit */
    FLASH->CR &= CR_MER_Reset;
  }
#endif /* STM32F10X_XL */

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

/**
  * @brief  Erases all Bank1 FLASH pages.
  * @note   This function can be used for all STM32F10x devices.
  *         - For STM32F10X_XL devices this function erases all Bank1 pages.
  *         - For all other devices it erases all Bank1 pages and it is equivalent 
  *           to FLASH_EraseAllPages function.
  * @param  None
  * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG,
  *   FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */
FLASH_Status FLASH_EraseAllBank1Pages(void)
{
  FLASH_Status status = FLASH_COMPLETE;
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastBank1Operation(EraseTimeout);
  
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase all pages */
     FLASH->CR |= CR_MER_Set;
     FLASH->CR |= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank1Operation(EraseTimeout);
    
    /* Disable the MER Bit */
    FLASH->CR &= CR_MER_Reset;
  }    
  /* Return the Erase Status */
  return status;
}

#ifdef STM32F10X_XL
/**
  * @brief  Erases all Bank2 FLASH pages.
  * @note   This function can be used only for STM32F10x_XL density devices.
  * @param  None
  * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG,
  *   FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */
FLASH_Status FLASH_EraseAllBank2Pages(void)
{
  FLASH_Status status = FLASH_COMPLETE;
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastBank2Operation(EraseTimeout);
  
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase all pages */
     FLASH->CR2 |= CR_MER_Set;
     FLASH->CR2 |= CR_STRT_Set;
    
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastBank2Operation(EraseTimeout);

    /* Disable the MER Bit */
    FLASH->CR2 &= CR_MER_Reset;
  }    
  /* Return the Erase Status */
  return status;
}
#endif /* STM32F10X_XL */

/**
  * @brief  Erases the FLASH option bytes.
  * @note   This functions erases all option bytes except the Read protection (RDP). 
  * @note   This function can be used for all STM32F10x devices.
  * @param  None
  * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG,
  *   FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
  */
FLASH_Status FLASH_EraseOptionBytes(void)
{
  uint16_t rdptmp = RDP_Key;

  FLASH_Status status = FLASH_COMPLETE;

  /* Get the actual read protection Option Byte value */ 
  if(FLASH_GetReadOutProtectionStatus() != RESET)
  {
    rdptmp = 0x00;  
  }

  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(EraseTimeout);
  if(status == FLASH_COMPLETE)
  {
    /* Authorize the small information block programming */
    FLASH->OPTKEYR = FLASH_KEY1;
    FLASH->OPTKEYR = FLASH_KEY2;
    
    /* if the previous operation is completed, proceed to erase the option bytes */
    FLASH->CR |= CR_OPTER_Set;
    FLASH->CR |= CR_STRT_Set;
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(EraseTimeout);
    
    if(status == FLASH_COMPLETE)
    {
      /* if the erase operation is completed, disable the OPTER Bit */
      FLASH->CR &= CR_OPTER_Reset;
       
      /* Enable the Option Bytes Programming operation */
      FLASH->CR |= CR_OPTPG_Set;
      /* Restore the last read protection Option Byte value */
      OB->RDP = (uint16_t)rdptmp; 
      /* Wait for last operation to be completed */
      status = FLASH_WaitForLastOperation(ProgramTimeout);
 
      if(status != FLASH_TIMEOUT)
      {
        /* if the program operation is completed, disable the OPTPG Bit */
        FLASH->CR &= CR_OPTPG_Reset;
      }
    }
    else
    {
      if (status != FLASH_TIMEOUT)
      {
        /* Disable the OPTPG Bit */
        FLASH->CR &= CR_OPTPG_Reset;
      }
    }  
  }
  /* Return the erase status */
  return status;
}

/**
  * @brief  Programs a word at a specified address.
  * @note   This function can be used for all STM32F10x devices.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频欧美区| 久久精品国产成人一区二区三区| 麻豆91在线观看| 激情综合五月婷婷| 91亚洲大成网污www| 欧美另类z0zxhd电影| 国产校园另类小说区| 亚洲激情成人在线| 精品写真视频在线观看| 国产91精品露脸国语对白| 欧美伊人久久久久久久久影院| 成人精品在线视频观看| 欧美日韩在线播放| 精品国产伦一区二区三区免费| 欧美疯狂做受xxxx富婆| xnxx国产精品| 国产一区二区精品久久91| 成人免费高清在线观看| 中文字幕乱码久久午夜不卡| 国产精品久久久久四虎| 夜夜精品浪潮av一区二区三区| 国产日韩欧美一区二区三区乱码| 欧美一区二区视频在线观看2020 | 韩国一区二区在线观看| 成人性视频网站| 51精品国自产在线| 精品国产一区二区三区av性色 | 日韩精品视频网站| 成人aa视频在线观看| 91精品国产综合久久久蜜臀图片| 欧美日韩国产综合一区二区 | 伊人色综合久久天天人手人婷| 1区2区3区欧美| 九九**精品视频免费播放| 色94色欧美sute亚洲13| 久久久久久久久蜜桃| 天天影视色香欲综合网老头| 波多野结衣在线一区| 精品成人一区二区三区| 天天综合日日夜夜精品| 在线观看亚洲成人| 国产精品久久久久久亚洲伦| 韩国欧美国产一区| 欧美日韩亚洲综合在线| 亚洲色欲色欲www| 大美女一区二区三区| 欧美电影免费观看完整版| 亚洲一区二区三区视频在线| 国产91在线|亚洲| 日韩一级片在线播放| 亚洲mv在线观看| 色激情天天射综合网| 一区视频在线播放| 国产精品一区二区不卡| 日韩精品一区二区三区视频在线观看 | 日韩欧美亚洲国产精品字幕久久久| 日韩欧美成人一区二区| 亚洲无线码一区二区三区| 91理论电影在线观看| 国产精品久久综合| 成人蜜臀av电影| 国产日韩欧美精品综合| 国产米奇在线777精品观看| 精品少妇一区二区三区在线播放| 欧美mv和日韩mv国产网站| 婷婷国产在线综合| 欧美日韩综合在线免费观看| 一区二区三区**美女毛片| 99精品一区二区| 亚洲色图欧美偷拍| 97久久精品人人做人人爽| 自拍偷拍国产精品| 99精品欧美一区| 亚洲乱码精品一二三四区日韩在线 | 狠狠色丁香久久婷婷综合_中| 不卡电影一区二区三区| 国产精品美日韩| 成熟亚洲日本毛茸茸凸凹| 国产三级精品视频| 国产一区二区三区在线观看精品| 在线精品视频小说1| 亚洲最新在线观看| 色婷婷激情一区二区三区| 亚洲精品欧美在线| 欧美艳星brazzers| 亚洲成av人片| 欧美r级在线观看| 国产精品白丝av| 极品少妇xxxx精品少妇| 久久九九99视频| 成人动漫中文字幕| 亚洲色欲色欲www| 欧美日韩亚洲丝袜制服| 免费一级欧美片在线观看| 日韩欧美一区二区三区在线| 久久成人av少妇免费| 欧美高清在线精品一区| 91原创在线视频| 亚洲成精国产精品女| 日韩一级欧美一级| 国产 日韩 欧美大片| 一区免费观看视频| 欧美精品v国产精品v日韩精品| 久久综合色综合88| 懂色av中文字幕一区二区三区| 欧美顶级少妇做爰| 麻豆成人免费电影| 欧美韩日一区二区三区四区| 色素色在线综合| 久久成人麻豆午夜电影| 中文字幕av一区二区三区高 | 久久九九久久九九| 色偷偷成人一区二区三区91| 蜜臀91精品一区二区三区 | 久久精品国产一区二区三| 精品久久久久久无| 91麻豆国产精品久久| 日韩精品成人一区二区三区| 久久久久高清精品| 欧美性欧美巨大黑白大战| 国内成人自拍视频| 亚洲自拍偷拍麻豆| 久久久久青草大香线综合精品| 九九视频精品免费| 亚洲视频中文字幕| 日韩欧美在线综合网| 91亚洲精品乱码久久久久久蜜桃| 国产欧美日韩精品a在线观看| 国产一区二区成人久久免费影院| 亚洲亚洲人成综合网络| 日韩精品一区二区三区老鸭窝 | 欧美成人一级视频| 色综合一区二区| 久久66热偷产精品| 亚洲精品欧美二区三区中文字幕| 99r国产精品| 麻豆一区二区三区| 亚洲综合成人网| 国产日韩欧美在线一区| 欧美精品在欧美一区二区少妇| 视频一区二区国产| 中文字幕日韩一区| 欧美一级理论性理论a| 99久久婷婷国产精品综合| 久久精品国内一区二区三区 | 国产大陆a不卡| 亚洲妇熟xx妇色黄| 国产精品久久久久久久久免费相片 | 91精品久久久久久久久99蜜臂| 日韩精品一卡二卡三卡四卡无卡| 在线成人免费视频| 99国产精品久久久久久久久久久| 亚洲美女免费在线| 国产色爱av资源综合区| 欧美一区2区视频在线观看| av中文一区二区三区| 久久国产综合精品| 亚瑟在线精品视频| 一区二区三区91| 日韩美女视频一区| 国产精品私房写真福利视频| 26uuu亚洲| 91精品国模一区二区三区| 欧美吻胸吃奶大尺度电影 | 久久综合色婷婷| 日韩一区二区电影网| 欧美浪妇xxxx高跟鞋交| 色婷婷久久久综合中文字幕| 国产福利电影一区二区三区| 久久99久久久欧美国产| 亚洲福利视频一区| 亚洲欧美另类在线| 中文字幕一区二区三区蜜月| 欧美国产日韩精品免费观看| 久久久精品综合| 亚洲精品在线观看网站| 精品精品国产高清a毛片牛牛| 成年人网站91| 国产91精品免费| heyzo一本久久综合| 国产99久久久国产精品| 高潮精品一区videoshd| 成人激情黄色小说| 大胆欧美人体老妇| 9i在线看片成人免费| 99热国产精品| 日本韩国精品一区二区在线观看| 精品在线你懂的| 国产精品一区二区在线观看网站| 伊人一区二区三区| 亚洲欧美国产三级| 亚洲欧美另类久久久精品 | 国产.欧美.日韩| 99久久久免费精品国产一区二区| 三级久久三级久久| 日韩电影一区二区三区| 五月天一区二区三区| 免费的国产精品| 极品瑜伽女神91| 99免费精品视频|