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