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

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

?? stm32f10x_flash.c

?? 51單片機(jī)的內(nèi)存優(yōu)化和中斷的有用知識
?? C
?? 第 1 頁 / 共 3 頁
字號:
*                     - OB_STDBY_RST: Reset generated when entering in STANDBY
* Output         : None
* Return         : FLASH Status: The returned value can be: FLASH_BUSY, 
*                  FLASH_ERROR_PG or FLASH_ERROR_WRP or FLASH_COMPLETE or 
*                  FLASH_TIMEOUT.
*******************************************************************************/
FLASH_Status FLASH_UserOptionByteConfig(u16 OB_IWDG, u16 OB_STOP, u16 OB_STDBY)
{
  FLASH_Status status = FLASH_COMPLETE; 

  /* Check the parameters */
  assert(IS_OB_IWDG_SOURCE(OB_IWDG));
  assert(IS_OB_STOP_SOURCE(OB_STOP));
  assert(IS_OB_STDBY_SOURCE(OB_STDBY));

  /* Authorize the small information block programming */
  FLASH->OPTKEYR = FLASH_KEY1;
  FLASH->OPTKEYR = FLASH_KEY2;
  
  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(ProgramTimeout);
  
  if(status == FLASH_COMPLETE)
  {  
    /* Enable the Option Bytes Programming operation */
    FLASH->CR |= CR_OPTPG_Set; 
           
    OB->USER = ( OB_IWDG | OB_STOP |OB_STDBY) | (u16)0xF8; 
  
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(ProgramTimeout);

    if(status != FLASH_BUSY)
    {
      /* if the program operation is completed, disable the OPTPG Bit */
      FLASH->CR &= CR_OPTPG_Reset;
    }
  }    
  /* Return the Option Byte program Status */
  return status;
}

/*******************************************************************************
* Function Name  : FLASH_GetUserOptionByte
* Description    : Returns the FLASH User Option Bytes values.
* Input          : None
* Output         : None
* Return         : The FLASH User Option Bytes values:IWDG_SW(Bit0), RST_STOP(Bit1)
*                  and RST_STDBY(Bit2).
*******************************************************************************/
u32 FLASH_GetUserOptionByte(void)
{
  /* Return the User Option Byte */
  return (u32)(FLASH->OBR >> 2);
}

/*******************************************************************************
* Function Name  : FLASH_GetWriteProtectionOptionByte
* Description    : Returns the FLASH Write Protection Option Bytes Register value.
* Input          : None
* Output         : None
* Return         : The FLASH Write Protection  Option Bytes Register value
*******************************************************************************/
u32 FLASH_GetWriteProtectionOptionByte(void)
{
  /* Return the Falsh write protection Register value */
  return (u32)(FLASH->WRPR);
}

/*******************************************************************************
* Function Name  : FLASH_GetReadOutProtectionStatus
* Description    : Checks whether the FLASH Read Out Protection Status is set 
*                  or not.
* Input          : None
* Output         : None
* Return         : FLASH ReadOut Protection Status(SET or RESET)
*******************************************************************************/
FlagStatus FLASH_GetReadOutProtectionStatus(void)
{
  FlagStatus readoutstatus = RESET;

  if ((FLASH->OBR & RDPRT_Mask) != (u32)RESET)
  {
    readoutstatus = SET;
  }
  else
  {
    readoutstatus = RESET;
  }
  return readoutstatus;
}

/*******************************************************************************
* Function Name  : FLASH_GetPrefetchBufferStatus
* Description    : Checks whether the FLASH Prefetch Buffer status is set or not.
* Input          : None
* Output         : None
* Return         : FLASH Prefetch Buffer Status (SET or RESET).
*******************************************************************************/
FlagStatus FLASH_GetPrefetchBufferStatus(void)
{
  FlagStatus bitstatus = RESET;
  
  if ((FLASH->ACR & ACR_PRFTBS_Mask) != (u32)RESET)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  /* Return the new state of FLASH Prefetch Buffer Status (SET or RESET) */
  return bitstatus; 
}

