mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_flash_ex.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of FLASH HAL Extension module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_FLASH_EX_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_FLASH_EX_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_hal_def.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup FLASHEx
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported types ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58 /** @defgroup FLASHEx_Exported_Types FLASH Exported Types
mbed_official 573:ad23fe03a082 59 * @{
mbed_official 573:ad23fe03a082 60 */
mbed_official 573:ad23fe03a082 61
mbed_official 573:ad23fe03a082 62 /**
mbed_official 573:ad23fe03a082 63 * @brief FLASH Erase structure definition
mbed_official 573:ad23fe03a082 64 */
mbed_official 573:ad23fe03a082 65 typedef struct
mbed_official 573:ad23fe03a082 66 {
mbed_official 573:ad23fe03a082 67 uint32_t TypeErase; /*!< Mass erase or sector Erase.
mbed_official 573:ad23fe03a082 68 This parameter can be a value of @ref FLASHEx_Type_Erase */
mbed_official 573:ad23fe03a082 69
mbed_official 573:ad23fe03a082 70 uint32_t Sector; /*!< Initial FLASH sector to erase when Mass erase is disabled
mbed_official 573:ad23fe03a082 71 This parameter must be a value of @ref FLASHEx_Sectors */
mbed_official 573:ad23fe03a082 72
mbed_official 573:ad23fe03a082 73 uint32_t NbSectors; /*!< Number of sectors to be erased.
mbed_official 573:ad23fe03a082 74 This parameter must be a value between 1 and (max number of sectors - value of Initial sector)*/
mbed_official 573:ad23fe03a082 75
mbed_official 573:ad23fe03a082 76 uint32_t VoltageRange;/*!< The device voltage range which defines the erase parallelism
mbed_official 573:ad23fe03a082 77 This parameter must be a value of @ref FLASHEx_Voltage_Range */
mbed_official 573:ad23fe03a082 78
mbed_official 573:ad23fe03a082 79 } FLASH_EraseInitTypeDef;
mbed_official 573:ad23fe03a082 80
mbed_official 573:ad23fe03a082 81 /**
mbed_official 573:ad23fe03a082 82 * @brief FLASH Option Bytes Program structure definition
mbed_official 573:ad23fe03a082 83 */
mbed_official 573:ad23fe03a082 84 typedef struct
mbed_official 573:ad23fe03a082 85 {
mbed_official 573:ad23fe03a082 86 uint32_t OptionType; /*!< Option byte to be configured.
mbed_official 573:ad23fe03a082 87 This parameter can be a value of @ref FLASHEx_Option_Type */
mbed_official 573:ad23fe03a082 88
mbed_official 573:ad23fe03a082 89 uint32_t WRPState; /*!< Write protection activation or deactivation.
mbed_official 573:ad23fe03a082 90 This parameter can be a value of @ref FLASHEx_WRP_State */
mbed_official 573:ad23fe03a082 91
mbed_official 573:ad23fe03a082 92 uint32_t WRPSector; /*!< Specifies the sector(s) to be write protected.
mbed_official 573:ad23fe03a082 93 The value of this parameter depend on device used within the same series */
mbed_official 573:ad23fe03a082 94
mbed_official 573:ad23fe03a082 95 uint32_t RDPLevel; /*!< Set the read protection level.
mbed_official 573:ad23fe03a082 96 This parameter can be a value of @ref FLASHEx_Option_Bytes_Read_Protection */
mbed_official 573:ad23fe03a082 97
mbed_official 573:ad23fe03a082 98 uint32_t BORLevel; /*!< Set the BOR Level.
mbed_official 573:ad23fe03a082 99 This parameter can be a value of @ref FLASHEx_BOR_Reset_Level */
mbed_official 573:ad23fe03a082 100
mbed_official 573:ad23fe03a082 101 uint32_t USERConfig; /*!< Program the FLASH User Option Byte: WWDG_SW / IWDG_SW / RST_STOP / RST_STDBY /
mbed_official 573:ad23fe03a082 102 IWDG_FREEZE_STOP / IWDG_FREEZE_SANDBY. */
mbed_official 573:ad23fe03a082 103
mbed_official 573:ad23fe03a082 104 uint32_t BootAddr0; /*!< Boot base address when Boot pin = 0.
mbed_official 573:ad23fe03a082 105 This parameter can be a value of @ref FLASHEx_Boot_Address */
mbed_official 573:ad23fe03a082 106
mbed_official 573:ad23fe03a082 107 uint32_t BootAddr1; /*!< Boot base address when Boot pin = 1.
mbed_official 573:ad23fe03a082 108 This parameter can be a value of @ref FLASHEx_Boot_Address */
mbed_official 573:ad23fe03a082 109
mbed_official 573:ad23fe03a082 110 } FLASH_OBProgramInitTypeDef;
mbed_official 573:ad23fe03a082 111
mbed_official 573:ad23fe03a082 112 /**
mbed_official 573:ad23fe03a082 113 * @}
mbed_official 573:ad23fe03a082 114 */
mbed_official 573:ad23fe03a082 115 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 116
mbed_official 573:ad23fe03a082 117 /** @defgroup FLASHEx_Exported_Constants FLASH Exported Constants
mbed_official 573:ad23fe03a082 118 * @{
mbed_official 573:ad23fe03a082 119 */
mbed_official 573:ad23fe03a082 120
mbed_official 573:ad23fe03a082 121 /** @defgroup FLASHEx_Type_Erase FLASH Type Erase
mbed_official 573:ad23fe03a082 122 * @{
mbed_official 573:ad23fe03a082 123 */
mbed_official 573:ad23fe03a082 124 #define FLASH_TYPEERASE_SECTORS ((uint32_t)0x00) /*!< Sectors erase only */
mbed_official 573:ad23fe03a082 125 #define FLASH_TYPEERASE_MASSERASE ((uint32_t)0x01) /*!< Flash Mass erase activation */
mbed_official 573:ad23fe03a082 126 /**
mbed_official 573:ad23fe03a082 127 * @}
mbed_official 573:ad23fe03a082 128 */
mbed_official 573:ad23fe03a082 129
mbed_official 573:ad23fe03a082 130 /** @defgroup FLASHEx_Voltage_Range FLASH Voltage Range
mbed_official 573:ad23fe03a082 131 * @{
mbed_official 573:ad23fe03a082 132 */
mbed_official 573:ad23fe03a082 133 #define FLASH_VOLTAGE_RANGE_1 ((uint32_t)0x00) /*!< Device operating range: 1.8V to 2.1V */
mbed_official 573:ad23fe03a082 134 #define FLASH_VOLTAGE_RANGE_2 ((uint32_t)0x01) /*!< Device operating range: 2.1V to 2.7V */
mbed_official 573:ad23fe03a082 135 #define FLASH_VOLTAGE_RANGE_3 ((uint32_t)0x02) /*!< Device operating range: 2.7V to 3.6V */
mbed_official 573:ad23fe03a082 136 #define FLASH_VOLTAGE_RANGE_4 ((uint32_t)0x03) /*!< Device operating range: 2.7V to 3.6V + External Vpp */
mbed_official 573:ad23fe03a082 137 /**
mbed_official 573:ad23fe03a082 138 * @}
mbed_official 573:ad23fe03a082 139 */
mbed_official 573:ad23fe03a082 140
mbed_official 573:ad23fe03a082 141 /** @defgroup FLASHEx_WRP_State FLASH WRP State
mbed_official 573:ad23fe03a082 142 * @{
mbed_official 573:ad23fe03a082 143 */
mbed_official 573:ad23fe03a082 144 #define OB_WRPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable the write protection of the desired bank 1 sectors */
mbed_official 573:ad23fe03a082 145 #define OB_WRPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable the write protection of the desired bank 1 sectors */
mbed_official 573:ad23fe03a082 146 /**
mbed_official 573:ad23fe03a082 147 * @}
mbed_official 573:ad23fe03a082 148 */
mbed_official 573:ad23fe03a082 149
mbed_official 573:ad23fe03a082 150 /** @defgroup FLASHEx_Option_Type FLASH Option Type
mbed_official 573:ad23fe03a082 151 * @{
mbed_official 573:ad23fe03a082 152 */
mbed_official 573:ad23fe03a082 153 #define OPTIONBYTE_WRP ((uint32_t)0x01) /*!< WRP option byte configuration */
mbed_official 573:ad23fe03a082 154 #define OPTIONBYTE_RDP ((uint32_t)0x02) /*!< RDP option byte configuration */
mbed_official 573:ad23fe03a082 155 #define OPTIONBYTE_USER ((uint32_t)0x04) /*!< USER option byte configuration */
mbed_official 573:ad23fe03a082 156 #define OPTIONBYTE_BOR ((uint32_t)0x08) /*!< BOR option byte configuration */
mbed_official 573:ad23fe03a082 157 #define OPTIONBYTE_BOOTADDR_0 ((uint32_t)0x10) /*!< Boot 0 Address configuration */
mbed_official 573:ad23fe03a082 158 #define OPTIONBYTE_BOOTADDR_1 ((uint32_t)0x20) /*!< Boot 1 Address configuration */
mbed_official 573:ad23fe03a082 159 /**
mbed_official 573:ad23fe03a082 160 * @}
mbed_official 573:ad23fe03a082 161 */
mbed_official 573:ad23fe03a082 162
mbed_official 573:ad23fe03a082 163 /** @defgroup FLASHEx_Option_Bytes_Read_Protection FLASH Option Bytes Read Protection
mbed_official 573:ad23fe03a082 164 * @{
mbed_official 573:ad23fe03a082 165 */
mbed_official 610:813dcc80987e 166 #define OB_RDP_LEVEL_0 ((uint8_t)0xAA)
mbed_official 610:813dcc80987e 167 #define OB_RDP_LEVEL_1 ((uint8_t)0x55)
mbed_official 610:813dcc80987e 168 #define OB_RDP_LEVEL_2 ((uint8_t)0xCC) /*!< Warning: When enabling read protection level 2
mbed_official 573:ad23fe03a082 169 it s no more possible to go back to level 1 or 0 */
mbed_official 573:ad23fe03a082 170 /**
mbed_official 573:ad23fe03a082 171 * @}
mbed_official 573:ad23fe03a082 172 */
mbed_official 573:ad23fe03a082 173
mbed_official 573:ad23fe03a082 174 /** @defgroup FLASHEx_Option_Bytes_WWatchdog FLASH Option Bytes WWatchdog
mbed_official 573:ad23fe03a082 175 * @{
mbed_official 573:ad23fe03a082 176 */
mbed_official 573:ad23fe03a082 177 #define OB_WWDG_SW ((uint32_t)0x10) /*!< Software WWDG selected */
mbed_official 573:ad23fe03a082 178 #define OB_WWDG_HW ((uint32_t)0x00) /*!< Hardware WWDG selected */
mbed_official 573:ad23fe03a082 179 /**
mbed_official 573:ad23fe03a082 180 * @}
mbed_official 573:ad23fe03a082 181 */
mbed_official 573:ad23fe03a082 182
mbed_official 573:ad23fe03a082 183
mbed_official 573:ad23fe03a082 184 /** @defgroup FLASHEx_Option_Bytes_IWatchdog FLASH Option Bytes IWatchdog
mbed_official 573:ad23fe03a082 185 * @{
mbed_official 573:ad23fe03a082 186 */
mbed_official 573:ad23fe03a082 187 #define OB_IWDG_SW ((uint32_t)0x20) /*!< Software IWDG selected */
mbed_official 573:ad23fe03a082 188 #define OB_IWDG_HW ((uint32_t)0x00) /*!< Hardware IWDG selected */
mbed_official 573:ad23fe03a082 189 /**
mbed_official 573:ad23fe03a082 190 * @}
mbed_official 573:ad23fe03a082 191 */
mbed_official 573:ad23fe03a082 192
mbed_official 573:ad23fe03a082 193 /** @defgroup FLASHEx_Option_Bytes_nRST_STOP FLASH Option Bytes nRST_STOP
mbed_official 573:ad23fe03a082 194 * @{
mbed_official 573:ad23fe03a082 195 */
mbed_official 573:ad23fe03a082 196 #define OB_STOP_NO_RST ((uint32_t)0x40) /*!< No reset generated when entering in STOP */
mbed_official 573:ad23fe03a082 197 #define OB_STOP_RST ((uint32_t)0x00) /*!< Reset generated when entering in STOP */
mbed_official 573:ad23fe03a082 198 /**
mbed_official 573:ad23fe03a082 199 * @}
mbed_official 573:ad23fe03a082 200 */
mbed_official 573:ad23fe03a082 201
mbed_official 573:ad23fe03a082 202 /** @defgroup FLASHEx_Option_Bytes_nRST_STDBY FLASH Option Bytes nRST_STDBY
mbed_official 573:ad23fe03a082 203 * @{
mbed_official 573:ad23fe03a082 204 */
mbed_official 573:ad23fe03a082 205 #define OB_STDBY_NO_RST ((uint32_t)0x80) /*!< No reset generated when entering in STANDBY */
mbed_official 573:ad23fe03a082 206 #define OB_STDBY_RST ((uint32_t)0x00) /*!< Reset generated when entering in STANDBY */
mbed_official 573:ad23fe03a082 207 /**
mbed_official 573:ad23fe03a082 208 * @}
mbed_official 573:ad23fe03a082 209 */
mbed_official 573:ad23fe03a082 210
mbed_official 573:ad23fe03a082 211 /** @defgroup FLASHEx_Option_Bytes_IWDG_FREEZE_STOP FLASH IWDG Counter Freeze in STOP
mbed_official 573:ad23fe03a082 212 * @{
mbed_official 573:ad23fe03a082 213 */
mbed_official 573:ad23fe03a082 214 #define OB_IWDG_STOP_FREEZE ((uint32_t)0x00000000) /*!< Freeze IWDG counter in STOP mode */
mbed_official 573:ad23fe03a082 215 #define OB_IWDG_STOP_ACTIVE ((uint32_t)0x40000000) /*!< IWDG counter active in STOP mode */
mbed_official 573:ad23fe03a082 216 /**
mbed_official 573:ad23fe03a082 217 * @}
mbed_official 573:ad23fe03a082 218 */
mbed_official 573:ad23fe03a082 219
mbed_official 573:ad23fe03a082 220 /** @defgroup FLASHEx_Option_Bytes_IWDG_FREEZE_SANDBY FLASH IWDG Counter Freeze in STANDBY
mbed_official 573:ad23fe03a082 221 * @{
mbed_official 573:ad23fe03a082 222 */
mbed_official 573:ad23fe03a082 223 #define OB_IWDG_STDBY_FREEZE ((uint32_t)0x00000000) /*!< Freeze IWDG counter in STANDBY mode */
mbed_official 573:ad23fe03a082 224 #define OB_IWDG_STDBY_ACTIVE ((uint32_t)0x40000000) /*!< IWDG counter active in STANDBY mode */
mbed_official 573:ad23fe03a082 225 /**
mbed_official 573:ad23fe03a082 226 * @}
mbed_official 573:ad23fe03a082 227 */
mbed_official 573:ad23fe03a082 228
mbed_official 573:ad23fe03a082 229 /** @defgroup FLASHEx_BOR_Reset_Level FLASH BOR Reset Level
mbed_official 573:ad23fe03a082 230 * @{
mbed_official 573:ad23fe03a082 231 */
mbed_official 573:ad23fe03a082 232 #define OB_BOR_LEVEL3 ((uint32_t)0x00) /*!< Supply voltage ranges from 2.70 to 3.60 V */
mbed_official 573:ad23fe03a082 233 #define OB_BOR_LEVEL2 ((uint32_t)0x04) /*!< Supply voltage ranges from 2.40 to 2.70 V */
mbed_official 573:ad23fe03a082 234 #define OB_BOR_LEVEL1 ((uint32_t)0x08) /*!< Supply voltage ranges from 2.10 to 2.40 V */
mbed_official 573:ad23fe03a082 235 #define OB_BOR_OFF ((uint32_t)0x0C) /*!< Supply voltage ranges from 1.62 to 2.10 V */
mbed_official 573:ad23fe03a082 236
mbed_official 573:ad23fe03a082 237 /**
mbed_official 573:ad23fe03a082 238 * @}
mbed_official 573:ad23fe03a082 239 */
mbed_official 573:ad23fe03a082 240
mbed_official 573:ad23fe03a082 241 /** @defgroup FLASHEx_Boot_Address FLASH Boot Address
mbed_official 573:ad23fe03a082 242 * @{
mbed_official 573:ad23fe03a082 243 */
mbed_official 573:ad23fe03a082 244 #define OB_BOOTADDR_ITCM_RAM ((uint32_t)0x0000) /*!< Boot from ITCM RAM (0x00000000) */
mbed_official 573:ad23fe03a082 245 #define OB_BOOTADDR_SYSTEM ((uint32_t)0x0040) /*!< Boot from System memory bootloader (0x00100000) */
mbed_official 573:ad23fe03a082 246 #define OB_BOOTADDR_ITCM_FLASH ((uint32_t)0x0080) /*!< Boot from Flash on ITCM interface (0x00200000) */
mbed_official 573:ad23fe03a082 247 #define OB_BOOTADDR_AXIM_FLASH ((uint32_t)0x2000) /*!< Boot from Flash on AXIM interface (0x08000000) */
mbed_official 573:ad23fe03a082 248 #define OB_BOOTADDR_DTCM_RAM ((uint32_t)0x8000) /*!< Boot from DTCM RAM (0x20000000) */
mbed_official 573:ad23fe03a082 249 #define OB_BOOTADDR_SRAM1 ((uint32_t)0x8004) /*!< Boot from SRAM1 (0x20010000) */
mbed_official 573:ad23fe03a082 250 #define OB_BOOTADDR_SRAM2 ((uint32_t)0x8013) /*!< Boot from SRAM2 (0x2004C000) */
mbed_official 573:ad23fe03a082 251
mbed_official 573:ad23fe03a082 252 /**
mbed_official 573:ad23fe03a082 253 * @}
mbed_official 573:ad23fe03a082 254 */
mbed_official 573:ad23fe03a082 255
mbed_official 573:ad23fe03a082 256 /** @defgroup FLASH_Latency FLASH Latency
mbed_official 573:ad23fe03a082 257 * @{
mbed_official 573:ad23fe03a082 258 */
mbed_official 573:ad23fe03a082 259 #define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero Latency cycle */
mbed_official 573:ad23fe03a082 260 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One Latency cycle */
mbed_official 573:ad23fe03a082 261 #define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two Latency cycles */
mbed_official 573:ad23fe03a082 262 #define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three Latency cycles */
mbed_official 573:ad23fe03a082 263 #define FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four Latency cycles */
mbed_official 573:ad23fe03a082 264 #define FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH Five Latency cycles */
mbed_official 573:ad23fe03a082 265 #define FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH Six Latency cycles */
mbed_official 573:ad23fe03a082 266 #define FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH Seven Latency cycles */
mbed_official 573:ad23fe03a082 267 #define FLASH_LATENCY_8 FLASH_ACR_LATENCY_8WS /*!< FLASH Eight Latency cycles */
mbed_official 573:ad23fe03a082 268 #define FLASH_LATENCY_9 FLASH_ACR_LATENCY_9WS /*!< FLASH Nine Latency cycles */
mbed_official 573:ad23fe03a082 269 #define FLASH_LATENCY_10 FLASH_ACR_LATENCY_10WS /*!< FLASH Ten Latency cycles */
mbed_official 573:ad23fe03a082 270 #define FLASH_LATENCY_11 FLASH_ACR_LATENCY_11WS /*!< FLASH Eleven Latency cycles */
mbed_official 573:ad23fe03a082 271 #define FLASH_LATENCY_12 FLASH_ACR_LATENCY_12WS /*!< FLASH Twelve Latency cycles */
mbed_official 573:ad23fe03a082 272 #define FLASH_LATENCY_13 FLASH_ACR_LATENCY_13WS /*!< FLASH Thirteen Latency cycles */
mbed_official 573:ad23fe03a082 273 #define FLASH_LATENCY_14 FLASH_ACR_LATENCY_14WS /*!< FLASH Fourteen Latency cycles */
mbed_official 573:ad23fe03a082 274 #define FLASH_LATENCY_15 FLASH_ACR_LATENCY_15WS /*!< FLASH Fifteen Latency cycles */
mbed_official 573:ad23fe03a082 275 /**
mbed_official 573:ad23fe03a082 276 * @}
mbed_official 573:ad23fe03a082 277 */
mbed_official 573:ad23fe03a082 278
mbed_official 573:ad23fe03a082 279 /** @defgroup FLASHEx_MassErase_bit FLASH Mass Erase bit
mbed_official 573:ad23fe03a082 280 * @{
mbed_official 573:ad23fe03a082 281 */
mbed_official 573:ad23fe03a082 282 #define FLASH_MER_BIT (FLASH_CR_MER) /*!< MER bit to clear */
mbed_official 573:ad23fe03a082 283 /**
mbed_official 573:ad23fe03a082 284 * @}
mbed_official 573:ad23fe03a082 285 */
mbed_official 573:ad23fe03a082 286
mbed_official 573:ad23fe03a082 287 /** @defgroup FLASHEx_Sectors FLASH Sectors
mbed_official 573:ad23fe03a082 288 * @{
mbed_official 573:ad23fe03a082 289 */
mbed_official 573:ad23fe03a082 290 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
mbed_official 573:ad23fe03a082 291 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
mbed_official 573:ad23fe03a082 292 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
mbed_official 573:ad23fe03a082 293 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
mbed_official 573:ad23fe03a082 294 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
mbed_official 573:ad23fe03a082 295 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
mbed_official 573:ad23fe03a082 296 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
mbed_official 573:ad23fe03a082 297 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
mbed_official 573:ad23fe03a082 298
mbed_official 573:ad23fe03a082 299 /**
mbed_official 573:ad23fe03a082 300 * @}
mbed_official 573:ad23fe03a082 301 */
mbed_official 573:ad23fe03a082 302
mbed_official 573:ad23fe03a082 303 /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write Protection
mbed_official 573:ad23fe03a082 304 * @{
mbed_official 573:ad23fe03a082 305 */
mbed_official 573:ad23fe03a082 306 #define OB_WRP_SECTOR_0 ((uint32_t)0x00010000) /*!< Write protection of Sector0 */
mbed_official 573:ad23fe03a082 307 #define OB_WRP_SECTOR_1 ((uint32_t)0x00020000) /*!< Write protection of Sector1 */
mbed_official 573:ad23fe03a082 308 #define OB_WRP_SECTOR_2 ((uint32_t)0x00040000) /*!< Write protection of Sector2 */
mbed_official 573:ad23fe03a082 309 #define OB_WRP_SECTOR_3 ((uint32_t)0x00080000) /*!< Write protection of Sector3 */
mbed_official 573:ad23fe03a082 310 #define OB_WRP_SECTOR_4 ((uint32_t)0x00100000) /*!< Write protection of Sector4 */
mbed_official 573:ad23fe03a082 311 #define OB_WRP_SECTOR_5 ((uint32_t)0x00200000) /*!< Write protection of Sector5 */
mbed_official 573:ad23fe03a082 312 #define OB_WRP_SECTOR_6 ((uint32_t)0x00400000) /*!< Write protection of Sector6 */
mbed_official 573:ad23fe03a082 313 #define OB_WRP_SECTOR_7 ((uint32_t)0x00800000) /*!< Write protection of Sector7 */
mbed_official 573:ad23fe03a082 314 #define OB_WRP_SECTOR_All ((uint32_t)0x00FF0000) /*!< Write protection of all Sectors */
mbed_official 573:ad23fe03a082 315
mbed_official 573:ad23fe03a082 316
mbed_official 573:ad23fe03a082 317
mbed_official 573:ad23fe03a082 318 /**
mbed_official 573:ad23fe03a082 319 * @}
mbed_official 573:ad23fe03a082 320 */
mbed_official 573:ad23fe03a082 321
mbed_official 573:ad23fe03a082 322 /**
mbed_official 573:ad23fe03a082 323 * @}
mbed_official 573:ad23fe03a082 324 */
mbed_official 573:ad23fe03a082 325
mbed_official 573:ad23fe03a082 326 /* Exported macro ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 327 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 328 /** @addtogroup FLASHEx_Exported_Functions
mbed_official 573:ad23fe03a082 329 * @{
mbed_official 573:ad23fe03a082 330 */
mbed_official 573:ad23fe03a082 331
mbed_official 573:ad23fe03a082 332 /** @addtogroup FLASHEx_Exported_Functions_Group1
mbed_official 573:ad23fe03a082 333 * @{
mbed_official 573:ad23fe03a082 334 */
mbed_official 573:ad23fe03a082 335 /* Extension Program operation functions *************************************/
mbed_official 573:ad23fe03a082 336 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError);
mbed_official 573:ad23fe03a082 337 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
mbed_official 573:ad23fe03a082 338 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
mbed_official 573:ad23fe03a082 339 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
mbed_official 573:ad23fe03a082 340
mbed_official 573:ad23fe03a082 341 /**
mbed_official 573:ad23fe03a082 342 * @}
mbed_official 573:ad23fe03a082 343 */
mbed_official 573:ad23fe03a082 344
mbed_official 573:ad23fe03a082 345 /**
mbed_official 573:ad23fe03a082 346 * @}
mbed_official 573:ad23fe03a082 347 */
mbed_official 573:ad23fe03a082 348 /* Private types -------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 349 /* Private variables ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 350 /* Private constants ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 351 /** @defgroup FLASHEx_Private_Constants FLASH Private Constants
mbed_official 573:ad23fe03a082 352 * @{
mbed_official 573:ad23fe03a082 353 */
mbed_official 573:ad23fe03a082 354 #define FLASH_SECTOR_TOTAL 8
mbed_official 573:ad23fe03a082 355 /**
mbed_official 573:ad23fe03a082 356 * @}
mbed_official 573:ad23fe03a082 357 */
mbed_official 573:ad23fe03a082 358
mbed_official 573:ad23fe03a082 359 /* Private macros ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 360 /** @defgroup FLASHEx_Private_Macros FLASH Private Macros
mbed_official 573:ad23fe03a082 361 * @{
mbed_official 573:ad23fe03a082 362 */
mbed_official 573:ad23fe03a082 363
mbed_official 573:ad23fe03a082 364 /** @defgroup FLASHEx_IS_FLASH_Definitions FLASH Private macros to check input parameters
mbed_official 573:ad23fe03a082 365 * @{
mbed_official 573:ad23fe03a082 366 */
mbed_official 573:ad23fe03a082 367
mbed_official 573:ad23fe03a082 368 #define IS_FLASH_TYPEERASE(VALUE)(((VALUE) == FLASH_TYPEERASE_SECTORS) || \
mbed_official 573:ad23fe03a082 369 ((VALUE) == FLASH_TYPEERASE_MASSERASE))
mbed_official 573:ad23fe03a082 370
mbed_official 573:ad23fe03a082 371 #define IS_VOLTAGERANGE(RANGE)(((RANGE) == FLASH_VOLTAGE_RANGE_1) || \
mbed_official 573:ad23fe03a082 372 ((RANGE) == FLASH_VOLTAGE_RANGE_2) || \
mbed_official 573:ad23fe03a082 373 ((RANGE) == FLASH_VOLTAGE_RANGE_3) || \
mbed_official 573:ad23fe03a082 374 ((RANGE) == FLASH_VOLTAGE_RANGE_4))
mbed_official 573:ad23fe03a082 375
mbed_official 573:ad23fe03a082 376 #define IS_WRPSTATE(VALUE)(((VALUE) == OB_WRPSTATE_DISABLE) || \
mbed_official 573:ad23fe03a082 377 ((VALUE) == OB_WRPSTATE_ENABLE))
mbed_official 573:ad23fe03a082 378
mbed_official 573:ad23fe03a082 379 #define IS_OPTIONBYTE(VALUE)(((VALUE) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER |\
mbed_official 573:ad23fe03a082 380 OPTIONBYTE_BOR | OPTIONBYTE_BOOTADDR_0 | OPTIONBYTE_BOOTADDR_1)))
mbed_official 573:ad23fe03a082 381
mbed_official 573:ad23fe03a082 382 #define IS_OB_BOOT_ADDRESS(ADDRESS) (((ADDRESS) == OB_BOOTADDR_ITCM_RAM) || \
mbed_official 573:ad23fe03a082 383 ((ADDRESS) == OB_BOOTADDR_SYSTEM) || \
mbed_official 573:ad23fe03a082 384 ((ADDRESS) == OB_BOOTADDR_ITCM_FLASH) || \
mbed_official 573:ad23fe03a082 385 ((ADDRESS) == OB_BOOTADDR_AXIM_FLASH) || \
mbed_official 573:ad23fe03a082 386 ((ADDRESS) == OB_BOOTADDR_DTCM_RAM) || \
mbed_official 573:ad23fe03a082 387 ((ADDRESS) == OB_BOOTADDR_SRAM1) || \
mbed_official 573:ad23fe03a082 388 ((ADDRESS) == OB_BOOTADDR_SRAM2))
mbed_official 573:ad23fe03a082 389
mbed_official 573:ad23fe03a082 390 #define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\
mbed_official 610:813dcc80987e 391 ((LEVEL) == OB_RDP_LEVEL_1) ||\
mbed_official 610:813dcc80987e 392 ((LEVEL) == OB_RDP_LEVEL_2))
mbed_official 573:ad23fe03a082 393
mbed_official 573:ad23fe03a082 394 #define IS_OB_WWDG_SOURCE(SOURCE) (((SOURCE) == OB_WWDG_SW) || ((SOURCE) == OB_WWDG_HW))
mbed_official 573:ad23fe03a082 395
mbed_official 573:ad23fe03a082 396 #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
mbed_official 573:ad23fe03a082 397
mbed_official 573:ad23fe03a082 398 #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
mbed_official 573:ad23fe03a082 399
mbed_official 573:ad23fe03a082 400 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
mbed_official 573:ad23fe03a082 401
mbed_official 573:ad23fe03a082 402 #define IS_OB_IWDG_STOP_FREEZE(FREEZE) (((FREEZE) == OB_IWDG_STOP_FREEZE) || ((FREEZE) == OB_IWDG_STOP_ACTIVE))
mbed_official 573:ad23fe03a082 403
mbed_official 573:ad23fe03a082 404 #define IS_OB_IWDG_STDBY_FREEZE(FREEZE) (((FREEZE) == OB_IWDG_STDBY_FREEZE) || ((FREEZE) == OB_IWDG_STDBY_ACTIVE))
mbed_official 573:ad23fe03a082 405
mbed_official 573:ad23fe03a082 406 #define IS_OB_BOR_LEVEL(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\
mbed_official 573:ad23fe03a082 407 ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF))
mbed_official 573:ad23fe03a082 408
mbed_official 573:ad23fe03a082 409 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \
mbed_official 573:ad23fe03a082 410 ((LATENCY) == FLASH_LATENCY_1) || \
mbed_official 573:ad23fe03a082 411 ((LATENCY) == FLASH_LATENCY_2) || \
mbed_official 573:ad23fe03a082 412 ((LATENCY) == FLASH_LATENCY_3) || \
mbed_official 573:ad23fe03a082 413 ((LATENCY) == FLASH_LATENCY_4) || \
mbed_official 573:ad23fe03a082 414 ((LATENCY) == FLASH_LATENCY_5) || \
mbed_official 573:ad23fe03a082 415 ((LATENCY) == FLASH_LATENCY_6) || \
mbed_official 573:ad23fe03a082 416 ((LATENCY) == FLASH_LATENCY_7) || \
mbed_official 573:ad23fe03a082 417 ((LATENCY) == FLASH_LATENCY_8) || \
mbed_official 573:ad23fe03a082 418 ((LATENCY) == FLASH_LATENCY_9) || \
mbed_official 573:ad23fe03a082 419 ((LATENCY) == FLASH_LATENCY_10) || \
mbed_official 573:ad23fe03a082 420 ((LATENCY) == FLASH_LATENCY_11) || \
mbed_official 573:ad23fe03a082 421 ((LATENCY) == FLASH_LATENCY_12) || \
mbed_official 573:ad23fe03a082 422 ((LATENCY) == FLASH_LATENCY_13) || \
mbed_official 573:ad23fe03a082 423 ((LATENCY) == FLASH_LATENCY_14) || \
mbed_official 573:ad23fe03a082 424 ((LATENCY) == FLASH_LATENCY_15))
mbed_official 573:ad23fe03a082 425
mbed_official 573:ad23fe03a082 426 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
mbed_official 573:ad23fe03a082 427 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
mbed_official 573:ad23fe03a082 428 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
mbed_official 573:ad23fe03a082 429 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7))
mbed_official 573:ad23fe03a082 430
mbed_official 573:ad23fe03a082 431
mbed_official 573:ad23fe03a082 432 #define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= FLASH_END))
mbed_official 573:ad23fe03a082 433
mbed_official 573:ad23fe03a082 434 #define IS_FLASH_NBSECTORS(NBSECTORS) (((NBSECTORS) != 0) && ((NBSECTORS) <= FLASH_SECTOR_TOTAL))
mbed_official 573:ad23fe03a082 435
mbed_official 573:ad23fe03a082 436 #define IS_OB_WRP_SECTOR(SECTOR) ((((SECTOR) & (uint32_t)0xFF00FFFF) == 0x00000000) && ((SECTOR) != 0x00000000))
mbed_official 573:ad23fe03a082 437 /**
mbed_official 573:ad23fe03a082 438 * @}
mbed_official 573:ad23fe03a082 439 */
mbed_official 573:ad23fe03a082 440
mbed_official 573:ad23fe03a082 441 /**
mbed_official 573:ad23fe03a082 442 * @}
mbed_official 573:ad23fe03a082 443 */
mbed_official 573:ad23fe03a082 444
mbed_official 573:ad23fe03a082 445 /* Private functions ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 446 /** @defgroup FLASHEx_Private_Functions FLASH Private Functions
mbed_official 573:ad23fe03a082 447 * @{
mbed_official 573:ad23fe03a082 448 */
mbed_official 573:ad23fe03a082 449 void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange);
mbed_official 573:ad23fe03a082 450 /**
mbed_official 573:ad23fe03a082 451 * @}
mbed_official 573:ad23fe03a082 452 */
mbed_official 573:ad23fe03a082 453
mbed_official 573:ad23fe03a082 454 /**
mbed_official 573:ad23fe03a082 455 * @}
mbed_official 573:ad23fe03a082 456 */
mbed_official 573:ad23fe03a082 457
mbed_official 573:ad23fe03a082 458 /**
mbed_official 573:ad23fe03a082 459 * @}
mbed_official 573:ad23fe03a082 460 */
mbed_official 573:ad23fe03a082 461
mbed_official 573:ad23fe03a082 462 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 463 }
mbed_official 573:ad23fe03a082 464 #endif
mbed_official 573:ad23fe03a082 465
mbed_official 573:ad23fe03a082 466 #endif /* __STM32F7xx_HAL_FLASH_EX_H */
mbed_official 573:ad23fe03a082 467
mbed_official 573:ad23fe03a082 468 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/