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