⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm32f10x_flash.lst

📁 STM32 DFU FULL(V3.0.1) You can upload your program via USB-DeviceFirmwareUpdate mode
💻 LST
📖 第 1 页 / 共 5 页
字号:
 473:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   WRP2_Data = (uint16_t)((FLASH_Pages & WRP2_Mask) >> 16);
 474:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   WRP3_Data = (uint16_t)((FLASH_Pages & WRP3_Mask) >> 24);
 475:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 476:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Wait for last operation to be completed */
 477:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(ProgramTimeout);
 478:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 479:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 480:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {
 481:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Authorizes the small information block programming */
 482:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY1;
 483:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY2;
 484:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_OPTPG_Set;
 485:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(WRP0_Data != 0xFF)
 486:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 487:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       OB->WRP0 = WRP0_Data;
 488:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       
 489:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 490:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(ProgramTimeout);
 491:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 492:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if((status == FLASH_COMPLETE) && (WRP1_Data != 0xFF))
 493:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 494:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       OB->WRP1 = WRP1_Data;
 495:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       
 496:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 497:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(ProgramTimeout);
 498:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 499:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if((status == FLASH_COMPLETE) && (WRP2_Data != 0xFF))
 500:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 501:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       OB->WRP2 = WRP2_Data;
 502:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       
 503:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 504:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(ProgramTimeout);
 505:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 506:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     
 507:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if((status == FLASH_COMPLETE)&& (WRP3_Data != 0xFF))
 508:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 509:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       OB->WRP3 = WRP3_Data;
 510:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****      
 511:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 512:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(ProgramTimeout);
 513:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 514:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****           
 515:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(status != FLASH_BUSY)
 516:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 517:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* if the program operation is completed, disable the OPTPG Bit */
 518:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       FLASH->CR &= CR_OPTPG_Reset;
 519:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 520:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   } 
 521:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the write protection operation Status */
 522:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;       
 523:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 524:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 525:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 526:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Enables or disables the read out protection.
 527:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   If the user has already programmed the other option bytes before 
 528:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   calling this function, he must re-program them since this 
 529:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   function erases all option bytes.
 530:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Newstate: new state of the ReadOut Protection.
 531:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   This parameter can be: ENABLE or DISABLE.
 532:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 533:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 534:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT.
 535:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 536:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_ReadOutProtection(FunctionalState NewState)
 537:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 538:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE;
 539:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 540:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_FUNCTIONAL_STATE(NewState));
 541:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(EraseTimeout);
 542:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 543:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {
 544:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Authorizes the small information block programming */
 545:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY1;
 546:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY2;
 547:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_OPTER_Set;
 548:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_STRT_Set;
 549:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Wait for last operation to be completed */
 550:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     status = FLASH_WaitForLastOperation(EraseTimeout);
 551:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(status == FLASH_COMPLETE)
 552:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 553:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* if the erase operation is completed, disable the OPTER Bit */
 554:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       FLASH->CR &= CR_OPTER_Reset;
 555:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Enable the Option Bytes Programming operation */
 556:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       FLASH->CR |= CR_OPTPG_Set; 
 557:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       if(NewState != DISABLE)
 558:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 559:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         OB->RDP = 0x00;
 560:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 561:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       else
 562:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 563:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         OB->RDP = RDP_Key;  
 564:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 565:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 566:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(EraseTimeout); 
 567:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     
 568:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       if(status != FLASH_BUSY)
 569:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 570:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         /* if the program operation is completed, disable the OPTPG Bit */
 571:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         FLASH->CR &= CR_OPTPG_Reset;
 572:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 573:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 574:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     else 
 575:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 576:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       if(status != FLASH_BUSY)
 577:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 578:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         /* Disable the OPTER Bit */
 579:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         FLASH->CR &= CR_OPTER_Reset;
 580:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 581:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 582:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   }
 583:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the protection operation Status */
 584:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;      
 585:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 586:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 587:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 588:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Programs the FLASH User Option Byte: IWDG_SW / RST_STOP /
 589:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   RST_STDBY.
 590:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param OB_IWDG: Selects the IWDG mode
 591:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   This parameter can be one of the following values:
 592:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_IWDG_SW: Software IWDG selected
 593:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_IWDG_HW: Hardware IWDG selected
 594:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param OB_STOP: Reset event when entering STOP mode.
 595:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   This parameter can be one of the following values:
 596:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_STOP_NoRST: No reset generated when entering in STOP
 597:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_STOP_RST: Reset generated when entering in STOP
 598:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param OB_STDBY: Reset event when entering Standby mode.
 599:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   This parameter can be one of the following values:
 600:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_STDBY_NoRST: No reset generated when entering in STANDBY
 601:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg OB_STDBY_RST: Reset generated when entering in STANDBY
 602:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 603:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 604:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT.
 605:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 606:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_UserOptionByteConfig(uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY)
 607:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 608:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE; 
 609:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 610:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_OB_IWDG_SOURCE(OB_IWDG));
 611:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_OB_STOP_SOURCE(OB_STOP));
 612:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_OB_STDBY_SOURCE(OB_STDBY));
 613:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Authorize the small information block programming */
 614:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH->OPTKEYR = FLASH_KEY1;
 615:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH->OPTKEYR = FLASH_KEY2;
 616:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 617:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Wait for last operation to be completed */
 618:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(ProgramTimeout);
 619:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 620:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 621:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {  
 622:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Enable the Option Bytes Programming operation */
 623:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_OPTPG_Set; 
 624:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****            
 625:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     OB->USER = ( OB_IWDG | OB_STOP |OB_STDBY) | (uint16_t)0xF8; 
 626:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 627:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Wait for last operation to be completed */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -