Elijah Orr / mbed-renbed

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Jan 13 09:48:29 2016 +0000
Revision:
112:6f327212ef96
Release 112 of the mbed library

Changes:
- new platforms - STM32 B96B F446, MOTE_L152RC
- nrf51 - fix serial init bug (character sent)
- stm all devices - fix RTC clocking in the init
- stm f0 - SystemInit clock fix, for SetVector()
- RawSerial - fix for microlib (vsnprintf with size 0)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32f4xx_hal_flash_ex.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.4.1
Kojto 112:6f327212ef96 6 * @date 09-October-2015
Kojto 112:6f327212ef96 7 * @brief Header file of FLASH HAL Extension module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32F4xx_HAL_FLASH_EX_H
Kojto 112:6f327212ef96 40 #define __STM32F4xx_HAL_FLASH_EX_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 47 #include "stm32f4xx_hal_def.h"
Kojto 112:6f327212ef96 48
Kojto 112:6f327212ef96 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 112:6f327212ef96 50 * @{
Kojto 112:6f327212ef96 51 */
Kojto 112:6f327212ef96 52
Kojto 112:6f327212ef96 53 /** @addtogroup FLASHEx
Kojto 112:6f327212ef96 54 * @{
Kojto 112:6f327212ef96 55 */
Kojto 112:6f327212ef96 56
Kojto 112:6f327212ef96 57 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 58 /** @defgroup FLASHEx_Exported_Types FLASH Exported Types
Kojto 112:6f327212ef96 59 * @{
Kojto 112:6f327212ef96 60 */
Kojto 112:6f327212ef96 61
Kojto 112:6f327212ef96 62 /**
Kojto 112:6f327212ef96 63 * @brief FLASH Erase structure definition
Kojto 112:6f327212ef96 64 */
Kojto 112:6f327212ef96 65 typedef struct
Kojto 112:6f327212ef96 66 {
Kojto 112:6f327212ef96 67 uint32_t TypeErase; /*!< Mass erase or sector Erase.
Kojto 112:6f327212ef96 68 This parameter can be a value of @ref FLASHEx_Type_Erase */
Kojto 112:6f327212ef96 69
Kojto 112:6f327212ef96 70 uint32_t Banks; /*!< Select banks to erase when Mass erase is enabled.
Kojto 112:6f327212ef96 71 This parameter must be a value of @ref FLASHEx_Banks */
Kojto 112:6f327212ef96 72
Kojto 112:6f327212ef96 73 uint32_t Sector; /*!< Initial FLASH sector to erase when Mass erase is disabled
Kojto 112:6f327212ef96 74 This parameter must be a value of @ref FLASHEx_Sectors */
Kojto 112:6f327212ef96 75
Kojto 112:6f327212ef96 76 uint32_t NbSectors; /*!< Number of sectors to be erased.
Kojto 112:6f327212ef96 77 This parameter must be a value between 1 and (max number of sectors - value of Initial sector)*/
Kojto 112:6f327212ef96 78
Kojto 112:6f327212ef96 79 uint32_t VoltageRange;/*!< The device voltage range which defines the erase parallelism
Kojto 112:6f327212ef96 80 This parameter must be a value of @ref FLASHEx_Voltage_Range */
Kojto 112:6f327212ef96 81
Kojto 112:6f327212ef96 82 } FLASH_EraseInitTypeDef;
Kojto 112:6f327212ef96 83
Kojto 112:6f327212ef96 84 /**
Kojto 112:6f327212ef96 85 * @brief FLASH Option Bytes Program structure definition
Kojto 112:6f327212ef96 86 */
Kojto 112:6f327212ef96 87 typedef struct
Kojto 112:6f327212ef96 88 {
Kojto 112:6f327212ef96 89 uint32_t OptionType; /*!< Option byte to be configured.
Kojto 112:6f327212ef96 90 This parameter can be a value of @ref FLASHEx_Option_Type */
Kojto 112:6f327212ef96 91
Kojto 112:6f327212ef96 92 uint32_t WRPState; /*!< Write protection activation or deactivation.
Kojto 112:6f327212ef96 93 This parameter can be a value of @ref FLASHEx_WRP_State */
Kojto 112:6f327212ef96 94
Kojto 112:6f327212ef96 95 uint32_t WRPSector; /*!< Specifies the sector(s) to be write protected.
Kojto 112:6f327212ef96 96 The value of this parameter depend on device used within the same series */
Kojto 112:6f327212ef96 97
Kojto 112:6f327212ef96 98 uint32_t Banks; /*!< Select banks for WRP activation/deactivation of all sectors.
Kojto 112:6f327212ef96 99 This parameter must be a value of @ref FLASHEx_Banks */
Kojto 112:6f327212ef96 100
Kojto 112:6f327212ef96 101 uint32_t RDPLevel; /*!< Set the read protection level.
Kojto 112:6f327212ef96 102 This parameter can be a value of @ref FLASHEx_Option_Bytes_Read_Protection */
Kojto 112:6f327212ef96 103
Kojto 112:6f327212ef96 104 uint32_t BORLevel; /*!< Set the BOR Level.
Kojto 112:6f327212ef96 105 This parameter can be a value of @ref FLASHEx_BOR_Reset_Level */
Kojto 112:6f327212ef96 106
Kojto 112:6f327212ef96 107 uint8_t USERConfig; /*!< Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. */
Kojto 112:6f327212ef96 108
Kojto 112:6f327212ef96 109 } FLASH_OBProgramInitTypeDef;
Kojto 112:6f327212ef96 110
Kojto 112:6f327212ef96 111 /**
Kojto 112:6f327212ef96 112 * @brief FLASH Advanced Option Bytes Program structure definition
Kojto 112:6f327212ef96 113 */
Kojto 112:6f327212ef96 114 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 115 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 116 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 117 defined(STM32F479xx)
Kojto 112:6f327212ef96 118 typedef struct
Kojto 112:6f327212ef96 119 {
Kojto 112:6f327212ef96 120 uint32_t OptionType; /*!< Option byte to be configured for extension.
Kojto 112:6f327212ef96 121 This parameter can be a value of @ref FLASHEx_Advanced_Option_Type */
Kojto 112:6f327212ef96 122
Kojto 112:6f327212ef96 123 uint32_t PCROPState; /*!< PCROP activation or deactivation.
Kojto 112:6f327212ef96 124 This parameter can be a value of @ref FLASHEx_PCROP_State */
Kojto 112:6f327212ef96 125
Kojto 112:6f327212ef96 126 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 127 uint16_t Sectors; /*!< specifies the sector(s) set for PCROP.
Kojto 112:6f327212ef96 128 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
Kojto 112:6f327212ef96 129 #endif /* STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 130
Kojto 112:6f327212ef96 131 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 132 uint32_t Banks; /*!< Select banks for PCROP activation/deactivation of all sectors.
Kojto 112:6f327212ef96 133 This parameter must be a value of @ref FLASHEx_Banks */
Kojto 112:6f327212ef96 134
Kojto 112:6f327212ef96 135 uint16_t SectorsBank1; /*!< Specifies the sector(s) set for PCROP for Bank1.
Kojto 112:6f327212ef96 136 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
Kojto 112:6f327212ef96 137
Kojto 112:6f327212ef96 138 uint16_t SectorsBank2; /*!< Specifies the sector(s) set for PCROP for Bank2.
Kojto 112:6f327212ef96 139 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
Kojto 112:6f327212ef96 140
Kojto 112:6f327212ef96 141 uint8_t BootConfig; /*!< Specifies Option bytes for boot config.
Kojto 112:6f327212ef96 142 This parameter can be a value of @ref FLASHEx_Dual_Boot */
Kojto 112:6f327212ef96 143
Kojto 112:6f327212ef96 144 #endif /*STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 145 } FLASH_AdvOBProgramInitTypeDef;
Kojto 112:6f327212ef96 146 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 147 /**
Kojto 112:6f327212ef96 148 * @}
Kojto 112:6f327212ef96 149 */
Kojto 112:6f327212ef96 150
Kojto 112:6f327212ef96 151 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 152
Kojto 112:6f327212ef96 153 /** @defgroup FLASHEx_Exported_Constants FLASH Exported Constants
Kojto 112:6f327212ef96 154 * @{
Kojto 112:6f327212ef96 155 */
Kojto 112:6f327212ef96 156
Kojto 112:6f327212ef96 157 /** @defgroup FLASHEx_Type_Erase FLASH Type Erase
Kojto 112:6f327212ef96 158 * @{
Kojto 112:6f327212ef96 159 */
Kojto 112:6f327212ef96 160 #define FLASH_TYPEERASE_SECTORS ((uint32_t)0x00) /*!< Sectors erase only */
Kojto 112:6f327212ef96 161 #define FLASH_TYPEERASE_MASSERASE ((uint32_t)0x01) /*!< Flash Mass erase activation */
Kojto 112:6f327212ef96 162 /**
Kojto 112:6f327212ef96 163 * @}
Kojto 112:6f327212ef96 164 */
Kojto 112:6f327212ef96 165
Kojto 112:6f327212ef96 166 /** @defgroup FLASHEx_Voltage_Range FLASH Voltage Range
Kojto 112:6f327212ef96 167 * @{
Kojto 112:6f327212ef96 168 */
Kojto 112:6f327212ef96 169 #define FLASH_VOLTAGE_RANGE_1 ((uint32_t)0x00) /*!< Device operating range: 1.8V to 2.1V */
Kojto 112:6f327212ef96 170 #define FLASH_VOLTAGE_RANGE_2 ((uint32_t)0x01) /*!< Device operating range: 2.1V to 2.7V */
Kojto 112:6f327212ef96 171 #define FLASH_VOLTAGE_RANGE_3 ((uint32_t)0x02) /*!< Device operating range: 2.7V to 3.6V */
Kojto 112:6f327212ef96 172 #define FLASH_VOLTAGE_RANGE_4 ((uint32_t)0x03) /*!< Device operating range: 2.7V to 3.6V + External Vpp */
Kojto 112:6f327212ef96 173 /**
Kojto 112:6f327212ef96 174 * @}
Kojto 112:6f327212ef96 175 */
Kojto 112:6f327212ef96 176
Kojto 112:6f327212ef96 177 /** @defgroup FLASHEx_WRP_State FLASH WRP State
Kojto 112:6f327212ef96 178 * @{
Kojto 112:6f327212ef96 179 */
Kojto 112:6f327212ef96 180 #define OB_WRPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable the write protection of the desired bank 1 sectors */
Kojto 112:6f327212ef96 181 #define OB_WRPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable the write protection of the desired bank 1 sectors */
Kojto 112:6f327212ef96 182 /**
Kojto 112:6f327212ef96 183 * @}
Kojto 112:6f327212ef96 184 */
Kojto 112:6f327212ef96 185
Kojto 112:6f327212ef96 186 /** @defgroup FLASHEx_Option_Type FLASH Option Type
Kojto 112:6f327212ef96 187 * @{
Kojto 112:6f327212ef96 188 */
Kojto 112:6f327212ef96 189 #define OPTIONBYTE_WRP ((uint32_t)0x01) /*!< WRP option byte configuration */
Kojto 112:6f327212ef96 190 #define OPTIONBYTE_RDP ((uint32_t)0x02) /*!< RDP option byte configuration */
Kojto 112:6f327212ef96 191 #define OPTIONBYTE_USER ((uint32_t)0x04) /*!< USER option byte configuration */
Kojto 112:6f327212ef96 192 #define OPTIONBYTE_BOR ((uint32_t)0x08) /*!< BOR option byte configuration */
Kojto 112:6f327212ef96 193 /**
Kojto 112:6f327212ef96 194 * @}
Kojto 112:6f327212ef96 195 */
Kojto 112:6f327212ef96 196
Kojto 112:6f327212ef96 197 /** @defgroup FLASHEx_Option_Bytes_Read_Protection FLASH Option Bytes Read Protection
Kojto 112:6f327212ef96 198 * @{
Kojto 112:6f327212ef96 199 */
Kojto 112:6f327212ef96 200 #define OB_RDP_LEVEL_0 ((uint8_t)0xAA)
Kojto 112:6f327212ef96 201 #define OB_RDP_LEVEL_1 ((uint8_t)0x55)
Kojto 112:6f327212ef96 202 #define OB_RDP_LEVEL_2 ((uint8_t)0xCC) /*!< Warning: When enabling read protection level 2
Kojto 112:6f327212ef96 203 it s no more possible to go back to level 1 or 0 */
Kojto 112:6f327212ef96 204 /**
Kojto 112:6f327212ef96 205 * @}
Kojto 112:6f327212ef96 206 */
Kojto 112:6f327212ef96 207
Kojto 112:6f327212ef96 208 /** @defgroup FLASHEx_Option_Bytes_IWatchdog FLASH Option Bytes IWatchdog
Kojto 112:6f327212ef96 209 * @{
Kojto 112:6f327212ef96 210 */
Kojto 112:6f327212ef96 211 #define OB_IWDG_SW ((uint8_t)0x20) /*!< Software IWDG selected */
Kojto 112:6f327212ef96 212 #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware IWDG selected */
Kojto 112:6f327212ef96 213 /**
Kojto 112:6f327212ef96 214 * @}
Kojto 112:6f327212ef96 215 */
Kojto 112:6f327212ef96 216
Kojto 112:6f327212ef96 217 /** @defgroup FLASHEx_Option_Bytes_nRST_STOP FLASH Option Bytes nRST_STOP
Kojto 112:6f327212ef96 218 * @{
Kojto 112:6f327212ef96 219 */
Kojto 112:6f327212ef96 220 #define OB_STOP_NO_RST ((uint8_t)0x40) /*!< No reset generated when entering in STOP */
Kojto 112:6f327212ef96 221 #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */
Kojto 112:6f327212ef96 222 /**
Kojto 112:6f327212ef96 223 * @}
Kojto 112:6f327212ef96 224 */
Kojto 112:6f327212ef96 225
Kojto 112:6f327212ef96 226
Kojto 112:6f327212ef96 227 /** @defgroup FLASHEx_Option_Bytes_nRST_STDBY FLASH Option Bytes nRST_STDBY
Kojto 112:6f327212ef96 228 * @{
Kojto 112:6f327212ef96 229 */
Kojto 112:6f327212ef96 230 #define OB_STDBY_NO_RST ((uint8_t)0x80) /*!< No reset generated when entering in STANDBY */
Kojto 112:6f327212ef96 231 #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */
Kojto 112:6f327212ef96 232 /**
Kojto 112:6f327212ef96 233 * @}
Kojto 112:6f327212ef96 234 */
Kojto 112:6f327212ef96 235
Kojto 112:6f327212ef96 236 /** @defgroup FLASHEx_BOR_Reset_Level FLASH BOR Reset Level
Kojto 112:6f327212ef96 237 * @{
Kojto 112:6f327212ef96 238 */
Kojto 112:6f327212ef96 239 #define OB_BOR_LEVEL3 ((uint8_t)0x00) /*!< Supply voltage ranges from 2.70 to 3.60 V */
Kojto 112:6f327212ef96 240 #define OB_BOR_LEVEL2 ((uint8_t)0x04) /*!< Supply voltage ranges from 2.40 to 2.70 V */
Kojto 112:6f327212ef96 241 #define OB_BOR_LEVEL1 ((uint8_t)0x08) /*!< Supply voltage ranges from 2.10 to 2.40 V */
Kojto 112:6f327212ef96 242 #define OB_BOR_OFF ((uint8_t)0x0C) /*!< Supply voltage ranges from 1.62 to 2.10 V */
Kojto 112:6f327212ef96 243 /**
Kojto 112:6f327212ef96 244 * @}
Kojto 112:6f327212ef96 245 */
Kojto 112:6f327212ef96 246
Kojto 112:6f327212ef96 247 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 248 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 249 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 250 defined(STM32F479xx)
Kojto 112:6f327212ef96 251 /** @defgroup FLASHEx_PCROP_State FLASH PCROP State
Kojto 112:6f327212ef96 252 * @{
Kojto 112:6f327212ef96 253 */
Kojto 112:6f327212ef96 254 #define OB_PCROP_STATE_DISABLE ((uint32_t)0x00) /*!< Disable PCROP */
Kojto 112:6f327212ef96 255 #define OB_PCROP_STATE_ENABLE ((uint32_t)0x01) /*!< Enable PCROP */
Kojto 112:6f327212ef96 256 /**
Kojto 112:6f327212ef96 257 * @}
Kojto 112:6f327212ef96 258 */
Kojto 112:6f327212ef96 259 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE ||\
Kojto 112:6f327212ef96 260 STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 261
Kojto 112:6f327212ef96 262 /** @defgroup FLASHEx_Advanced_Option_Type FLASH Advanced Option Type
Kojto 112:6f327212ef96 263 * @{
Kojto 112:6f327212ef96 264 */
Kojto 112:6f327212ef96 265 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 266 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 267 #define OPTIONBYTE_PCROP ((uint32_t)0x01) /*!< PCROP option byte configuration */
Kojto 112:6f327212ef96 268 #define OPTIONBYTE_BOOTCONFIG ((uint32_t)0x02) /*!< BOOTConfig option byte configuration */
Kojto 112:6f327212ef96 269 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 270
Kojto 112:6f327212ef96 271 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 272 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 273 #define OPTIONBYTE_PCROP ((uint32_t)0x01) /*!<PCROP option byte configuration */
Kojto 112:6f327212ef96 274 #endif /* STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 275 /**
Kojto 112:6f327212ef96 276 * @}
Kojto 112:6f327212ef96 277 */
Kojto 112:6f327212ef96 278
Kojto 112:6f327212ef96 279 /** @defgroup FLASH_Latency FLASH Latency
Kojto 112:6f327212ef96 280 * @{
Kojto 112:6f327212ef96 281 */
Kojto 112:6f327212ef96 282 /*------------------------- STM32F42xxx/STM32F43xxx/STM32F469xx/STM32F479xx ----------------------*/
Kojto 112:6f327212ef96 283 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 284 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 285 #define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero Latency cycle */
Kojto 112:6f327212ef96 286 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One Latency cycle */
Kojto 112:6f327212ef96 287 #define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two Latency cycles */
Kojto 112:6f327212ef96 288 #define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three Latency cycles */
Kojto 112:6f327212ef96 289 #define FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four Latency cycles */
Kojto 112:6f327212ef96 290 #define FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH Five Latency cycles */
Kojto 112:6f327212ef96 291 #define FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH Six Latency cycles */
Kojto 112:6f327212ef96 292 #define FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH Seven Latency cycles */
Kojto 112:6f327212ef96 293 #define FLASH_LATENCY_8 FLASH_ACR_LATENCY_8WS /*!< FLASH Eight Latency cycles */
Kojto 112:6f327212ef96 294 #define FLASH_LATENCY_9 FLASH_ACR_LATENCY_9WS /*!< FLASH Nine Latency cycles */
Kojto 112:6f327212ef96 295 #define FLASH_LATENCY_10 FLASH_ACR_LATENCY_10WS /*!< FLASH Ten Latency cycles */
Kojto 112:6f327212ef96 296 #define FLASH_LATENCY_11 FLASH_ACR_LATENCY_11WS /*!< FLASH Eleven Latency cycles */
Kojto 112:6f327212ef96 297 #define FLASH_LATENCY_12 FLASH_ACR_LATENCY_12WS /*!< FLASH Twelve Latency cycles */
Kojto 112:6f327212ef96 298 #define FLASH_LATENCY_13 FLASH_ACR_LATENCY_13WS /*!< FLASH Thirteen Latency cycles */
Kojto 112:6f327212ef96 299 #define FLASH_LATENCY_14 FLASH_ACR_LATENCY_14WS /*!< FLASH Fourteen Latency cycles */
Kojto 112:6f327212ef96 300 #define FLASH_LATENCY_15 FLASH_ACR_LATENCY_15WS /*!< FLASH Fifteen Latency cycles */
Kojto 112:6f327212ef96 301 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 302 /*--------------------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 303
Kojto 112:6f327212ef96 304 /*-------------------------- STM32F40xxx/STM32F41xxx/STM32F401xx/STM32F411xx -----------------------------------*/
Kojto 112:6f327212ef96 305 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
Kojto 112:6f327212ef96 306 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 307 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 308
Kojto 112:6f327212ef96 309 #define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero Latency cycle */
Kojto 112:6f327212ef96 310 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One Latency cycle */
Kojto 112:6f327212ef96 311 #define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two Latency cycles */
Kojto 112:6f327212ef96 312 #define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three Latency cycles */
Kojto 112:6f327212ef96 313 #define FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four Latency cycles */
Kojto 112:6f327212ef96 314 #define FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH Five Latency cycles */
Kojto 112:6f327212ef96 315 #define FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH Six Latency cycles */
Kojto 112:6f327212ef96 316 #define FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH Seven Latency cycles */
Kojto 112:6f327212ef96 317 #endif /* STM32F40xxx || STM32F41xxx || STM32F401xx || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 318 /*--------------------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 319
Kojto 112:6f327212ef96 320 /**
Kojto 112:6f327212ef96 321 * @}
Kojto 112:6f327212ef96 322 */
Kojto 112:6f327212ef96 323
Kojto 112:6f327212ef96 324
Kojto 112:6f327212ef96 325 /** @defgroup FLASHEx_Banks FLASH Banks
Kojto 112:6f327212ef96 326 * @{
Kojto 112:6f327212ef96 327 */
Kojto 112:6f327212ef96 328 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 329 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 330 #define FLASH_BANK_1 ((uint32_t)1) /*!< Bank 1 */
Kojto 112:6f327212ef96 331 #define FLASH_BANK_2 ((uint32_t)2) /*!< Bank 2 */
Kojto 112:6f327212ef96 332 #define FLASH_BANK_BOTH ((uint32_t)FLASH_BANK_1 | FLASH_BANK_2) /*!< Bank1 and Bank2 */
Kojto 112:6f327212ef96 333 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 334
Kojto 112:6f327212ef96 335 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
Kojto 112:6f327212ef96 336 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 337 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 338 #define FLASH_BANK_1 ((uint32_t)1) /*!< Bank 1 */
Kojto 112:6f327212ef96 339 #endif /* STM32F40xxx || STM32F41xxx || STM32F401xx || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 340 /**
Kojto 112:6f327212ef96 341 * @}
Kojto 112:6f327212ef96 342 */
Kojto 112:6f327212ef96 343
Kojto 112:6f327212ef96 344 /** @defgroup FLASHEx_MassErase_bit FLASH Mass Erase bit
Kojto 112:6f327212ef96 345 * @{
Kojto 112:6f327212ef96 346 */
Kojto 112:6f327212ef96 347 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 348 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 349 #define FLASH_MER_BIT (FLASH_CR_MER1 | FLASH_CR_MER2) /*!< 2 MER bits here to clear */
Kojto 112:6f327212ef96 350 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 351
Kojto 112:6f327212ef96 352 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
Kojto 112:6f327212ef96 353 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 354 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 355 #define FLASH_MER_BIT (FLASH_CR_MER) /*!< only 1 MER Bit */
Kojto 112:6f327212ef96 356 #endif /* STM32F40xxx || STM32F41xxx || STM32F401xx || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 357 /**
Kojto 112:6f327212ef96 358 * @}
Kojto 112:6f327212ef96 359 */
Kojto 112:6f327212ef96 360
Kojto 112:6f327212ef96 361 /** @defgroup FLASHEx_Sectors FLASH Sectors
Kojto 112:6f327212ef96 362 * @{
Kojto 112:6f327212ef96 363 */
Kojto 112:6f327212ef96 364 /*-------------------------------------- STM32F42xxx/STM32F43xxx/STM32F469xx ------------------------------------*/
Kojto 112:6f327212ef96 365 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 366 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 367 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
Kojto 112:6f327212ef96 368 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
Kojto 112:6f327212ef96 369 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
Kojto 112:6f327212ef96 370 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
Kojto 112:6f327212ef96 371 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
Kojto 112:6f327212ef96 372 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
Kojto 112:6f327212ef96 373 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
Kojto 112:6f327212ef96 374 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
Kojto 112:6f327212ef96 375 #define FLASH_SECTOR_8 ((uint32_t)8) /*!< Sector Number 8 */
Kojto 112:6f327212ef96 376 #define FLASH_SECTOR_9 ((uint32_t)9) /*!< Sector Number 9 */
Kojto 112:6f327212ef96 377 #define FLASH_SECTOR_10 ((uint32_t)10) /*!< Sector Number 10 */
Kojto 112:6f327212ef96 378 #define FLASH_SECTOR_11 ((uint32_t)11) /*!< Sector Number 11 */
Kojto 112:6f327212ef96 379 #define FLASH_SECTOR_12 ((uint32_t)12) /*!< Sector Number 12 */
Kojto 112:6f327212ef96 380 #define FLASH_SECTOR_13 ((uint32_t)13) /*!< Sector Number 13 */
Kojto 112:6f327212ef96 381 #define FLASH_SECTOR_14 ((uint32_t)14) /*!< Sector Number 14 */
Kojto 112:6f327212ef96 382 #define FLASH_SECTOR_15 ((uint32_t)15) /*!< Sector Number 15 */
Kojto 112:6f327212ef96 383 #define FLASH_SECTOR_16 ((uint32_t)16) /*!< Sector Number 16 */
Kojto 112:6f327212ef96 384 #define FLASH_SECTOR_17 ((uint32_t)17) /*!< Sector Number 17 */
Kojto 112:6f327212ef96 385 #define FLASH_SECTOR_18 ((uint32_t)18) /*!< Sector Number 18 */
Kojto 112:6f327212ef96 386 #define FLASH_SECTOR_19 ((uint32_t)19) /*!< Sector Number 19 */
Kojto 112:6f327212ef96 387 #define FLASH_SECTOR_20 ((uint32_t)20) /*!< Sector Number 20 */
Kojto 112:6f327212ef96 388 #define FLASH_SECTOR_21 ((uint32_t)21) /*!< Sector Number 21 */
Kojto 112:6f327212ef96 389 #define FLASH_SECTOR_22 ((uint32_t)22) /*!< Sector Number 22 */
Kojto 112:6f327212ef96 390 #define FLASH_SECTOR_23 ((uint32_t)23) /*!< Sector Number 23 */
Kojto 112:6f327212ef96 391 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 392 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 393
Kojto 112:6f327212ef96 394 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
Kojto 112:6f327212ef96 395 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 112:6f327212ef96 396 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
Kojto 112:6f327212ef96 397 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
Kojto 112:6f327212ef96 398 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
Kojto 112:6f327212ef96 399 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
Kojto 112:6f327212ef96 400 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
Kojto 112:6f327212ef96 401 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
Kojto 112:6f327212ef96 402 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
Kojto 112:6f327212ef96 403 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
Kojto 112:6f327212ef96 404 #define FLASH_SECTOR_8 ((uint32_t)8) /*!< Sector Number 8 */
Kojto 112:6f327212ef96 405 #define FLASH_SECTOR_9 ((uint32_t)9) /*!< Sector Number 9 */
Kojto 112:6f327212ef96 406 #define FLASH_SECTOR_10 ((uint32_t)10) /*!< Sector Number 10 */
Kojto 112:6f327212ef96 407 #define FLASH_SECTOR_11 ((uint32_t)11) /*!< Sector Number 11 */
Kojto 112:6f327212ef96 408 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 112:6f327212ef96 409 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 410
Kojto 112:6f327212ef96 411 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
Kojto 112:6f327212ef96 412 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 413 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
Kojto 112:6f327212ef96 414 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
Kojto 112:6f327212ef96 415 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
Kojto 112:6f327212ef96 416 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
Kojto 112:6f327212ef96 417 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
Kojto 112:6f327212ef96 418 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
Kojto 112:6f327212ef96 419 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 420 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 421
Kojto 112:6f327212ef96 422 /*--------------------------------------------- STM32F410xx -------------------------------------------*/
Kojto 112:6f327212ef96 423 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 424 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
Kojto 112:6f327212ef96 425 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
Kojto 112:6f327212ef96 426 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
Kojto 112:6f327212ef96 427 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
Kojto 112:6f327212ef96 428 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
Kojto 112:6f327212ef96 429 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 430 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 431
Kojto 112:6f327212ef96 432 /*---------------------------------- STM32F401xE/STM32F411xE/STM32F446xx ------------------------------*/
Kojto 112:6f327212ef96 433 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 434 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
Kojto 112:6f327212ef96 435 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
Kojto 112:6f327212ef96 436 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
Kojto 112:6f327212ef96 437 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
Kojto 112:6f327212ef96 438 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
Kojto 112:6f327212ef96 439 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
Kojto 112:6f327212ef96 440 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
Kojto 112:6f327212ef96 441 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
Kojto 112:6f327212ef96 442 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 443 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 444
Kojto 112:6f327212ef96 445 /**
Kojto 112:6f327212ef96 446 * @}
Kojto 112:6f327212ef96 447 */
Kojto 112:6f327212ef96 448
Kojto 112:6f327212ef96 449 /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write Protection
Kojto 112:6f327212ef96 450 * @{
Kojto 112:6f327212ef96 451 */
Kojto 112:6f327212ef96 452 /*--------------------------- STM32F42xxx/STM32F43xxx/STM32F469xx/STM32F479xx -------------------------*/
Kojto 112:6f327212ef96 453 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 454 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 455 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
Kojto 112:6f327212ef96 456 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
Kojto 112:6f327212ef96 457 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
Kojto 112:6f327212ef96 458 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
Kojto 112:6f327212ef96 459 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
Kojto 112:6f327212ef96 460 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
Kojto 112:6f327212ef96 461 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
Kojto 112:6f327212ef96 462 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
Kojto 112:6f327212ef96 463 #define OB_WRP_SECTOR_8 ((uint32_t)0x00000100) /*!< Write protection of Sector8 */
Kojto 112:6f327212ef96 464 #define OB_WRP_SECTOR_9 ((uint32_t)0x00000200) /*!< Write protection of Sector9 */
Kojto 112:6f327212ef96 465 #define OB_WRP_SECTOR_10 ((uint32_t)0x00000400) /*!< Write protection of Sector10 */
Kojto 112:6f327212ef96 466 #define OB_WRP_SECTOR_11 ((uint32_t)0x00000800) /*!< Write protection of Sector11 */
Kojto 112:6f327212ef96 467 #define OB_WRP_SECTOR_12 ((uint32_t)0x00000001 << 12) /*!< Write protection of Sector12 */
Kojto 112:6f327212ef96 468 #define OB_WRP_SECTOR_13 ((uint32_t)0x00000002 << 12) /*!< Write protection of Sector13 */
Kojto 112:6f327212ef96 469 #define OB_WRP_SECTOR_14 ((uint32_t)0x00000004 << 12) /*!< Write protection of Sector14 */
Kojto 112:6f327212ef96 470 #define OB_WRP_SECTOR_15 ((uint32_t)0x00000008 << 12) /*!< Write protection of Sector15 */
Kojto 112:6f327212ef96 471 #define OB_WRP_SECTOR_16 ((uint32_t)0x00000010 << 12) /*!< Write protection of Sector16 */
Kojto 112:6f327212ef96 472 #define OB_WRP_SECTOR_17 ((uint32_t)0x00000020 << 12) /*!< Write protection of Sector17 */
Kojto 112:6f327212ef96 473 #define OB_WRP_SECTOR_18 ((uint32_t)0x00000040 << 12) /*!< Write protection of Sector18 */
Kojto 112:6f327212ef96 474 #define OB_WRP_SECTOR_19 ((uint32_t)0x00000080 << 12) /*!< Write protection of Sector19 */
Kojto 112:6f327212ef96 475 #define OB_WRP_SECTOR_20 ((uint32_t)0x00000100 << 12) /*!< Write protection of Sector20 */
Kojto 112:6f327212ef96 476 #define OB_WRP_SECTOR_21 ((uint32_t)0x00000200 << 12) /*!< Write protection of Sector21 */
Kojto 112:6f327212ef96 477 #define OB_WRP_SECTOR_22 ((uint32_t)0x00000400 << 12) /*!< Write protection of Sector22 */
Kojto 112:6f327212ef96 478 #define OB_WRP_SECTOR_23 ((uint32_t)0x00000800 << 12) /*!< Write protection of Sector23 */
Kojto 112:6f327212ef96 479 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF << 12) /*!< Write protection of all Sectors */
Kojto 112:6f327212ef96 480 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 481 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 482
Kojto 112:6f327212ef96 483 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
Kojto 112:6f327212ef96 484 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 112:6f327212ef96 485 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
Kojto 112:6f327212ef96 486 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
Kojto 112:6f327212ef96 487 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
Kojto 112:6f327212ef96 488 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
Kojto 112:6f327212ef96 489 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
Kojto 112:6f327212ef96 490 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
Kojto 112:6f327212ef96 491 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
Kojto 112:6f327212ef96 492 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
Kojto 112:6f327212ef96 493 #define OB_WRP_SECTOR_8 ((uint32_t)0x00000100) /*!< Write protection of Sector8 */
Kojto 112:6f327212ef96 494 #define OB_WRP_SECTOR_9 ((uint32_t)0x00000200) /*!< Write protection of Sector9 */
Kojto 112:6f327212ef96 495 #define OB_WRP_SECTOR_10 ((uint32_t)0x00000400) /*!< Write protection of Sector10 */
Kojto 112:6f327212ef96 496 #define OB_WRP_SECTOR_11 ((uint32_t)0x00000800) /*!< Write protection of Sector11 */
Kojto 112:6f327212ef96 497 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
Kojto 112:6f327212ef96 498 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 112:6f327212ef96 499 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 500
Kojto 112:6f327212ef96 501 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
Kojto 112:6f327212ef96 502 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 503 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
Kojto 112:6f327212ef96 504 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
Kojto 112:6f327212ef96 505 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
Kojto 112:6f327212ef96 506 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
Kojto 112:6f327212ef96 507 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
Kojto 112:6f327212ef96 508 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
Kojto 112:6f327212ef96 509 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
Kojto 112:6f327212ef96 510 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 511 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 512
Kojto 112:6f327212ef96 513 /*--------------------------------------------- STM32F410xx -------------------------------------------*/
Kojto 112:6f327212ef96 514 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 515 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
Kojto 112:6f327212ef96 516 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
Kojto 112:6f327212ef96 517 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
Kojto 112:6f327212ef96 518 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
Kojto 112:6f327212ef96 519 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
Kojto 112:6f327212ef96 520 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
Kojto 112:6f327212ef96 521 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 522 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 523
Kojto 112:6f327212ef96 524 /*---------------------------------- STM32F401xE/STM32F411xE/STM32F446xx ------------------------------*/
Kojto 112:6f327212ef96 525 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 526 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
Kojto 112:6f327212ef96 527 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
Kojto 112:6f327212ef96 528 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
Kojto 112:6f327212ef96 529 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
Kojto 112:6f327212ef96 530 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
Kojto 112:6f327212ef96 531 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
Kojto 112:6f327212ef96 532 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
Kojto 112:6f327212ef96 533 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
Kojto 112:6f327212ef96 534 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
Kojto 112:6f327212ef96 535 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 536 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 537 /**
Kojto 112:6f327212ef96 538 * @}
Kojto 112:6f327212ef96 539 */
Kojto 112:6f327212ef96 540
Kojto 112:6f327212ef96 541 /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection FLASH Option Bytes PC ReadWrite Protection
Kojto 112:6f327212ef96 542 * @{
Kojto 112:6f327212ef96 543 */
Kojto 112:6f327212ef96 544 /*-------------------------------- STM32F42xxx/STM32F43xxx/STM32F469xx/STM32F479xx ---------------------------*/
Kojto 112:6f327212ef96 545 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 546 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 547 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
Kojto 112:6f327212ef96 548 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
Kojto 112:6f327212ef96 549 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
Kojto 112:6f327212ef96 550 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
Kojto 112:6f327212ef96 551 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
Kojto 112:6f327212ef96 552 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
Kojto 112:6f327212ef96 553 #define OB_PCROP_SECTOR_6 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector6 */
Kojto 112:6f327212ef96 554 #define OB_PCROP_SECTOR_7 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector7 */
Kojto 112:6f327212ef96 555 #define OB_PCROP_SECTOR_8 ((uint32_t)0x00000100) /*!< PC Read/Write protection of Sector8 */
Kojto 112:6f327212ef96 556 #define OB_PCROP_SECTOR_9 ((uint32_t)0x00000200) /*!< PC Read/Write protection of Sector9 */
Kojto 112:6f327212ef96 557 #define OB_PCROP_SECTOR_10 ((uint32_t)0x00000400) /*!< PC Read/Write protection of Sector10 */
Kojto 112:6f327212ef96 558 #define OB_PCROP_SECTOR_11 ((uint32_t)0x00000800) /*!< PC Read/Write protection of Sector11 */
Kojto 112:6f327212ef96 559 #define OB_PCROP_SECTOR_12 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector12 */
Kojto 112:6f327212ef96 560 #define OB_PCROP_SECTOR_13 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector13 */
Kojto 112:6f327212ef96 561 #define OB_PCROP_SECTOR_14 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector14 */
Kojto 112:6f327212ef96 562 #define OB_PCROP_SECTOR_15 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector15 */
Kojto 112:6f327212ef96 563 #define OB_PCROP_SECTOR_16 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector16 */
Kojto 112:6f327212ef96 564 #define OB_PCROP_SECTOR_17 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector17 */
Kojto 112:6f327212ef96 565 #define OB_PCROP_SECTOR_18 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector18 */
Kojto 112:6f327212ef96 566 #define OB_PCROP_SECTOR_19 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector19 */
Kojto 112:6f327212ef96 567 #define OB_PCROP_SECTOR_20 ((uint32_t)0x00000100) /*!< PC Read/Write protection of Sector20 */
Kojto 112:6f327212ef96 568 #define OB_PCROP_SECTOR_21 ((uint32_t)0x00000200) /*!< PC Read/Write protection of Sector21 */
Kojto 112:6f327212ef96 569 #define OB_PCROP_SECTOR_22 ((uint32_t)0x00000400) /*!< PC Read/Write protection of Sector22 */
Kojto 112:6f327212ef96 570 #define OB_PCROP_SECTOR_23 ((uint32_t)0x00000800) /*!< PC Read/Write protection of Sector23 */
Kojto 112:6f327212ef96 571 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
Kojto 112:6f327212ef96 572 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 573 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 574
Kojto 112:6f327212ef96 575 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
Kojto 112:6f327212ef96 576 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 577 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
Kojto 112:6f327212ef96 578 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
Kojto 112:6f327212ef96 579 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
Kojto 112:6f327212ef96 580 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
Kojto 112:6f327212ef96 581 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
Kojto 112:6f327212ef96 582 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
Kojto 112:6f327212ef96 583 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
Kojto 112:6f327212ef96 584 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 585 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 586
Kojto 112:6f327212ef96 587 /*--------------------------------------------- STM32F410xx -------------------------------------------*/
Kojto 112:6f327212ef96 588 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 589 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
Kojto 112:6f327212ef96 590 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
Kojto 112:6f327212ef96 591 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
Kojto 112:6f327212ef96 592 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
Kojto 112:6f327212ef96 593 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
Kojto 112:6f327212ef96 594 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
Kojto 112:6f327212ef96 595 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 596 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 597
Kojto 112:6f327212ef96 598 /*------------------------------ STM32F401xE/STM32F411xE/STM32F446xx ----------------------*/
Kojto 112:6f327212ef96 599 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 600 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
Kojto 112:6f327212ef96 601 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
Kojto 112:6f327212ef96 602 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
Kojto 112:6f327212ef96 603 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
Kojto 112:6f327212ef96 604 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
Kojto 112:6f327212ef96 605 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
Kojto 112:6f327212ef96 606 #define OB_PCROP_SECTOR_6 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector6 */
Kojto 112:6f327212ef96 607 #define OB_PCROP_SECTOR_7 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector7 */
Kojto 112:6f327212ef96 608 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
Kojto 112:6f327212ef96 609 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 610 /*-----------------------------------------------------------------------------------------------------*/
Kojto 112:6f327212ef96 611
Kojto 112:6f327212ef96 612 /**
Kojto 112:6f327212ef96 613 * @}
Kojto 112:6f327212ef96 614 */
Kojto 112:6f327212ef96 615
Kojto 112:6f327212ef96 616 /** @defgroup FLASHEx_Dual_Boot FLASH Dual Boot
Kojto 112:6f327212ef96 617 * @{
Kojto 112:6f327212ef96 618 */
Kojto 112:6f327212ef96 619 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 620 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 621 #define OB_DUAL_BOOT_ENABLE ((uint8_t)0x10) /*!< Dual Bank Boot Enable */
Kojto 112:6f327212ef96 622 #define OB_DUAL_BOOT_DISABLE ((uint8_t)0x00) /*!< Dual Bank Boot Disable, always boot on User Flash */
Kojto 112:6f327212ef96 623 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 624 /**
Kojto 112:6f327212ef96 625 * @}
Kojto 112:6f327212ef96 626 */
Kojto 112:6f327212ef96 627
Kojto 112:6f327212ef96 628 /** @defgroup FLASHEx_Selection_Protection_Mode FLASH Selection Protection Mode
Kojto 112:6f327212ef96 629 * @{
Kojto 112:6f327212ef96 630 */
Kojto 112:6f327212ef96 631 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 632 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 633 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 634 defined(STM32F479xx)
Kojto 112:6f327212ef96 635 #define OB_PCROP_DESELECTED ((uint8_t)0x00) /*!< Disabled PcROP, nWPRi bits used for Write Protection on sector i */
Kojto 112:6f327212ef96 636 #define OB_PCROP_SELECTED ((uint8_t)0x80) /*!< Enable PcROP, nWPRi bits used for PCRoP Protection on sector i */
Kojto 112:6f327212ef96 637 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE ||\
Kojto 112:6f327212ef96 638 STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 639 /**
Kojto 112:6f327212ef96 640 * @}
Kojto 112:6f327212ef96 641 */
Kojto 112:6f327212ef96 642
Kojto 112:6f327212ef96 643 /**
Kojto 112:6f327212ef96 644 * @}
Kojto 112:6f327212ef96 645 */
Kojto 112:6f327212ef96 646
Kojto 112:6f327212ef96 647 /* Exported macro ------------------------------------------------------------*/
Kojto 112:6f327212ef96 648
Kojto 112:6f327212ef96 649 /* Exported functions --------------------------------------------------------*/
Kojto 112:6f327212ef96 650 /** @addtogroup FLASHEx_Exported_Functions
Kojto 112:6f327212ef96 651 * @{
Kojto 112:6f327212ef96 652 */
Kojto 112:6f327212ef96 653
Kojto 112:6f327212ef96 654 /** @addtogroup FLASHEx_Exported_Functions_Group1
Kojto 112:6f327212ef96 655 * @{
Kojto 112:6f327212ef96 656 */
Kojto 112:6f327212ef96 657 /* Extension Program operation functions *************************************/
Kojto 112:6f327212ef96 658 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError);
Kojto 112:6f327212ef96 659 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
Kojto 112:6f327212ef96 660 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
Kojto 112:6f327212ef96 661 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
Kojto 112:6f327212ef96 662
Kojto 112:6f327212ef96 663 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 664 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 665 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 666 defined(STM32F479xx)
Kojto 112:6f327212ef96 667 HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
Kojto 112:6f327212ef96 668 void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
Kojto 112:6f327212ef96 669 HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void);
Kojto 112:6f327212ef96 670 HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void);
Kojto 112:6f327212ef96 671 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE ||\
Kojto 112:6f327212ef96 672 STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 673
Kojto 112:6f327212ef96 674 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 675 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 676 uint16_t HAL_FLASHEx_OB_GetBank2WRP(void);
Kojto 112:6f327212ef96 677 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 678 /**
Kojto 112:6f327212ef96 679 * @}
Kojto 112:6f327212ef96 680 */
Kojto 112:6f327212ef96 681
Kojto 112:6f327212ef96 682 /**
Kojto 112:6f327212ef96 683 * @}
Kojto 112:6f327212ef96 684 */
Kojto 112:6f327212ef96 685 /* Private types -------------------------------------------------------------*/
Kojto 112:6f327212ef96 686 /* Private variables ---------------------------------------------------------*/
Kojto 112:6f327212ef96 687 /* Private constants ---------------------------------------------------------*/
Kojto 112:6f327212ef96 688 /** @defgroup FLASHEx_Private_Constants FLASH Private Constants
Kojto 112:6f327212ef96 689 * @{
Kojto 112:6f327212ef96 690 */
Kojto 112:6f327212ef96 691 /*--------------------------------- STM32F42xxx/STM32F43xxx/STM32F469xx/STM32F479xx---------------------*/
Kojto 112:6f327212ef96 692 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 693 #define FLASH_SECTOR_TOTAL 24
Kojto 112:6f327212ef96 694 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 695
Kojto 112:6f327212ef96 696 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
Kojto 112:6f327212ef96 697 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 112:6f327212ef96 698 #define FLASH_SECTOR_TOTAL 12
Kojto 112:6f327212ef96 699 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 112:6f327212ef96 700
Kojto 112:6f327212ef96 701 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
Kojto 112:6f327212ef96 702 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 703 #define FLASH_SECTOR_TOTAL 6
Kojto 112:6f327212ef96 704 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 705
Kojto 112:6f327212ef96 706 /*--------------------------------------------- STM32F410xx -------------------------------------------*/
Kojto 112:6f327212ef96 707 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 708 #define FLASH_SECTOR_TOTAL 5
Kojto 112:6f327212ef96 709 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 710
Kojto 112:6f327212ef96 711 /*--------------------------------- STM32F401xE/STM32F411xE/STM32F446xx -------------------*/
Kojto 112:6f327212ef96 712 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 713 #define FLASH_SECTOR_TOTAL 8
Kojto 112:6f327212ef96 714 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 715
Kojto 112:6f327212ef96 716 /**
Kojto 112:6f327212ef96 717 * @brief OPTCR1 register byte 2 (Bits[23:16]) base address
Kojto 112:6f327212ef96 718 */
Kojto 112:6f327212ef96 719 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 720 #define OPTCR1_BYTE2_ADDRESS ((uint32_t)0x40023C1A)
Kojto 112:6f327212ef96 721 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 722
Kojto 112:6f327212ef96 723 /**
Kojto 112:6f327212ef96 724 * @}
Kojto 112:6f327212ef96 725 */
Kojto 112:6f327212ef96 726
Kojto 112:6f327212ef96 727 /* Private macros ------------------------------------------------------------*/
Kojto 112:6f327212ef96 728 /** @defgroup FLASHEx_Private_Macros FLASH Private Macros
Kojto 112:6f327212ef96 729 * @{
Kojto 112:6f327212ef96 730 */
Kojto 112:6f327212ef96 731
Kojto 112:6f327212ef96 732 /** @defgroup FLASHEx_IS_FLASH_Definitions FLASH Private macros to check input parameters
Kojto 112:6f327212ef96 733 * @{
Kojto 112:6f327212ef96 734 */
Kojto 112:6f327212ef96 735
Kojto 112:6f327212ef96 736 #define IS_FLASH_TYPEERASE(VALUE)(((VALUE) == FLASH_TYPEERASE_SECTORS) || \
Kojto 112:6f327212ef96 737 ((VALUE) == FLASH_TYPEERASE_MASSERASE))
Kojto 112:6f327212ef96 738
Kojto 112:6f327212ef96 739 #define IS_VOLTAGERANGE(RANGE)(((RANGE) == FLASH_VOLTAGE_RANGE_1) || \
Kojto 112:6f327212ef96 740 ((RANGE) == FLASH_VOLTAGE_RANGE_2) || \
Kojto 112:6f327212ef96 741 ((RANGE) == FLASH_VOLTAGE_RANGE_3) || \
Kojto 112:6f327212ef96 742 ((RANGE) == FLASH_VOLTAGE_RANGE_4))
Kojto 112:6f327212ef96 743
Kojto 112:6f327212ef96 744 #define IS_WRPSTATE(VALUE)(((VALUE) == OB_WRPSTATE_DISABLE) || \
Kojto 112:6f327212ef96 745 ((VALUE) == OB_WRPSTATE_ENABLE))
Kojto 112:6f327212ef96 746
Kojto 112:6f327212ef96 747 #define IS_OPTIONBYTE(VALUE)(((VALUE) <= (OPTIONBYTE_WRP|OPTIONBYTE_RDP|OPTIONBYTE_USER|OPTIONBYTE_BOR)))
Kojto 112:6f327212ef96 748
Kojto 112:6f327212ef96 749 #define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\
Kojto 112:6f327212ef96 750 ((LEVEL) == OB_RDP_LEVEL_1) ||\
Kojto 112:6f327212ef96 751 ((LEVEL) == OB_RDP_LEVEL_2))
Kojto 112:6f327212ef96 752
Kojto 112:6f327212ef96 753 #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
Kojto 112:6f327212ef96 754
Kojto 112:6f327212ef96 755 #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
Kojto 112:6f327212ef96 756
Kojto 112:6f327212ef96 757 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
Kojto 112:6f327212ef96 758
Kojto 112:6f327212ef96 759 #define IS_OB_BOR_LEVEL(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\
Kojto 112:6f327212ef96 760 ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF))
Kojto 112:6f327212ef96 761
Kojto 112:6f327212ef96 762 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 763 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 764 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 765 defined(STM32F479xx)
Kojto 112:6f327212ef96 766 #define IS_PCROPSTATE(VALUE)(((VALUE) == OB_PCROP_STATE_DISABLE) || \
Kojto 112:6f327212ef96 767 ((VALUE) == OB_PCROP_STATE_ENABLE))
Kojto 112:6f327212ef96 768 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE ||\
Kojto 112:6f327212ef96 769 STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 770
Kojto 112:6f327212ef96 771 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 772 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 773 #define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP) || \
Kojto 112:6f327212ef96 774 ((VALUE) == OPTIONBYTE_BOOTCONFIG))
Kojto 112:6f327212ef96 775 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 776
Kojto 112:6f327212ef96 777 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 778 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 779 #define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP))
Kojto 112:6f327212ef96 780 #endif /* STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 781
Kojto 112:6f327212ef96 782 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 783 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 784 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \
Kojto 112:6f327212ef96 785 ((LATENCY) == FLASH_LATENCY_1) || \
Kojto 112:6f327212ef96 786 ((LATENCY) == FLASH_LATENCY_2) || \
Kojto 112:6f327212ef96 787 ((LATENCY) == FLASH_LATENCY_3) || \
Kojto 112:6f327212ef96 788 ((LATENCY) == FLASH_LATENCY_4) || \
Kojto 112:6f327212ef96 789 ((LATENCY) == FLASH_LATENCY_5) || \
Kojto 112:6f327212ef96 790 ((LATENCY) == FLASH_LATENCY_6) || \
Kojto 112:6f327212ef96 791 ((LATENCY) == FLASH_LATENCY_7) || \
Kojto 112:6f327212ef96 792 ((LATENCY) == FLASH_LATENCY_8) || \
Kojto 112:6f327212ef96 793 ((LATENCY) == FLASH_LATENCY_9) || \
Kojto 112:6f327212ef96 794 ((LATENCY) == FLASH_LATENCY_10) || \
Kojto 112:6f327212ef96 795 ((LATENCY) == FLASH_LATENCY_11) || \
Kojto 112:6f327212ef96 796 ((LATENCY) == FLASH_LATENCY_12) || \
Kojto 112:6f327212ef96 797 ((LATENCY) == FLASH_LATENCY_13) || \
Kojto 112:6f327212ef96 798 ((LATENCY) == FLASH_LATENCY_14) || \
Kojto 112:6f327212ef96 799 ((LATENCY) == FLASH_LATENCY_15))
Kojto 112:6f327212ef96 800 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 801
Kojto 112:6f327212ef96 802 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
Kojto 112:6f327212ef96 803 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 804 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 805 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \
Kojto 112:6f327212ef96 806 ((LATENCY) == FLASH_LATENCY_1) || \
Kojto 112:6f327212ef96 807 ((LATENCY) == FLASH_LATENCY_2) || \
Kojto 112:6f327212ef96 808 ((LATENCY) == FLASH_LATENCY_3) || \
Kojto 112:6f327212ef96 809 ((LATENCY) == FLASH_LATENCY_4) || \
Kojto 112:6f327212ef96 810 ((LATENCY) == FLASH_LATENCY_5) || \
Kojto 112:6f327212ef96 811 ((LATENCY) == FLASH_LATENCY_6) || \
Kojto 112:6f327212ef96 812 ((LATENCY) == FLASH_LATENCY_7))
Kojto 112:6f327212ef96 813 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 814
Kojto 112:6f327212ef96 815 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 816 #define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1) || \
Kojto 112:6f327212ef96 817 ((BANK) == FLASH_BANK_2) || \
Kojto 112:6f327212ef96 818 ((BANK) == FLASH_BANK_BOTH))
Kojto 112:6f327212ef96 819 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 820
Kojto 112:6f327212ef96 821 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
Kojto 112:6f327212ef96 822 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 823 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 824 #define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1))
Kojto 112:6f327212ef96 825 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 826
Kojto 112:6f327212ef96 827
Kojto 112:6f327212ef96 828 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 829 #define IS_FLASH_SECTOR(SECTOR) ( ((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
Kojto 112:6f327212ef96 830 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
Kojto 112:6f327212ef96 831 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
Kojto 112:6f327212ef96 832 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\
Kojto 112:6f327212ef96 833 ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\
Kojto 112:6f327212ef96 834 ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11) ||\
Kojto 112:6f327212ef96 835 ((SECTOR) == FLASH_SECTOR_12) || ((SECTOR) == FLASH_SECTOR_13) ||\
Kojto 112:6f327212ef96 836 ((SECTOR) == FLASH_SECTOR_14) || ((SECTOR) == FLASH_SECTOR_15) ||\
Kojto 112:6f327212ef96 837 ((SECTOR) == FLASH_SECTOR_16) || ((SECTOR) == FLASH_SECTOR_17) ||\
Kojto 112:6f327212ef96 838 ((SECTOR) == FLASH_SECTOR_18) || ((SECTOR) == FLASH_SECTOR_19) ||\
Kojto 112:6f327212ef96 839 ((SECTOR) == FLASH_SECTOR_20) || ((SECTOR) == FLASH_SECTOR_21) ||\
Kojto 112:6f327212ef96 840 ((SECTOR) == FLASH_SECTOR_22) || ((SECTOR) == FLASH_SECTOR_23))
Kojto 112:6f327212ef96 841 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 842
Kojto 112:6f327212ef96 843 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 112:6f327212ef96 844 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
Kojto 112:6f327212ef96 845 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
Kojto 112:6f327212ef96 846 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
Kojto 112:6f327212ef96 847 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\
Kojto 112:6f327212ef96 848 ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\
Kojto 112:6f327212ef96 849 ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11))
Kojto 112:6f327212ef96 850 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 112:6f327212ef96 851
Kojto 112:6f327212ef96 852 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 853 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
Kojto 112:6f327212ef96 854 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
Kojto 112:6f327212ef96 855 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5))
Kojto 112:6f327212ef96 856 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 857
Kojto 112:6f327212ef96 858 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 859 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
Kojto 112:6f327212ef96 860 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
Kojto 112:6f327212ef96 861 ((SECTOR) == FLASH_SECTOR_4))
Kojto 112:6f327212ef96 862 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 863
Kojto 112:6f327212ef96 864 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 865 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
Kojto 112:6f327212ef96 866 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
Kojto 112:6f327212ef96 867 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
Kojto 112:6f327212ef96 868 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7))
Kojto 112:6f327212ef96 869 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 870
Kojto 112:6f327212ef96 871 #define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= FLASH_END))
Kojto 112:6f327212ef96 872 #define IS_FLASH_NBSECTORS(NBSECTORS) (((NBSECTORS) != 0) && ((NBSECTORS) <= FLASH_SECTOR_TOTAL))
Kojto 112:6f327212ef96 873
Kojto 112:6f327212ef96 874 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 875 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFF000000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 876 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 877
Kojto 112:6f327212ef96 878 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 112:6f327212ef96 879 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 880 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 112:6f327212ef96 881
Kojto 112:6f327212ef96 882 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 883 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 884 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 885
Kojto 112:6f327212ef96 886 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 887 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 888 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 889
Kojto 112:6f327212ef96 890 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 891 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 892 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 893
Kojto 112:6f327212ef96 894 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 895 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 896 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 897
Kojto 112:6f327212ef96 898 #if defined(STM32F401xC)
Kojto 112:6f327212ef96 899 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 900 #endif /* STM32F401xC */
Kojto 112:6f327212ef96 901
Kojto 112:6f327212ef96 902 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 112:6f327212ef96 903 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 904 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 112:6f327212ef96 905
Kojto 112:6f327212ef96 906 #if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx)
Kojto 112:6f327212ef96 907 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
Kojto 112:6f327212ef96 908 #endif /* STM32F401xE || STM32F411xE || STM32F446xx */
Kojto 112:6f327212ef96 909
Kojto 112:6f327212ef96 910 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 911 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 912 #define IS_OB_BOOT(BOOT) (((BOOT) == OB_DUAL_BOOT_ENABLE) || ((BOOT) == OB_DUAL_BOOT_DISABLE))
Kojto 112:6f327212ef96 913 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 914
Kojto 112:6f327212ef96 915 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 112:6f327212ef96 916 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) ||\
Kojto 112:6f327212ef96 917 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) ||\
Kojto 112:6f327212ef96 918 defined(STM32F479xx)
Kojto 112:6f327212ef96 919 #define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PCROP_SELECTED) || ((PCROP) == OB_PCROP_DESELECTED))
Kojto 112:6f327212ef96 920 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE ||\
Kojto 112:6f327212ef96 921 STM32F410xx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 922 /**
Kojto 112:6f327212ef96 923 * @}
Kojto 112:6f327212ef96 924 */
Kojto 112:6f327212ef96 925
Kojto 112:6f327212ef96 926 /**
Kojto 112:6f327212ef96 927 * @}
Kojto 112:6f327212ef96 928 */
Kojto 112:6f327212ef96 929
Kojto 112:6f327212ef96 930 /* Private functions ---------------------------------------------------------*/
Kojto 112:6f327212ef96 931 /** @defgroup FLASHEx_Private_Functions FLASH Private Functions
Kojto 112:6f327212ef96 932 * @{
Kojto 112:6f327212ef96 933 */
Kojto 112:6f327212ef96 934 void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange);
Kojto 112:6f327212ef96 935 /**
Kojto 112:6f327212ef96 936 * @}
Kojto 112:6f327212ef96 937 */
Kojto 112:6f327212ef96 938
Kojto 112:6f327212ef96 939 /**
Kojto 112:6f327212ef96 940 * @}
Kojto 112:6f327212ef96 941 */
Kojto 112:6f327212ef96 942
Kojto 112:6f327212ef96 943 /**
Kojto 112:6f327212ef96 944 * @}
Kojto 112:6f327212ef96 945 */
Kojto 112:6f327212ef96 946
Kojto 112:6f327212ef96 947 #ifdef __cplusplus
Kojto 112:6f327212ef96 948 }
Kojto 112:6f327212ef96 949 #endif
Kojto 112:6f327212ef96 950
Kojto 112:6f327212ef96 951 #endif /* __STM32F4xx_HAL_FLASH_EX_H */
Kojto 112:6f327212ef96 952
Kojto 112:6f327212ef96 953 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/