/*******************************************************************************
* Function Name  : FLASH_ITConfig
* Description    : Enables or disables the specified FLASH interrupts.
* Input          : - FLASH_IT: specifies the FLASH interrupt sources to be 
*                    enabled or disabled.
*                    This parameter can be any combination of the following values:
*                       - FLASH_IT_ERROR: FLASH Error Interrupt
*                       - FLASH_IT_EOP: FLASH end of operation Interrupt
* Output         : None
* Return         : None 
*******************************************************************************/
void FLASH_ITConfig(u16 FLASH_IT, FunctionalState NewState)
{
  /* Check the parameters */
  assert(IS_FLASH_IT(FLASH_IT)); 
  assert(IS_FUNCTIONAL_STATE(NewState));

  if(NewState != DISABLE)
  {
    /* Enable the interrupt sources */
    FLASH->CR |= FLASH_IT;
  }
  else
  {
    /* Disable the interrupt sources */
    FLASH->CR &= ~(u32)FLASH_IT;
  }
}

/*******************************************************************************
* Function Name  : FLASH_GetFlagStatus
* Description    : Checks whether the specified FLASH flag is set or not.
* Input          : - FLASH_FLAG: specifies the FLASH flag to check.
*                     This parameter can be one of the following values:
*                    - FLASH_FLAG_BSY: FLASH Busy flag           
*                    - FLASH_FLAG_PGERR: FLASH Program error flag       
*                    - FLASH_FLAG_WRPRTERR: FLASH Write protected error flag      
*                    - FLASH_FLAG_EOP: FLASH End of Operation flag           
*                    - FLASH_FLAG_OPTERR:  FLASH Option Byte error flag     
* Output         : None
* Return         : The new state of FLASH_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus FLASH_GetFlagStatus(u16 FLASH_FLAG)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert(IS_FLASH_GET_FLAG(FLASH_FLAG)) ;

  if(FLASH_FLAG == FLASH_FLAG_OPTERR) 
  {
    if((FLASH->OBR & FLASH_FLAG_OPTERR) != (u32)RESET)
    {
      bitstatus = SET;
    }
    else
    {
      bitstatus = RESET;
    }
  }
  else
  {
   if((FLASH->SR & FLASH_FLAG) != (u32)RESET)
    {
      bitstatus = SET;
    }
    else
    {
      bitstatus = RESET;
    }
  }
  /* Return the new state of FLASH_FLAG (SET or RESET) */
  return bitstatus;
}

/*******************************************************************************
* Function Name  : FLASH_ClearFlag
* Description    : Clears the FLASH抯 pending flags.
* Input          : - FLASH_FLAG: specifies the FLASH flags to clear.
*                    This parameter can be any combination of the following values:
*                    - FLASH_FLAG_BSY: FLASH Busy flag           
*                    - FLASH_FLAG_PGERR: FLASH Program error flag       
*                    - FLASH_FLAG_WRPRTERR: FLASH Write protected error flag      
*                    - FLASH_FLAG_EOP: FLASH End of Operation flag           
* Output         : None
* Return         : None
*******************************************************************************/
void FLASH_ClearFlag(u16 FLASH_FLAG)
{
  /* Check the parameters */
  assert(IS_FLASH_CLEAR_FLAG(FLASH_FLAG)) ;
  
  /* Clear the flags */
  FLASH->SR = FLASH_FLAG;
}

/*******************************************************************************
* Function Name  : FLASH_GetStatus
* Description    : Returns the FLASH Status.
* Input          : None
* Output         : None
* Return         : FLASH Status: The returned value can be: FLASH_BUSY, 
*                  FLASH_ERROR_PG or FLASH_ERROR_WRP or FLASH_COMPLETE
*******************************************************************************/
FLASH_Status FLASH_GetStatus(void)
{
  FLASH_Status flashstatus = FLASH_COMPLETE;
  
  if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY) 
  {
    flashstatus = FLASH_BUSY;
  }
  else 
  {  
    if(FLASH->SR & FLASH_FLAG_PGERR)
    { 
      flashstatus = FLASH_ERROR_PG;
    }
    else 
    {
      if(FLASH->SR & FLASH_FLAG_WRPRTERR)
      {
        flashstatus = FLASH_ERROR_WRP;
      }
      else
      {
        flashstatus = FLASH_COMPLETE;
      }
    }
  }
  /* Return the Flash Status */
  return flashstatus;
}

