Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

stm32f30x_flash.c File Reference

stm32f30x_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_HalfCycleAccessCmd (FunctionalState NewState)
 Enables or disables the Half cycle flash access.
void FLASH_PrefetchBufferCmd (FunctionalState NewState)
 Enables or disables the Prefetch Buffer.
void FLASH_Unlock (void)
 Unlocks the FLASH control register access.
void FLASH_Lock (void)
 Locks the FLASH control register access.
FLASH_Status FLASH_ErasePage (uint32_t Page_Address)
 Erases a specified page in program memory.
FLASH_Status FLASH_EraseAllPages (void)
 Erases all FLASH pages.
FLASH_Status FLASH_ProgramWord (uint32_t Address, uint32_t Data)
 Programs a word at a specified address.
FLASH_Status FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word at a specified address.
void FLASH_OB_Unlock (void)
 Unlocks the option bytes block access.
void FLASH_OB_Lock (void)
 Locks the option bytes block access.
void FLASH_OB_Launch (void)
 Launch the option byte loading.
FLASH_Status FLASH_OB_Erase (void)
 Erases the FLASH option bytes.
FLASH_Status FLASH_OB_EnableWRP (uint32_t OB_WRP)
 Write protects the desired pages.
FLASH_Status FLASH_OB_RDPConfig (uint8_t OB_RDP)
 Enables or disables the read out protection.
FLASH_Status 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.
FLASH_Status FLASH_OB_BOOTConfig (uint8_t OB_BOOT1)
 Sets or resets the BOOT1.
FLASH_Status FLASH_OB_VDDAConfig (uint8_t OB_VDDA_ANALOG)
 Sets or resets the analogue monitoring on VDDA Power source.
FLASH_Status FLASH_OB_SRAMParityConfig (uint8_t OB_SRAM_Parity)
 Sets or resets the SRAM parity.
FLASH_Status FLASH_OB_WriteUser (uint8_t OB_USER)
 Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY/ BOOT1 and OB_VDDA_ANALOG.
FLASH_Status FLASH_ProgramOptionByteData (uint32_t Address, uint8_t Data)
 Programs a half word at a specified Option Byte Data address.
uint8_t FLASH_OB_GetUser (void)
 Returns the FLASH User Option Bytes values.
uint32_t FLASH_OB_GetWRP (void)
 Returns the FLASH Write Protection Option Bytes value.
FlagStatus FLASH_OB_GetRDP (void)
 Checks whether the FLASH Read out Protection Status is set or not.
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_WaitForLastOperation (uint32_t Timeout)
 Waits for a FLASH operation to complete or a TIMEOUT to occur.

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.2.3
Date:
10-July-2015
  
 ===============================================================================
                      ##### How to use this driver #####
 ===============================================================================
    [..] This driver provides functions to configure and program the FLASH 
         memory of all STM32F30x devices. These functions are split in 4 groups:
         (#) FLASH Interface configuration functions: this group includes the
             management of following features:
             (++) Set the latency.
             (++) Enable/Disable the Half Cycle Access.
             (++) Enable/Disable the prefetch buffer.
         (#) 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 page, erase all pages.
             (++) Program functions: Half Word and Word write.
         (#) FLASH Option Bytes Programming functions: this group includes all 
             needed functions to manage the Option Bytes:
             (++) Lock and Unlock the Flash Option bytes.
             (++) Launch the Option Bytes loader
             (++) Erase the Option Bytes
             (++) Set/Reset the write protection
             (++) Set the Read protection Level
             (++) Program the user option Bytes
             (++) Set/Reset the BOOT1 bit
             (++) Enable/Disable the VDDA Analog Monitoring
             (++) Enable/Disable the SRAM parity
             (++) Get the user option bytes
             (++) Get the Write protection
             (++) Get the read protection status
         (#) FLASH 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 2015 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 stm32f30x_flash.c.