robot

Dependencies:   FastPWM3 mbed

Embed: (wiki syntax)

« Back to documentation index

stm32f4xx_flash.c File Reference

stm32f4xx_flash.c File Reference

This file provides firmware functions to manage the following functionalities of the FLASH peripheral: + FLASH Interface configuration + FLASH Memory Programming + Option Bytes Programming + Interrupts and flags management. More...

Go to the source code of this file.

Functions

void FLASH_SetLatency (uint32_t FLASH_Latency)
 Sets the code latency value.
void FLASH_PrefetchBufferCmd (FunctionalState NewState)
 Enables or disables the Prefetch Buffer.
void FLASH_InstructionCacheCmd (FunctionalState NewState)
 Enables or disables the Instruction Cache feature.
void FLASH_DataCacheCmd (FunctionalState NewState)
 Enables or disables the Data Cache feature.
void FLASH_InstructionCacheReset (void)
 Resets the Instruction Cache.
void FLASH_DataCacheReset (void)
 Resets the Data Cache.
void FLASH_Unlock (void)
 Unlocks the FLASH control register access.
void FLASH_Lock (void)
 Locks the FLASH control register access.
FLASH_Status FLASH_EraseSector (uint32_t FLASH_Sector, uint8_t VoltageRange)
 Erases a specified FLASH Sector.
FLASH_Status FLASH_EraseAllSectors (uint8_t VoltageRange)
 Erases all FLASH Sectors.
FLASH_Status FLASH_EraseAllBank1Sectors (uint8_t VoltageRange)
 Erases all FLASH Sectors in Bank 1.
FLASH_Status FLASH_EraseAllBank2Sectors (uint8_t VoltageRange)
 Erases all FLASH Sectors in Bank 2.
FLASH_Status FLASH_ProgramDoubleWord (uint32_t Address, uint64_t Data)
 Programs a double word (64-bit) at a specified address.
FLASH_Status FLASH_ProgramWord (uint32_t Address, uint32_t Data)
 Programs a word (32-bit) at a specified address.
FLASH_Status FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word (16-bit) at a specified address.
FLASH_Status FLASH_ProgramByte (uint32_t Address, uint8_t Data)
 Programs a byte (8-bit) at a specified address.
void FLASH_OB_Unlock (void)
 Unlocks the FLASH Option Control Registers access.
void FLASH_OB_Lock (void)
 Locks the FLASH Option Control Registers access.
void FLASH_OB_WRPConfig (uint32_t OB_WRP, FunctionalState NewState)
 Enables or disables the write protection of the desired sectors, for the first 1 Mb of the Flash.
void FLASH_OB_WRP1Config (uint32_t OB_WRP, FunctionalState NewState)
 Enables or disables the write protection of the desired sectors, for the second 1 Mb of the Flash.
void FLASH_OB_PCROPSelectionConfig (uint8_t OB_PcROP)
 Select the Protection Mode (SPRMOD).
void FLASH_OB_PCROPConfig (uint32_t OB_PCROP, FunctionalState NewState)
 Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of the Flash.
void FLASH_OB_PCROP1Config (uint32_t OB_PCROP, FunctionalState NewState)
 Enables or disables the read/write protection (PCROP) of the desired sectors.
void FLASH_OB_RDPConfig (uint8_t OB_RDP)
 Sets the read protection level.
void FLASH_OB_UserConfig (uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
 Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
void FLASH_OB_BootConfig (uint8_t OB_BOOT)
 Configure the Dual Bank Boot.
void FLASH_OB_BORConfig (uint8_t OB_BOR)
 Sets the BOR Level.
FLASH_Status FLASH_OB_Launch (void)
 Launch the option byte loading.
uint8_t FLASH_OB_GetUser (void)
 Returns the FLASH User Option Bytes values.
uint16_t FLASH_OB_GetWRP (void)
 Returns the FLASH Write Protection Option Bytes value.
uint16_t FLASH_OB_GetWRP1 (void)
 Returns the FLASH Write Protection Option Bytes value.
uint16_t FLASH_OB_GetPCROP (void)
 Returns the FLASH PC Read/Write Protection Option Bytes value.
uint16_t FLASH_OB_GetPCROP1 (void)
 Returns the FLASH PC Read/Write Protection Option Bytes value.
FlagStatus FLASH_OB_GetRDP (void)
 Returns the FLASH Read Protection level.
uint8_t FLASH_OB_GetBOR (void)
 Returns the FLASH BOR level.
void FLASH_ITConfig (uint32_t FLASH_IT, FunctionalState NewState)
 Enables or disables the specified FLASH interrupts.
FlagStatus FLASH_GetFlagStatus (uint32_t FLASH_FLAG)
 Checks whether the specified FLASH flag is set or not.
void FLASH_ClearFlag (uint32_t FLASH_FLAG)
 Clears the FLASH's pending flags.
FLASH_Status FLASH_GetStatus (void)
 Returns the FLASH Status.
FLASH_Status FLASH_WaitForLastOperation2 (void)
 Waits for a FLASH operation to complete.

Detailed Description

This file provides firmware functions to manage the following functionalities of the FLASH peripheral: + FLASH Interface configuration + FLASH Memory Programming + Option Bytes Programming + Interrupts and flags management.

Author:
MCD Application Team
Version:
V1.7.1
Date:
20-May-2016
 ===============================================================================
                        ##### How to use this driver #####
 ===============================================================================
    [..]                             
      This driver provides functions to configure and program the FLASH memory 
      of all STM32F4xx devices. These functions are split in 4 groups:
   
      (#) FLASH Interface configuration functions: this group includes the
          management of the following features:
        (++) Set the latency
        (++) Enable/Disable the prefetch buffer
        (++) Enable/Disable the Instruction cache and the Data cache
        (++) Reset the Instruction cache and the Data cache
    
      (#) FLASH Memory Programming functions: this group includes all needed
          functions to erase and program the main memory:
        (++) Lock and Unlock the FLASH interface
        (++) Erase function: Erase sector, erase all sectors
        (++) Program functions: byte, half word, word and double word
    
      (#) Option Bytes Programming functions: this group includes all needed
          functions to manage the Option Bytes:
        (++) Set/Reset the write protection
        (++) Set the Read protection Level
        (++) Set the BOR level
        (++) Program the user Option Bytes
        (++) Launch the Option Bytes loader
    
      (#) Interrupts and flags management functions: this group 
          includes all needed functions to:
        (++) Enable/Disable the FLASH interrupt sources
        (++) Get flags status
        (++) Clear flags
        (++) Get FLASH operation status
        (++) Wait for last FLASH operation   
 
Attention:

© COPYRIGHT 2016 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm32f4xx_flash.c.