STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f37x_flash.c File Reference

This file provides firmware functions to manage the following functionalities of the FLASH peripheral: More...

#include "stm32f37x_flash.h"

Functions

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

Detailed Description

This file provides firmware functions to manage the following functionalities of the FLASH peripheral:

Author
MCD Application Team
Version
V1.0.0
Date
20-September-2012
  • FLASH Interface configuration
  • FLASH Memory Programming
  • Option Bytes Programming
  • Interrupts and flags management
===============================================================================
                   ##### How to use this driver #####
===============================================================================
   [..] This driver provides functions to configure and program the Flash 
        memory of all STM32F37x 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:
            (++) 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 VDD_SD12 Analog Monitoring
            (++) Get the user option bytes
            (++) Get the Write protection
            (++) Get the read protection status

        (#) FLASH Interrupts and flag 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 2012 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.