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

📄 stm32f10x_flash.lst

📁 STM32 "kickstart" program with newlib/stdio like sprintf&printf
💻 LST
📖 第 1 页 / 共 5 页
字号:
 315:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         FLASH->CR &= CR_OPTPG_Reset;
 316:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 317:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }  
 318:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   }
 319:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the erase status */
 320:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;
 321:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 322:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 323:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 324:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Programs a word at a specified address.
 325:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Address: specifies the address to be programmed.
 326:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Data: specifies the data to be programmed.
 327:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 328:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 329:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT. 
 330:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 331:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
 332:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 333:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE;
 334:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 335:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_FLASH_ADDRESS(Address));
 336:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Wait for last operation to be completed */
 337:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(ProgramTimeout);
 338:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 339:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 340:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {
 341:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* if the previous operation is completed, proceed to program the new first 
 342:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     half word */
 343:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_PG_Set;
 344:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 345:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     *(__IO uint16_t*)Address = (uint16_t)Data;
 346:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Wait for last operation to be completed */
 347:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     status = FLASH_WaitForLastOperation(ProgramTimeout);
 348:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****  
 349:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(status == FLASH_COMPLETE)
 350:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 351:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* if the previous operation is completed, proceed to program the new second 
 352:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       half word */
 353:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       *(__IO uint16_t*)(Address + 2) = Data >> 16;
 354:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     
 355:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* Wait for last operation to be completed */
 356:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       status = FLASH_WaitForLastOperation(ProgramTimeout);
 357:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         
 358:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       if(status != FLASH_BUSY)
 359:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 360:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         /* Disable the PG Bit */
 361:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         FLASH->CR &= CR_PG_Reset;
 362:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 363:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 364:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     else
 365:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 366:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       if (status != FLASH_BUSY)
 367:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       {
 368:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         /* Disable the PG Bit */
 369:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****         FLASH->CR &= CR_PG_Reset;
 370:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       }
 371:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****      }
 372:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   }
 373:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the Program Status */
 374:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;
 375:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 376:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 377:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 378:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Programs a half word at a specified address.
 379:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Address: specifies the address to be programmed.
 380:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Data: specifies the data to be programmed.
 381:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 382:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 383:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT. 
 384:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 385:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
 386:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 387:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE;
 388:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 389:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_FLASH_ADDRESS(Address));
 390:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Wait for last operation to be completed */
 391:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(ProgramTimeout);
 392:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 393:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 394:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {
 395:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* if the previous operation is completed, proceed to program the new data */
 396:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_PG_Set;
 397:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 398:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     *(__IO uint16_t*)Address = Data;
 399:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Wait for last operation to be completed */
 400:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     status = FLASH_WaitForLastOperation(ProgramTimeout);
 401:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(status != FLASH_BUSY)
 402:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 403:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* if the program operation is completed, disable the PG Bit */
 404:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       FLASH->CR &= CR_PG_Reset;
 405:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 406:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   } 
 407:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the Program Status */
 408:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;
 409:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 410:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 411:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 412:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Programs a half word at a specified Option Byte Data address.
 413:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Address: specifies the address to be programmed.
 414:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   This parameter can be 0x1FFFF804 or 0x1FFFF806. 
 415:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param Data: specifies the data to be programmed.
 416:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 417:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 418:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT. 
 419:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 420:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_ProgramOptionByteData(uint32_t Address, uint8_t Data)
 421:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 422:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE;
 423:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 424:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_OB_DATA_ADDRESS(Address));
 425:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   status = FLASH_WaitForLastOperation(ProgramTimeout);
 426:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   if(status == FLASH_COMPLETE)
 427:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   {
 428:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Authorize the small information block programming */
 429:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY1;
 430:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->OPTKEYR = FLASH_KEY2;
 431:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Enables the Option Bytes Programming operation */
 432:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     FLASH->CR |= CR_OPTPG_Set; 
 433:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     *(__IO uint16_t*)Address = Data;
 434:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     
 435:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     /* Wait for last operation to be completed */
 436:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     status = FLASH_WaitForLastOperation(ProgramTimeout);
 437:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     if(status != FLASH_BUSY)
 438:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     {
 439:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       /* if the program operation is completed, disable the OPTPG Bit */
 440:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****       FLASH->CR &= CR_OPTPG_Reset;
 441:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****     }
 442:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   }    
 443:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Return the Option Byte Data Program Status */
 444:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   return status;
 445:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** }
 446:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** 
 447:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** /**
 448:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @brief  Write protects the desired pages
 449:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @param FLASH_Pages: specifies the address of the pages to be 
 450:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   write protected. This parameter can be:
 451:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg For STM32F10Xxx Medium-density devices (FLASH page size equal to 1 KB)
 452:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * A value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages124to127
 453:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg For STM32F10Xxx High-density devices (FLASH page size equal to 2 KB) 
 454:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * A value between FLASH_WRProt_Pages0to1 and  FLASH_WRProt_Pages60to61 
 455:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * or FLASH_WRProt_Pages62to255 
 456:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @arg FLASH_WRProt_AllPages
 457:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   * @retval : FLASH Status: The returned value can be: FLASH_BUSY, 
 458:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or 
 459:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   *   FLASH_TIMEOUT.
 460:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   */
 461:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** FLASH_Status FLASH_EnableWriteProtection(uint32_t FLASH_Pages)
 462:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c **** {
 463:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   uint16_t WRP0_Data = 0xFFFF, WRP1_Data = 0xFFFF, WRP2_Data = 0xFFFF, WRP3_Data = 0xFFFF;
 464:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 465:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Status status = FLASH_COMPLETE;
 466:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 467:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   /* Check the parameters */
 468:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   assert_param(IS_FLASH_WRPROT_PAGE(FLASH_Pages));
 469:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   
 470:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   FLASH_Pages = (uint32_t)(~FLASH_Pages);
 471:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   WRP0_Data = (uint16_t)(FLASH_Pages & WRP0_Mask);
 472:lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c ****   WRP1_Data = (uint16_t)((FLASH_Pages & WRP1_Mask) >> 8);

⌨️ 快捷键说明

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