Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 16 15:32:31 2015 +0100
Revision:
107:4f6c30876dfa
Child:
116:c0f6e94411f5
Release 107  of the mbed library

Changes:
- new platforms - DISCO_F746NG, DISCO_L476VG, NUCLEO_L476RG
- KL43Z - bugfix RTC init function
- K20 - SPI mode fix

Who changed what in which revision?

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