1 /**
2   ******************************************************************************
3   * @file    stm32f3xx_hal_flash_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of Flash HAL Extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2016 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file in
13   * the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   ******************************************************************************
16   */
17 
18 /* Define to prevent recursive inclusion -------------------------------------*/
19 #ifndef __STM32F3xx_HAL_FLASH_EX_H
20 #define __STM32F3xx_HAL_FLASH_EX_H
21 
22 #ifdef __cplusplus
23  extern "C" {
24 #endif
25 
26 /* Includes ------------------------------------------------------------------*/
27 #include "stm32f3xx_hal_def.h"
28 
29 /** @addtogroup STM32F3xx_HAL_Driver
30   * @{
31   */
32 
33 /** @addtogroup FLASHEx
34   * @{
35   */
36 
37 /** @addtogroup FLASHEx_Private_Constants
38   * @{
39   */
40 
41 #define FLASH_SIZE_DATA_REGISTER (0x1FFFF7CCU)
42 
43 /**
44   * @}
45   */
46 
47 /** @addtogroup FLASHEx_Private_Macros
48   * @{
49   */
50 #define IS_FLASH_TYPEERASE(VALUE) (((VALUE) == FLASH_TYPEERASE_PAGES) || \
51                              ((VALUE) == FLASH_TYPEERASE_MASSERASE))
52 
53 #define IS_OPTIONBYTE(VALUE) ((VALUE) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER | OPTIONBYTE_DATA))
54 
55 #define IS_WRPSTATE(VALUE) (((VALUE) == OB_WRPSTATE_DISABLE) || \
56                             ((VALUE) == OB_WRPSTATE_ENABLE))
57 
58 #define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == OB_DATA_ADDRESS_DATA0) || ((ADDRESS) == OB_DATA_ADDRESS_DATA1))
59 
60 #define IS_OB_RDP_LEVEL(LEVEL)     (((LEVEL) == OB_RDP_LEVEL_0)   ||\
61                                     ((LEVEL) == OB_RDP_LEVEL_1))/*||\
62                                     ((LEVEL) == OB_RDP_LEVEL_2))*/
63 
64 #define IS_OB_IWDG_SOURCE(SOURCE)  (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
65 
66 #define IS_OB_STOP_SOURCE(SOURCE)  (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
67 
68 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
69 
70 #define IS_OB_BOOT1(BOOT1)         (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET))
71 
72 #define IS_OB_VDDA_ANALOG(ANALOG)  (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF))
73 
74 #define IS_OB_SRAM_PARITY(PARITY)  (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET))
75 
76 
77 #if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
78 #define IS_OB_SDACD_VDD_MONITOR(VDD_MONITOR) (((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_SET) || \
79                                               ((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_RESET))
80 #endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
81 
82 #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000U))
83 
84 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
85  || defined(STM32F373xC) || defined(STM32F378xx)
86 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? \
87                                            ((ADDRESS) <= 0x0803FFFFU) :  (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? \
88                                            ((ADDRESS) <= 0x0801FFFFU) :  ((ADDRESS) <= 0x0800FFFFU))))
89 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
90        /* STM32F373xC || STM32F378xx */
91 
92 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
93 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= 0x0807FFFFU))
94 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
95 
96 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
97  || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
98 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? \
99                                            ((ADDRESS) <= 0x0800FFFFU) :  (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? \
100                                            ((ADDRESS) <= 0x08007FFFU) :  ((ADDRESS) <= 0x08003FFFU))))
101 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
102        /* STM32F303x8 || STM32F334x8 || STM32F328xx */
103 
104 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
105  || defined(STM32F373xC) || defined(STM32F378xx)
106 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0803FFFFU) : \
107                                            (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U)  ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0801FFFFU) : \
108                                             ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU)))
109 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
110        /* STM32F373xC || STM32F378xx */
111 
112 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
113 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0807FFFFU)
114 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
115 
116 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
117  || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
118 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU) : \
119                                            (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08007FFFU) : \
120                                             ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08003FFFU)))
121 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
122        /* STM32F303x8 || STM32F334x8 || STM32F328xx */
123 
124 /**
125   * @}
126   */
127 
128 /* Exported types ------------------------------------------------------------*/
129 /** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types
130   * @{
131   */
132 /**
133   * @brief  FLASH Erase structure definition
134   */
135 typedef struct
136 {
137   uint32_t TypeErase;   /*!< TypeErase: Mass erase or page erase.
138                              This parameter can be a value of @ref FLASHEx_Type_Erase */
139 
140   uint32_t PageAddress; /*!< PageAdress: Initial FLASH page address to erase when mass erase is disabled
141                              This parameter must be a number between Min_Data = FLASH_BASE and Max_Data = FLASH_BANK1_END */
142 
143   uint32_t NbPages;     /*!< NbPages: Number of pagess to be erased.
144                              This parameter must be a value between Min_Data = 1 and Max_Data = (max number of pages - value of initial page)*/
145 
146 } FLASH_EraseInitTypeDef;
147 
148 /**
149   * @brief  FLASH Options bytes program structure definition
150   */
151 typedef struct
152 {
153   uint32_t OptionType;  /*!< OptionType: Option byte to be configured.
154                              This parameter can be a value of @ref FLASHEx_OB_Type */
155 
156   uint32_t WRPState;    /*!< WRPState: Write protection activation or deactivation.
157                              This parameter can be a value of @ref FLASHEx_OB_WRP_State */
158 
159   uint32_t WRPPage;     /*!< WRPPage: specifies the page(s) to be write protected
160                              This parameter can be a value of @ref FLASHEx_OB_Write_Protection */
161 
162   uint8_t RDPLevel;     /*!< RDPLevel: Set the read protection level..
163                              This parameter can be a value of @ref FLASHEx_OB_Read_Protection */
164 
165   uint8_t USERConfig;   /*!< USERConfig: Program the FLASH User Option Byte:
166                              IWDG / STOP / STDBY / BOOT1 / VDDA_ANALOG / SRAM_PARITY / SDADC12_VDD_MONITOR
167                              This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP,
168                              @ref FLASHEx_OB_nRST_STDBY, @ref FLASHEx_OB_BOOT1, @ref FLASHEx_OB_VDDA_Analog_Monitoring,
169                              @ref FLASHEx_OB_RAM_Parity_Check_Enable.
170                              @if STM32F373xC
171                              And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
172                              @endif
173                              @if STM32F378xx
174                              And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
175                              @endif
176                              */
177 
178   uint32_t DATAAddress; /*!< DATAAddress: Address of the option byte DATA to be programmed
179                              This parameter can be a value of @ref FLASHEx_OB_Data_Address */
180 
181   uint8_t DATAData;     /*!< DATAData: Data to be stored in the option byte DATA
182                              This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFU */
183 } FLASH_OBProgramInitTypeDef;
184 /**
185   * @}
186   */
187 
188 /* Exported constants --------------------------------------------------------*/
189 /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
190   * @{
191   */
192 
193 /** @defgroup FLASHEx_Page_Size FLASHEx Page Size
194   * @{
195   */
196 #define FLASH_PAGE_SIZE          0x800
197 /**
198   * @}
199   */
200 
201 /** @defgroup FLASHEx_Type_Erase FLASH Type Erase
202   * @{
203   */
204 #define FLASH_TYPEERASE_PAGES     (0x00U)  /*!<Pages erase only*/
205 #define FLASH_TYPEERASE_MASSERASE (0x01U)  /*!<Flash mass erase activation*/
206 
207 /**
208   * @}
209   */
210 
211 /** @defgroup FLASHEx_OptionByte_Constants Option Byte Constants
212   * @{
213   */
214 
215 /** @defgroup FLASHEx_OB_Type Option Bytes Type
216   * @{
217   */
218 #define OPTIONBYTE_WRP       (0x01U)  /*!<WRP option byte configuration*/
219 #define OPTIONBYTE_RDP       (0x02U)  /*!<RDP option byte configuration*/
220 #define OPTIONBYTE_USER      (0x04U)  /*!<USER option byte configuration*/
221 #define OPTIONBYTE_DATA      (0x08U)  /*!<DATA option byte configuration*/
222 
223 /**
224   * @}
225   */
226 
227 /** @defgroup FLASHEx_OB_WRP_State Option Byte WRP State
228   * @{
229   */
230 #define OB_WRPSTATE_DISABLE   (0x00U)  /*!<Disable the write protection of the desired pages*/
231 #define OB_WRPSTATE_ENABLE    (0x01U)  /*!<Enable the write protection of the desired pagess*/
232 
233 /**
234   * @}
235   */
236 
237 /** @defgroup FLASHEx_OB_Write_Protection FLASHEx OB Write Protection
238   * @{
239   */
240 #define OB_WRP_PAGES0TO1               (0x00000001U) /* Write protection of page 0 to 1 */
241 #define OB_WRP_PAGES2TO3               (0x00000002U) /* Write protection of page 2 to 3 */
242 #define OB_WRP_PAGES4TO5               (0x00000004U) /* Write protection of page 4 to 5 */
243 #define OB_WRP_PAGES6TO7               (0x00000008U) /* Write protection of page 6 to 7 */
244 #define OB_WRP_PAGES8TO9               (0x00000010U) /* Write protection of page 8 to 9 */
245 #define OB_WRP_PAGES10TO11             (0x00000020U) /* Write protection of page 10 to 11 */
246 #define OB_WRP_PAGES12TO13             (0x00000040U) /* Write protection of page 12 to 13 */
247 #define OB_WRP_PAGES14TO15             (0x00000080U) /* Write protection of page 14 to 15 */
248 #define OB_WRP_PAGES16TO17             (0x00000100U) /* Write protection of page 16 to 17 */
249 #define OB_WRP_PAGES18TO19             (0x00000200U) /* Write protection of page 18 to 19 */
250 #define OB_WRP_PAGES20TO21             (0x00000400U) /* Write protection of page 20 to 21 */
251 #define OB_WRP_PAGES22TO23             (0x00000800U) /* Write protection of page 22 to 23 */
252 #define OB_WRP_PAGES24TO25             (0x00001000U) /* Write protection of page 24 to 25 */
253 #define OB_WRP_PAGES26TO27             (0x00002000U) /* Write protection of page 26 to 27 */
254 #define OB_WRP_PAGES28TO29             (0x00004000U) /* Write protection of page 28 to 29 */
255 #define OB_WRP_PAGES30TO31             (0x00008000U) /* Write protection of page 30 to 31 */
256 
257 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
258  || defined(STM32F373xC) || defined(STM32F378xx)
259 #define OB_WRP_PAGES32TO33             (0x00010000U) /* Write protection of page 32 to 33 */
260 #define OB_WRP_PAGES34TO35             (0x00020000U) /* Write protection of page 34 to 35 */
261 #define OB_WRP_PAGES36TO37             (0x00040000U) /* Write protection of page 36 to 37 */
262 #define OB_WRP_PAGES38TO39             (0x00080000U) /* Write protection of page 38 to 39 */
263 #define OB_WRP_PAGES40TO41             (0x00100000U) /* Write protection of page 40 to 41 */
264 #define OB_WRP_PAGES42TO43             (0x00200000U) /* Write protection of page 42 to 43 */
265 #define OB_WRP_PAGES44TO45             (0x00400000U) /* Write protection of page 44 to 45 */
266 #define OB_WRP_PAGES46TO47             (0x00800000U) /* Write protection of page 46 to 47 */
267 #define OB_WRP_PAGES48TO49             (0x01000000U) /* Write protection of page 48 to 49 */
268 #define OB_WRP_PAGES50TO51             (0x02000000U) /* Write protection of page 50 to 51 */
269 #define OB_WRP_PAGES52TO53             (0x04000000U) /* Write protection of page 52 to 53 */
270 #define OB_WRP_PAGES54TO55             (0x08000000U) /* Write protection of page 54 to 55 */
271 #define OB_WRP_PAGES56TO57             (0x10000000U) /* Write protection of page 56 to 57 */
272 #define OB_WRP_PAGES58TO59             (0x20000000U) /* Write protection of page 58 to 59 */
273 #define OB_WRP_PAGES60TO61             (0x40000000U) /* Write protection of page 60 to 61 */
274 #define OB_WRP_PAGES62TO127            (0x80000000U) /* Write protection of page 62 to 127 */
275 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
276        /* STM32F373xC || STM32F378xx                   */
277 
278 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
279 #define OB_WRP_PAGES32TO33             (0x00010000U) /* Write protection of page 32 to 33 */
280 #define OB_WRP_PAGES34TO35             (0x00020000U) /* Write protection of page 34 to 35 */
281 #define OB_WRP_PAGES36TO37             (0x00040000U) /* Write protection of page 36 to 37 */
282 #define OB_WRP_PAGES38TO39             (0x00080000U) /* Write protection of page 38 to 39 */
283 #define OB_WRP_PAGES40TO41             (0x00100000U) /* Write protection of page 40 to 41 */
284 #define OB_WRP_PAGES42TO43             (0x00200000U) /* Write protection of page 42 to 43 */
285 #define OB_WRP_PAGES44TO45             (0x00400000U) /* Write protection of page 44 to 45 */
286 #define OB_WRP_PAGES46TO47             (0x00800000U) /* Write protection of page 46 to 47 */
287 #define OB_WRP_PAGES48TO49             (0x01000000U) /* Write protection of page 48 to 49 */
288 #define OB_WRP_PAGES50TO51             (0x02000000U) /* Write protection of page 50 to 51 */
289 #define OB_WRP_PAGES52TO53             (0x04000000U) /* Write protection of page 52 to 53 */
290 #define OB_WRP_PAGES54TO55             (0x08000000U) /* Write protection of page 54 to 55 */
291 #define OB_WRP_PAGES56TO57             (0x10000000U) /* Write protection of page 56 to 57 */
292 #define OB_WRP_PAGES58TO59             (0x20000000U) /* Write protection of page 58 to 59 */
293 #define OB_WRP_PAGES60TO61             (0x40000000U) /* Write protection of page 60 to 61 */
294 #define OB_WRP_PAGES62TO255            (0x80000000U) /* Write protection of page 62 to 255 */
295 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
296 
297 #define OB_WRP_PAGES0TO15MASK          (0x000000FFU)
298 #define OB_WRP_PAGES16TO31MASK         (0x0000FF00U)
299 
300 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
301  || defined(STM32F373xC) || defined(STM32F378xx)
302 #define OB_WRP_PAGES32TO47MASK         (0x00FF0000U)
303 #define OB_WRP_PAGES48TO127MASK        (0xFF000000U)
304 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
305        /* STM32F373xC || STM32F378xx                   */
306 
307 #if defined(STM32F302xE) || defined(STM32F303xE)
308 #define OB_WRP_PAGES32TO47MASK         (0x00FF0000U)
309 #define OB_WRP_PAGES48TO255MASK        (0xFF000000U)
310 #endif /* STM32F302xE || STM32F303xE */
311 
312 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) \
313  || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
314  || defined(STM32F373xC) || defined(STM32F378xx)
315 #define OB_WRP_ALLPAGES                (0xFFFFFFFFU) /*!< Write protection of all pages */
316 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
317        /* STM32F302xC || STM32F303xC || STM32F358xx || */
318        /* STM32F373xC || STM32F378xx                   */
319 
320 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
321  || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
322 #define OB_WRP_ALLPAGES                (0x0000FFFFU) /*!< Write protection of all pages */
323 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
324        /* STM32F303x8 || STM32F334x8 || STM32F328xx    */
325 
326 /**
327   * @}
328   */
329 
330 /** @defgroup FLASHEx_OB_Read_Protection Option Byte Read Protection
331   * @{
332   */
333 #define OB_RDP_LEVEL_0             ((uint8_t)0xAAU)
334 #define OB_RDP_LEVEL_1             ((uint8_t)0xBBU)
335 #define OB_RDP_LEVEL_2             ((uint8_t)0xCCU) /*!< Warning: When enabling read protection level 2
336                                                       it's no more possible to go back to level 1 or 0U */
337 /**
338   * @}
339   */
340 
341 /** @defgroup FLASHEx_OB_IWatchdog Option Byte IWatchdog
342   * @{
343   */
344 #define OB_IWDG_SW                 ((uint8_t)0x01U)  /*!< Software IWDG selected */
345 #define OB_IWDG_HW                 ((uint8_t)0x00U)  /*!< Hardware IWDG selected */
346 /**
347   * @}
348   */
349 
350 /** @defgroup FLASHEx_OB_nRST_STOP Option Byte nRST STOP
351   * @{
352   */
353 #define OB_STOP_NO_RST             ((uint8_t)0x02U) /*!< No reset generated when entering in STOP */
354 #define OB_STOP_RST                ((uint8_t)0x00U) /*!< Reset generated when entering in STOP */
355 /**
356   * @}
357   */
358 
359 /** @defgroup FLASHEx_OB_nRST_STDBY Option Byte nRST STDBY
360   * @{
361   */
362 #define OB_STDBY_NO_RST            ((uint8_t)0x04U) /*!< No reset generated when entering in STANDBY */
363 #define OB_STDBY_RST               ((uint8_t)0x00U) /*!< Reset generated when entering in STANDBY */
364 /**
365   * @}
366   */
367 
368 /** @defgroup FLASHEx_OB_BOOT1 Option Byte BOOT1
369   * @{
370   */
371 #define OB_BOOT1_RESET             ((uint8_t)0x00U) /*!< BOOT1 Reset */
372 #define OB_BOOT1_SET               ((uint8_t)0x10U) /*!< BOOT1 Set */
373 /**
374   * @}
375   */
376 
377 /** @defgroup FLASHEx_OB_VDDA_Analog_Monitoring Option Byte VDDA Analog Monitoring
378   * @{
379   */
380 #define OB_VDDA_ANALOG_ON          ((uint8_t)0x20U) /*!< Analog monitoring on VDDA Power source ON */
381 #define OB_VDDA_ANALOG_OFF         ((uint8_t)0x00U) /*!< Analog monitoring on VDDA Power source OFF */
382 /**
383   * @}
384   */
385 
386 /** @defgroup FLASHEx_OB_RAM_Parity_Check_Enable Option Byte SRAM Parity Check Enable
387   * @{
388   */
389 #define OB_SRAM_PARITY_SET         ((uint8_t)0x00U) /*!< SRAM parity check enable set */
390 #define OB_SRAM_PARITY_RESET       ((uint8_t)0x40U) /*!< SRAM parity check enable reset */
391 /**
392   * @}
393   */
394 
395 
396 #if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
397 /** @defgroup FLASHEx_OB_SDADC12_VDD_MONITOR OB SDADC12 VDD MONITOR
398   * @{
399   */
400 #define OB_SDACD_VDD_MONITOR_RESET           ((uint8_t)0x00U) /*!< SDADC VDD Monitor reset */
401 #define OB_SDACD_VDD_MONITOR_SET             ((uint8_t)0x80U) /*!< SDADC VDD Monitor set */
402 
403 /**
404   * @}
405   */
406 #endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
407 
408 /** @defgroup FLASHEx_OB_Data_Address  Option Byte Data Address
409   * @{
410   */
411 #define OB_DATA_ADDRESS_DATA0     (0x1FFFF804U)
412 #define OB_DATA_ADDRESS_DATA1     (0x1FFFF806U)
413 /**
414   * @}
415   */
416 
417 /**
418   * @}
419   */
420 
421 /**
422   * @}
423   */
424 
425 /* Exported functions --------------------------------------------------------*/
426 /** @addtogroup FLASHEx_Exported_Functions
427   * @{
428   */
429 
430 /** @addtogroup FLASHEx_Exported_Functions_Group1
431   * @{
432   */
433 /* IO operation functions *****************************************************/
434 HAL_StatusTypeDef  HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
435 HAL_StatusTypeDef  HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
436 
437 /**
438   * @}
439   */
440 
441 /** @addtogroup FLASHEx_Exported_Functions_Group2
442   * @{
443   */
444 /* Peripheral Control functions ***********************************************/
445 HAL_StatusTypeDef  HAL_FLASHEx_OBErase(void);
446 HAL_StatusTypeDef  HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
447 void               HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
448 uint32_t           HAL_FLASHEx_OBGetUserData(uint32_t DATAAdress);
449 
450 /**
451   * @}
452   */
453 
454 /**
455   * @}
456   */
457 
458 /**
459   * @}
460   */
461 
462 /**
463   * @}
464   */
465 
466 #ifdef __cplusplus
467 }
468 #endif
469 
470 #endif /* __STM32F3xx_HAL_FLASH_EX_H */
471 
472 
473