F1 and F3 HAL / LL libraries
[betaflight.git] / lib / main / STM32F3 / Drivers / STM32F3xx_HAL_Driver / Inc / stm32f3xx_hal_flash_ex.h
blobe46258036b739b4c57d19584ac62b0c533c4d9e1
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
9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 ******************************************************************************
36 /* Define to prevent recursive inclusion -------------------------------------*/
37 #ifndef __STM32F3xx_HAL_FLASH_EX_H
38 #define __STM32F3xx_HAL_FLASH_EX_H
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 /* Includes ------------------------------------------------------------------*/
45 #include "stm32f3xx_hal_def.h"
47 /** @addtogroup STM32F3xx_HAL_Driver
48 * @{
51 /** @addtogroup FLASHEx
52 * @{
53 */
55 /** @addtogroup FLASHEx_Private_Constants
56 * @{
59 #define FLASH_SIZE_DATA_REGISTER (0x1FFFF7CCU)
61 /**
62 * @}
63 */
65 /** @addtogroup FLASHEx_Private_Macros
66 * @{
68 #define IS_FLASH_TYPEERASE(VALUE) (((VALUE) == FLASH_TYPEERASE_PAGES) || \
69 ((VALUE) == FLASH_TYPEERASE_MASSERASE))
71 #define IS_OPTIONBYTE(VALUE) ((VALUE) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER | OPTIONBYTE_DATA))
73 #define IS_WRPSTATE(VALUE) (((VALUE) == OB_WRPSTATE_DISABLE) || \
74 ((VALUE) == OB_WRPSTATE_ENABLE))
76 #define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == OB_DATA_ADDRESS_DATA0) || ((ADDRESS) == OB_DATA_ADDRESS_DATA1))
78 #define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\
79 ((LEVEL) == OB_RDP_LEVEL_1))/*||\
80 ((LEVEL) == OB_RDP_LEVEL_2))*/
82 #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
84 #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
86 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
88 #define IS_OB_BOOT1(BOOT1) (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET))
90 #define IS_OB_VDDA_ANALOG(ANALOG) (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF))
92 #define IS_OB_SRAM_PARITY(PARITY) (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET))
95 #if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
96 #define IS_OB_SDACD_VDD_MONITOR(VDD_MONITOR) (((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_SET) || \
97 ((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_RESET))
98 #endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
100 #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000U))
102 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
103 || defined(STM32F373xC) || defined(STM32F378xx)
104 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? \
105 ((ADDRESS) <= 0x0803FFFFU) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? \
106 ((ADDRESS) <= 0x0801FFFFU) : ((ADDRESS) <= 0x0800FFFFU))))
107 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
108 /* STM32F373xC || STM32F378xx */
110 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
111 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= 0x0807FFFFU))
112 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
114 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
115 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
116 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? \
117 ((ADDRESS) <= 0x0800FFFFU) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? \
118 ((ADDRESS) <= 0x08007FFFU) : ((ADDRESS) <= 0x08003FFFU))))
119 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
120 /* STM32F303x8 || STM32F334x8 || STM32F328xx */
122 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
123 || defined(STM32F373xC) || defined(STM32F378xx)
124 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0803FFFFU) : \
125 (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0801FFFFU) : \
126 ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU)))
127 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
128 /* STM32F373xC || STM32F378xx */
130 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
131 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0807FFFFU)
132 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
134 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
135 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
136 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU) : \
137 (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08007FFFU) : \
138 ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08003FFFU)))
139 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
140 /* STM32F303x8 || STM32F334x8 || STM32F328xx */
143 * @}
146 /* Exported types ------------------------------------------------------------*/
147 /** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types
148 * @{
151 * @brief FLASH Erase structure definition
153 typedef struct
155 uint32_t TypeErase; /*!< TypeErase: Mass erase or page erase.
156 This parameter can be a value of @ref FLASHEx_Type_Erase */
158 uint32_t PageAddress; /*!< PageAdress: Initial FLASH page address to erase when mass erase is disabled
159 This parameter must be a number between Min_Data = FLASH_BASE and Max_Data = FLASH_BANK1_END */
161 uint32_t NbPages; /*!< NbPages: Number of pagess to be erased.
162 This parameter must be a value between Min_Data = 1 and Max_Data = (max number of pages - value of initial page)*/
164 } FLASH_EraseInitTypeDef;
167 * @brief FLASH Options bytes program structure definition
169 typedef struct
171 uint32_t OptionType; /*!< OptionType: Option byte to be configured.
172 This parameter can be a value of @ref FLASHEx_OB_Type */
174 uint32_t WRPState; /*!< WRPState: Write protection activation or deactivation.
175 This parameter can be a value of @ref FLASHEx_OB_WRP_State */
177 uint32_t WRPPage; /*!< WRPPage: specifies the page(s) to be write protected
178 This parameter can be a value of @ref FLASHEx_OB_Write_Protection */
180 uint8_t RDPLevel; /*!< RDPLevel: Set the read protection level..
181 This parameter can be a value of @ref FLASHEx_OB_Read_Protection */
183 uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte:
184 IWDG / STOP / STDBY / BOOT1 / VDDA_ANALOG / SRAM_PARITY / SDADC12_VDD_MONITOR
185 This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP,
186 @ref FLASHEx_OB_nRST_STDBY, @ref FLASHEx_OB_BOOT1, @ref FLASHEx_OB_VDDA_Analog_Monitoring,
187 @ref FLASHEx_OB_RAM_Parity_Check_Enable.
188 @if STM32F373xC
189 And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
190 @endif
191 @if STM32F378xx
192 And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
193 @endif
196 uint32_t DATAAddress; /*!< DATAAddress: Address of the option byte DATA to be programmed
197 This parameter can be a value of @ref FLASHEx_OB_Data_Address */
199 uint8_t DATAData; /*!< DATAData: Data to be stored in the option byte DATA
200 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFU */
201 } FLASH_OBProgramInitTypeDef;
203 * @}
206 /* Exported constants --------------------------------------------------------*/
207 /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
208 * @{
211 /** @defgroup FLASHEx_Page_Size FLASHEx Page Size
212 * @{
214 #define FLASH_PAGE_SIZE 0x800
216 * @}
219 /** @defgroup FLASHEx_Type_Erase FLASH Type Erase
220 * @{
222 #define FLASH_TYPEERASE_PAGES (0x00U) /*!<Pages erase only*/
223 #define FLASH_TYPEERASE_MASSERASE (0x01U) /*!<Flash mass erase activation*/
226 * @}
229 /** @defgroup FLASHEx_OptionByte_Constants Option Byte Constants
230 * @{
233 /** @defgroup FLASHEx_OB_Type Option Bytes Type
234 * @{
236 #define OPTIONBYTE_WRP (0x01U) /*!<WRP option byte configuration*/
237 #define OPTIONBYTE_RDP (0x02U) /*!<RDP option byte configuration*/
238 #define OPTIONBYTE_USER (0x04U) /*!<USER option byte configuration*/
239 #define OPTIONBYTE_DATA (0x08U) /*!<DATA option byte configuration*/
242 * @}
245 /** @defgroup FLASHEx_OB_WRP_State Option Byte WRP State
246 * @{
248 #define OB_WRPSTATE_DISABLE (0x00U) /*!<Disable the write protection of the desired pages*/
249 #define OB_WRPSTATE_ENABLE (0x01U) /*!<Enable the write protection of the desired pagess*/
252 * @}
255 /** @defgroup FLASHEx_OB_Write_Protection FLASHEx OB Write Protection
256 * @{
258 #define OB_WRP_PAGES0TO1 (0x00000001U) /* Write protection of page 0 to 1 */
259 #define OB_WRP_PAGES2TO3 (0x00000002U) /* Write protection of page 2 to 3 */
260 #define OB_WRP_PAGES4TO5 (0x00000004U) /* Write protection of page 4 to 5 */
261 #define OB_WRP_PAGES6TO7 (0x00000008U) /* Write protection of page 6 to 7 */
262 #define OB_WRP_PAGES8TO9 (0x00000010U) /* Write protection of page 8 to 9 */
263 #define OB_WRP_PAGES10TO11 (0x00000020U) /* Write protection of page 10 to 11 */
264 #define OB_WRP_PAGES12TO13 (0x00000040U) /* Write protection of page 12 to 13 */
265 #define OB_WRP_PAGES14TO15 (0x00000080U) /* Write protection of page 14 to 15 */
266 #define OB_WRP_PAGES16TO17 (0x00000100U) /* Write protection of page 16 to 17 */
267 #define OB_WRP_PAGES18TO19 (0x00000200U) /* Write protection of page 18 to 19 */
268 #define OB_WRP_PAGES20TO21 (0x00000400U) /* Write protection of page 20 to 21 */
269 #define OB_WRP_PAGES22TO23 (0x00000800U) /* Write protection of page 22 to 23 */
270 #define OB_WRP_PAGES24TO25 (0x00001000U) /* Write protection of page 24 to 25 */
271 #define OB_WRP_PAGES26TO27 (0x00002000U) /* Write protection of page 26 to 27 */
272 #define OB_WRP_PAGES28TO29 (0x00004000U) /* Write protection of page 28 to 29 */
273 #define OB_WRP_PAGES30TO31 (0x00008000U) /* Write protection of page 30 to 31 */
275 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
276 || defined(STM32F373xC) || defined(STM32F378xx)
277 #define OB_WRP_PAGES32TO33 (0x00010000U) /* Write protection of page 32 to 33 */
278 #define OB_WRP_PAGES34TO35 (0x00020000U) /* Write protection of page 34 to 35 */
279 #define OB_WRP_PAGES36TO37 (0x00040000U) /* Write protection of page 36 to 37 */
280 #define OB_WRP_PAGES38TO39 (0x00080000U) /* Write protection of page 38 to 39 */
281 #define OB_WRP_PAGES40TO41 (0x00100000U) /* Write protection of page 40 to 41 */
282 #define OB_WRP_PAGES42TO43 (0x00200000U) /* Write protection of page 42 to 43 */
283 #define OB_WRP_PAGES44TO45 (0x00400000U) /* Write protection of page 44 to 45 */
284 #define OB_WRP_PAGES46TO47 (0x00800000U) /* Write protection of page 46 to 47 */
285 #define OB_WRP_PAGES48TO49 (0x01000000U) /* Write protection of page 48 to 49 */
286 #define OB_WRP_PAGES50TO51 (0x02000000U) /* Write protection of page 50 to 51 */
287 #define OB_WRP_PAGES52TO53 (0x04000000U) /* Write protection of page 52 to 53 */
288 #define OB_WRP_PAGES54TO55 (0x08000000U) /* Write protection of page 54 to 55 */
289 #define OB_WRP_PAGES56TO57 (0x10000000U) /* Write protection of page 56 to 57 */
290 #define OB_WRP_PAGES58TO59 (0x20000000U) /* Write protection of page 58 to 59 */
291 #define OB_WRP_PAGES60TO61 (0x40000000U) /* Write protection of page 60 to 61 */
292 #define OB_WRP_PAGES62TO127 (0x80000000U) /* Write protection of page 62 to 127 */
293 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
294 /* STM32F373xC || STM32F378xx */
296 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
297 #define OB_WRP_PAGES32TO33 (0x00010000U) /* Write protection of page 32 to 33 */
298 #define OB_WRP_PAGES34TO35 (0x00020000U) /* Write protection of page 34 to 35 */
299 #define OB_WRP_PAGES36TO37 (0x00040000U) /* Write protection of page 36 to 37 */
300 #define OB_WRP_PAGES38TO39 (0x00080000U) /* Write protection of page 38 to 39 */
301 #define OB_WRP_PAGES40TO41 (0x00100000U) /* Write protection of page 40 to 41 */
302 #define OB_WRP_PAGES42TO43 (0x00200000U) /* Write protection of page 42 to 43 */
303 #define OB_WRP_PAGES44TO45 (0x00400000U) /* Write protection of page 44 to 45 */
304 #define OB_WRP_PAGES46TO47 (0x00800000U) /* Write protection of page 46 to 47 */
305 #define OB_WRP_PAGES48TO49 (0x01000000U) /* Write protection of page 48 to 49 */
306 #define OB_WRP_PAGES50TO51 (0x02000000U) /* Write protection of page 50 to 51 */
307 #define OB_WRP_PAGES52TO53 (0x04000000U) /* Write protection of page 52 to 53 */
308 #define OB_WRP_PAGES54TO55 (0x08000000U) /* Write protection of page 54 to 55 */
309 #define OB_WRP_PAGES56TO57 (0x10000000U) /* Write protection of page 56 to 57 */
310 #define OB_WRP_PAGES58TO59 (0x20000000U) /* Write protection of page 58 to 59 */
311 #define OB_WRP_PAGES60TO61 (0x40000000U) /* Write protection of page 60 to 61 */
312 #define OB_WRP_PAGES62TO255 (0x80000000U) /* Write protection of page 62 to 255 */
313 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
315 #define OB_WRP_PAGES0TO15MASK (0x000000FFU)
316 #define OB_WRP_PAGES16TO31MASK (0x0000FF00U)
318 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
319 || defined(STM32F373xC) || defined(STM32F378xx)
320 #define OB_WRP_PAGES32TO47MASK (0x00FF0000U)
321 #define OB_WRP_PAGES48TO127MASK (0xFF000000U)
322 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
323 /* STM32F373xC || STM32F378xx */
325 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
326 #define OB_WRP_PAGES32TO47MASK (0x00FF0000U)
327 #define OB_WRP_PAGES48TO255MASK (0xFF000000U)
328 #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
330 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
331 || defined(STM32F373xC) || defined(STM32F378xx)
332 #define OB_WRP_PAGES32TO47MASK (0x00FF0000U)
333 #define OB_WRP_PAGES48TO127MASK (0xFF000000U)
334 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
335 /* STM32F373xC || STM32F378xx */
337 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) \
338 || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
339 || defined(STM32F373xC) || defined(STM32F378xx)
340 #define OB_WRP_ALLPAGES (0xFFFFFFFFU) /*!< Write protection of all pages */
341 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
342 /* STM32F302xC || STM32F303xC || STM32F358xx || */
343 /* STM32F373xC || STM32F378xx */
345 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
346 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
347 #define OB_WRP_ALLPAGES (0x0000FFFFU) /*!< Write protection of all pages */
348 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
349 /* STM32F303x8 || STM32F334x8 || STM32F328xx */
352 * @}
355 /** @defgroup FLASHEx_OB_Read_Protection Option Byte Read Protection
356 * @{
358 #define OB_RDP_LEVEL_0 ((uint8_t)0xAAU)
359 #define OB_RDP_LEVEL_1 ((uint8_t)0xBBU)
360 #define OB_RDP_LEVEL_2 ((uint8_t)0xCCU) /*!< Warning: When enabling read protection level 2
361 it's no more possible to go back to level 1 or 0U */
363 * @}
366 /** @defgroup FLASHEx_OB_IWatchdog Option Byte IWatchdog
367 * @{
369 #define OB_IWDG_SW ((uint8_t)0x01U) /*!< Software IWDG selected */
370 #define OB_IWDG_HW ((uint8_t)0x00U) /*!< Hardware IWDG selected */
372 * @}
375 /** @defgroup FLASHEx_OB_nRST_STOP Option Byte nRST STOP
376 * @{
378 #define OB_STOP_NO_RST ((uint8_t)0x02U) /*!< No reset generated when entering in STOP */
379 #define OB_STOP_RST ((uint8_t)0x00U) /*!< Reset generated when entering in STOP */
381 * @}
384 /** @defgroup FLASHEx_OB_nRST_STDBY Option Byte nRST STDBY
385 * @{
387 #define OB_STDBY_NO_RST ((uint8_t)0x04U) /*!< No reset generated when entering in STANDBY */
388 #define OB_STDBY_RST ((uint8_t)0x00U) /*!< Reset generated when entering in STANDBY */
390 * @}
393 /** @defgroup FLASHEx_OB_BOOT1 Option Byte BOOT1
394 * @{
396 #define OB_BOOT1_RESET ((uint8_t)0x00U) /*!< BOOT1 Reset */
397 #define OB_BOOT1_SET ((uint8_t)0x10U) /*!< BOOT1 Set */
399 * @}
402 /** @defgroup FLASHEx_OB_VDDA_Analog_Monitoring Option Byte VDDA Analog Monitoring
403 * @{
405 #define OB_VDDA_ANALOG_ON ((uint8_t)0x20U) /*!< Analog monitoring on VDDA Power source ON */
406 #define OB_VDDA_ANALOG_OFF ((uint8_t)0x00U) /*!< Analog monitoring on VDDA Power source OFF */
408 * @}
411 /** @defgroup FLASHEx_OB_RAM_Parity_Check_Enable Option Byte SRAM Parity Check Enable
412 * @{
414 #define OB_SRAM_PARITY_SET ((uint8_t)0x00U) /*!< SRAM parity check enable set */
415 #define OB_SRAM_PARITY_RESET ((uint8_t)0x40U) /*!< SRAM parity check enable reset */
417 * @}
421 #if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
422 /** @defgroup FLASHEx_OB_SDADC12_VDD_MONITOR OB SDADC12 VDD MONITOR
423 * @{
425 #define OB_SDACD_VDD_MONITOR_RESET ((uint8_t)0x00U) /*!< SDADC VDD Monitor reset */
426 #define OB_SDACD_VDD_MONITOR_SET ((uint8_t)0x80U) /*!< SDADC VDD Monitor set */
429 * @}
431 #endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
433 /** @defgroup FLASHEx_OB_Data_Address Option Byte Data Address
434 * @{
436 #define OB_DATA_ADDRESS_DATA0 (0x1FFFF804U)
437 #define OB_DATA_ADDRESS_DATA1 (0x1FFFF806U)
439 * @}
443 * @}
447 * @}
450 /* Exported functions --------------------------------------------------------*/
451 /** @addtogroup FLASHEx_Exported_Functions
452 * @{
455 /** @addtogroup FLASHEx_Exported_Functions_Group1
456 * @{
458 /* IO operation functions *****************************************************/
459 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
460 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
463 * @}
466 /** @addtogroup FLASHEx_Exported_Functions_Group2
467 * @{
469 /* Peripheral Control functions ***********************************************/
470 HAL_StatusTypeDef HAL_FLASHEx_OBErase(void);
471 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
472 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
473 uint32_t HAL_FLASHEx_OBGetUserData(uint32_t DATAAdress);
476 * @}
480 * @}
484 * @}
488 * @}
491 #ifdef __cplusplus
493 #endif
495 #endif /* __STM32F3xx_HAL_FLASH_EX_H */
497 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/