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