/*******************************************************************************
* Function Name  : FLASH_WaitForLastOperation
* Description    : Waits for a Flash operation to complete or a TIMEOUT to occur.
* Input          : - Timeout: FLASH progamming Timeout
* Output         : None
* Return         : FLASH Status: The returned value can be: FLASH_BUSY, 
*                  FLASH_ERROR_PG or FLASH_ERROR_WRP or FLASH_COMPLETE or 
*                  FLASH_TIMEOUT.
*******************************************************************************/
FLASH_Status FLASH_WaitForLastOperation(u32 Timeout)
{ 
  FLASH_Status status = FLASH_COMPLETE;
   
  /* Check for the Flash Status */
  status = FLASH_GetStatus();

  /* Wait for a Flash operation to complete or a TIMEOUT to occur */
  while((status == FLASH_BUSY) && (Timeout != 0x00))
  {
    delay();
    status = FLASH_GetStatus();
    Timeout--;
  }

  if(Timeout == 0x00 )
  {
    status = FLASH_TIMEOUT;
  }

  /* Return the operation status */
  return status;
}

/*******************************************************************************
* Function Name  : delay
* Description    : Inserts a time delay.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
static void delay(void)
{
  vu32 i = 0;

  for(i = 0xFF; i != 0; i--)
  {
  }
}
#endif

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性淫爽ww久久久久无| 国产乱人伦偷精品视频免下载| 91视频你懂的| 中文字幕日本不卡| 91伊人久久大香线蕉| 亚洲一区在线观看视频| 欧美日韩国产乱码电影| 六月丁香婷婷久久| 国产视频一区在线播放| 成人午夜视频在线| 亚洲电影一级片| 欧美精品一区二区三区视频 | 亚洲综合无码一区二区| 欧美精品一二三四| 久久电影国产免费久久电影| 国产精品你懂的在线欣赏| 色婷婷av一区二区三区gif | 精品乱人伦小说| 成人免费高清视频在线观看| 一级中文字幕一区二区| 欧美一卡2卡三卡4卡5免费| 国产91精品一区二区麻豆亚洲| 中文字幕在线观看一区二区| 欧美色涩在线第一页| 精品在线观看免费| 亚洲精品第1页| 久久网站最新地址| 精品视频在线免费看| 国精品**一区二区三区在线蜜桃| 亚洲欧美综合另类在线卡通| 欧美美女网站色| 福利电影一区二区三区| 亚洲国产视频一区| 国产人伦精品一区二区| 欧美影视一区在线| 国产suv一区二区三区88区| 亚洲精品免费视频| 精品精品国产高清a毛片牛牛| 91原创在线视频| 国产成人免费在线| 日韩成人一区二区| 一区二区三区在线影院| 久久久99免费| 555夜色666亚洲国产免| 国产精品一二三区| 午夜国产精品影院在线观看| 国产精品麻豆欧美日韩ww| 欧美一区二区播放| 欧美专区日韩专区| 91一区二区三区在线观看| 国内成人免费视频| 男人操女人的视频在线观看欧美| 一区二区高清在线| 日韩美女精品在线| 国产欧美精品区一区二区三区| 91精品蜜臀在线一区尤物| 91蜜桃在线免费视频| 国产69精品久久久久毛片| 奇米色一区二区| 午夜成人在线视频| 亚洲午夜在线视频| 亚洲午夜久久久久久久久久久| 中文字幕精品一区二区三区精品| 久久综合久久99| 26uuu国产一区二区三区 | 精品国产精品一区二区夜夜嗨| 欧美无砖专区一中文字| 在线免费观看视频一区| 日本黄色一区二区| 日本黄色一区二区| 在线影院国内精品| 欧美亚洲高清一区二区三区不卡| 一本色道久久综合亚洲精品按摩| 不卡的av网站| 色综合久久中文字幕| 97se亚洲国产综合在线| 99re视频精品| 日本乱人伦一区| 欧洲一区二区三区免费视频| 欧美中文一区二区三区| 欧美挠脚心视频网站| 欧美精品久久99| 日韩欧美国产麻豆| 久久嫩草精品久久久精品| 国产亚洲短视频| 国产精品免费网站在线观看| 国产精品二三区| 一区二区三区在线免费观看| 香蕉久久夜色精品国产使用方法| 丝袜国产日韩另类美女| 青青草国产精品97视觉盛宴| 激情小说亚洲一区| www.久久久久久久久| 色综合久久久久久久久久久| 欧美性大战久久| 欧美成人激情免费网| 国产视频不卡一区| 亚洲老司机在线| 六月丁香婷婷色狠狠久久| 国产精品99久久久| 日本韩国精品一区二区在线观看| 欧美美女一区二区| 日本一区二区视频在线观看| 亚洲精品免费视频| 久久精品国产秦先生| www.欧美日韩国产在线| 欧美日韩一二三区| 久久久综合精品| 一区二区三区欧美在线观看| 美女脱光内衣内裤视频久久影院| 国产成人精品综合在线观看| 91久久精品网| 欧美精品一区二区三区在线| 亚洲色图在线视频| 久久精品国产成人一区二区三区| av亚洲产国偷v产偷v自拍| 91精品国产欧美日韩| 中文字幕av一区二区三区免费看 | 制服丝袜av成人在线看| 久久久美女毛片| 亚洲国产成人va在线观看天堂| 精品一区二区久久| 在线看国产日韩| 国产日韩欧美一区二区三区乱码 | 亚洲自拍偷拍图区| 国产精品自拍三区| 欧美视频日韩视频| 国产精品网站在线| 麻豆精品视频在线| 在线视频亚洲一区| 国产精品热久久久久夜色精品三区 | 日韩电影免费在线看| 99国产精品久久久久久久久久| 日韩网站在线看片你懂的| 日韩一区在线播放| 国产iv一区二区三区| 日韩一区二区影院| 亚洲一区二区三区自拍| 成人av手机在线观看| 精品欧美一区二区三区精品久久 | 欧美国产成人在线| 麻豆国产欧美一区二区三区| 在线精品国精品国产尤物884a| 久久精品人人做人人爽人人| 男男视频亚洲欧美| 欧美中文字幕一区二区三区| 中文字幕一区二区三区在线不卡| 狠狠色狠狠色综合| 日韩一级成人av| 丝袜美腿亚洲色图| 欧美久久久一区| 怡红院av一区二区三区| 成人av电影观看| 国产精品婷婷午夜在线观看| 黄色资源网久久资源365| 欧美大片免费久久精品三p| 亚洲国产日韩精品| 欧美午夜精品理论片a级按摩| 一区二区三区中文在线| 色综合色综合色综合 | 91精品欧美福利在线观看| 亚洲精品国产无套在线观| a美女胸又www黄视频久久| 中文字幕在线播放不卡一区| 成人晚上爱看视频| 日韩一区有码在线| 一本在线高清不卡dvd| 一区二区三区免费| 在线亚洲人成电影网站色www| 亚洲伦在线观看| 欧美亚洲愉拍一区二区| 亚洲va国产va欧美va观看| 欧美日韩精品免费观看视频| 午夜精品123| 日韩一区二区免费电影| 老司机精品视频在线| 久久久久国产精品厨房| 成人黄色av电影| 亚洲人成网站在线| 欧美性受xxxx黑人xyx性爽| 亚洲一区二区精品3399| 欧美一区三区二区| 国产一区二区在线免费观看| 国产女主播视频一区二区| av在线不卡网| 亚洲r级在线视频| 日韩欧美电影一二三| 国产一区二区三区黄视频| 国产精品乱码人人做人人爱 | 精品污污网站免费看| 秋霞影院一区二区| 久久久久国产精品麻豆| 91蜜桃在线免费视频| 美女国产一区二区三区| 国产日韩欧美电影| 欧美在线观看视频一区二区| 伦理电影国产精品| 亚洲女同一区二区| 日韩一区二区视频| 99久久综合狠狠综合久久|