CARME-M4 BSP  V1.5
stm32f4xx_flash.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F4xx_FLASH_H
31 #define __STM32F4xx_FLASH_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
39 
48 /* Exported types ------------------------------------------------------------*/
52 typedef enum
53 {
54  FLASH_BUSY = 1,
55  FLASH_ERROR_RD,
56  FLASH_ERROR_PGS,
57  FLASH_ERROR_PGP,
58  FLASH_ERROR_PGA,
59  FLASH_ERROR_WRP,
60  FLASH_ERROR_PROGRAM,
61  FLASH_ERROR_OPERATION,
62  FLASH_COMPLETE
64 
65 /* Exported constants --------------------------------------------------------*/
66 
74 #define FLASH_Latency_0 ((uint8_t)0x0000)
75 #define FLASH_Latency_1 ((uint8_t)0x0001)
76 #define FLASH_Latency_2 ((uint8_t)0x0002)
77 #define FLASH_Latency_3 ((uint8_t)0x0003)
78 #define FLASH_Latency_4 ((uint8_t)0x0004)
79 #define FLASH_Latency_5 ((uint8_t)0x0005)
80 #define FLASH_Latency_6 ((uint8_t)0x0006)
81 #define FLASH_Latency_7 ((uint8_t)0x0007)
82 #define FLASH_Latency_8 ((uint8_t)0x0008)
83 #define FLASH_Latency_9 ((uint8_t)0x0009)
84 #define FLASH_Latency_10 ((uint8_t)0x000A)
85 #define FLASH_Latency_11 ((uint8_t)0x000B)
86 #define FLASH_Latency_12 ((uint8_t)0x000C)
87 #define FLASH_Latency_13 ((uint8_t)0x000D)
88 #define FLASH_Latency_14 ((uint8_t)0x000E)
89 #define FLASH_Latency_15 ((uint8_t)0x000F)
92 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_Latency_0) || \
93  ((LATENCY) == FLASH_Latency_1) || \
94  ((LATENCY) == FLASH_Latency_2) || \
95  ((LATENCY) == FLASH_Latency_3) || \
96  ((LATENCY) == FLASH_Latency_4) || \
97  ((LATENCY) == FLASH_Latency_5) || \
98  ((LATENCY) == FLASH_Latency_6) || \
99  ((LATENCY) == FLASH_Latency_7) || \
100  ((LATENCY) == FLASH_Latency_8) || \
101  ((LATENCY) == FLASH_Latency_9) || \
102  ((LATENCY) == FLASH_Latency_10) || \
103  ((LATENCY) == FLASH_Latency_11) || \
104  ((LATENCY) == FLASH_Latency_12) || \
105  ((LATENCY) == FLASH_Latency_13) || \
106  ((LATENCY) == FLASH_Latency_14) || \
107  ((LATENCY) == FLASH_Latency_15))
108 
115 #define VoltageRange_1 ((uint8_t)0x00)
116 #define VoltageRange_2 ((uint8_t)0x01)
117 #define VoltageRange_3 ((uint8_t)0x02)
118 #define VoltageRange_4 ((uint8_t)0x03)
120 #define IS_VOLTAGERANGE(RANGE)(((RANGE) == VoltageRange_1) || \
121  ((RANGE) == VoltageRange_2) || \
122  ((RANGE) == VoltageRange_3) || \
123  ((RANGE) == VoltageRange_4))
124 
131 #define FLASH_Sector_0 ((uint16_t)0x0000)
132 #define FLASH_Sector_1 ((uint16_t)0x0008)
133 #define FLASH_Sector_2 ((uint16_t)0x0010)
134 #define FLASH_Sector_3 ((uint16_t)0x0018)
135 #define FLASH_Sector_4 ((uint16_t)0x0020)
136 #define FLASH_Sector_5 ((uint16_t)0x0028)
137 #define FLASH_Sector_6 ((uint16_t)0x0030)
138 #define FLASH_Sector_7 ((uint16_t)0x0038)
139 #define FLASH_Sector_8 ((uint16_t)0x0040)
140 #define FLASH_Sector_9 ((uint16_t)0x0048)
141 #define FLASH_Sector_10 ((uint16_t)0x0050)
142 #define FLASH_Sector_11 ((uint16_t)0x0058)
143 #define FLASH_Sector_12 ((uint16_t)0x0080)
144 #define FLASH_Sector_13 ((uint16_t)0x0088)
145 #define FLASH_Sector_14 ((uint16_t)0x0090)
146 #define FLASH_Sector_15 ((uint16_t)0x0098)
147 #define FLASH_Sector_16 ((uint16_t)0x00A0)
148 #define FLASH_Sector_17 ((uint16_t)0x00A8)
149 #define FLASH_Sector_18 ((uint16_t)0x00B0)
150 #define FLASH_Sector_19 ((uint16_t)0x00B8)
151 #define FLASH_Sector_20 ((uint16_t)0x00C0)
152 #define FLASH_Sector_21 ((uint16_t)0x00C8)
153 #define FLASH_Sector_22 ((uint16_t)0x00D0)
154 #define FLASH_Sector_23 ((uint16_t)0x00D8)
156 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_Sector_0) || ((SECTOR) == FLASH_Sector_1) ||\
157  ((SECTOR) == FLASH_Sector_2) || ((SECTOR) == FLASH_Sector_3) ||\
158  ((SECTOR) == FLASH_Sector_4) || ((SECTOR) == FLASH_Sector_5) ||\
159  ((SECTOR) == FLASH_Sector_6) || ((SECTOR) == FLASH_Sector_7) ||\
160  ((SECTOR) == FLASH_Sector_8) || ((SECTOR) == FLASH_Sector_9) ||\
161  ((SECTOR) == FLASH_Sector_10) || ((SECTOR) == FLASH_Sector_11) ||\
162  ((SECTOR) == FLASH_Sector_12) || ((SECTOR) == FLASH_Sector_13) ||\
163  ((SECTOR) == FLASH_Sector_14) || ((SECTOR) == FLASH_Sector_15) ||\
164  ((SECTOR) == FLASH_Sector_16) || ((SECTOR) == FLASH_Sector_17) ||\
165  ((SECTOR) == FLASH_Sector_18) || ((SECTOR) == FLASH_Sector_19) ||\
166  ((SECTOR) == FLASH_Sector_20) || ((SECTOR) == FLASH_Sector_21) ||\
167  ((SECTOR) == FLASH_Sector_22) || ((SECTOR) == FLASH_Sector_23))
168 
169 #if defined (STM32F427_437xx) || defined (STM32F429_439xx)
170 #define IS_FLASH_ADDRESS(ADDRESS) ((((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x081FFFFF)) ||\
171  (((ADDRESS) >= 0x1FFF7800) && ((ADDRESS) < 0x1FFF7A0F)))
172 #endif /* STM32F427_437xx || STM32F429_439xx */
173 
174 #if defined (STM32F40_41xxx)
175 #define IS_FLASH_ADDRESS(ADDRESS) ((((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x080FFFFF)) ||\
176  (((ADDRESS) >= 0x1FFF7800) && ((ADDRESS) < 0x1FFF7A0F)))
177 #endif /* STM32F40_41xxx */
178 
179 #if defined (STM32F401xx)
180 #define IS_FLASH_ADDRESS(ADDRESS) ((((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x0803FFFF)) ||\
181  (((ADDRESS) >= 0x1FFF7800) && ((ADDRESS) < 0x1FFF7A0F)))
182 #endif /* STM32F401xx */
183 
190 #define OB_WRP_Sector_0 ((uint32_t)0x00000001)
191 #define OB_WRP_Sector_1 ((uint32_t)0x00000002)
192 #define OB_WRP_Sector_2 ((uint32_t)0x00000004)
193 #define OB_WRP_Sector_3 ((uint32_t)0x00000008)
194 #define OB_WRP_Sector_4 ((uint32_t)0x00000010)
195 #define OB_WRP_Sector_5 ((uint32_t)0x00000020)
196 #define OB_WRP_Sector_6 ((uint32_t)0x00000040)
197 #define OB_WRP_Sector_7 ((uint32_t)0x00000080)
198 #define OB_WRP_Sector_8 ((uint32_t)0x00000100)
199 #define OB_WRP_Sector_9 ((uint32_t)0x00000200)
200 #define OB_WRP_Sector_10 ((uint32_t)0x00000400)
201 #define OB_WRP_Sector_11 ((uint32_t)0x00000800)
202 #define OB_WRP_Sector_12 ((uint32_t)0x00000001)
203 #define OB_WRP_Sector_13 ((uint32_t)0x00000002)
204 #define OB_WRP_Sector_14 ((uint32_t)0x00000004)
205 #define OB_WRP_Sector_15 ((uint32_t)0x00000008)
206 #define OB_WRP_Sector_16 ((uint32_t)0x00000010)
207 #define OB_WRP_Sector_17 ((uint32_t)0x00000020)
208 #define OB_WRP_Sector_18 ((uint32_t)0x00000040)
209 #define OB_WRP_Sector_19 ((uint32_t)0x00000080)
210 #define OB_WRP_Sector_20 ((uint32_t)0x00000100)
211 #define OB_WRP_Sector_21 ((uint32_t)0x00000200)
212 #define OB_WRP_Sector_22 ((uint32_t)0x00000400)
213 #define OB_WRP_Sector_23 ((uint32_t)0x00000800)
214 #define OB_WRP_Sector_All ((uint32_t)0x00000FFF)
216 #define IS_OB_WRP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
217 
224 #define OB_PcROP_Disable ((uint8_t)0x00)
225 #define OB_PcROP_Enable ((uint8_t)0x80)
226 #define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PcROP_Disable) || ((PCROP) == OB_PcROP_Enable))
227 
234 #define OB_PCROP_Sector_0 ((uint32_t)0x00000001)
235 #define OB_PCROP_Sector_1 ((uint32_t)0x00000002)
236 #define OB_PCROP_Sector_2 ((uint32_t)0x00000004)
237 #define OB_PCROP_Sector_3 ((uint32_t)0x00000008)
238 #define OB_PCROP_Sector_4 ((uint32_t)0x00000010)
239 #define OB_PCROP_Sector_5 ((uint32_t)0x00000020)
240 #define OB_PCROP_Sector_6 ((uint32_t)0x00000040)
241 #define OB_PCROP_Sector_7 ((uint32_t)0x00000080)
242 #define OB_PCROP_Sector_8 ((uint32_t)0x00000100)
243 #define OB_PCROP_Sector_9 ((uint32_t)0x00000200)
244 #define OB_PCROP_Sector_10 ((uint32_t)0x00000400)
245 #define OB_PCROP_Sector_11 ((uint32_t)0x00000800)
246 #define OB_PCROP_Sector_12 ((uint32_t)0x00000001)
247 #define OB_PCROP_Sector_13 ((uint32_t)0x00000002)
248 #define OB_PCROP_Sector_14 ((uint32_t)0x00000004)
249 #define OB_PCROP_Sector_15 ((uint32_t)0x00000008)
250 #define OB_PCROP_Sector_16 ((uint32_t)0x00000010)
251 #define OB_PCROP_Sector_17 ((uint32_t)0x00000020)
252 #define OB_PCROP_Sector_18 ((uint32_t)0x00000040)
253 #define OB_PCROP_Sector_19 ((uint32_t)0x00000080)
254 #define OB_PCROP_Sector_20 ((uint32_t)0x00000100)
255 #define OB_PCROP_Sector_21 ((uint32_t)0x00000200)
256 #define OB_PCROP_Sector_22 ((uint32_t)0x00000400)
257 #define OB_PCROP_Sector_23 ((uint32_t)0x00000800)
258 #define OB_PCROP_Sector_All ((uint32_t)0x00000FFF)
260 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
261 
268 #define OB_RDP_Level_0 ((uint8_t)0xAA)
269 #define OB_RDP_Level_1 ((uint8_t)0x55)
270 /*#define OB_RDP_Level_2 ((uint8_t)0xCC)*/
272 #define IS_OB_RDP(LEVEL) (((LEVEL) == OB_RDP_Level_0)||\
273  ((LEVEL) == OB_RDP_Level_1))/*||\
274  ((LEVEL) == OB_RDP_Level_2))*/
275 
282 #define OB_IWDG_SW ((uint8_t)0x20)
283 #define OB_IWDG_HW ((uint8_t)0x00)
284 #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
285 
292 #define OB_STOP_NoRST ((uint8_t)0x40)
293 #define OB_STOP_RST ((uint8_t)0x00)
294 #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NoRST) || ((SOURCE) == OB_STOP_RST))
295 
303 #define OB_STDBY_NoRST ((uint8_t)0x80)
304 #define OB_STDBY_RST ((uint8_t)0x00)
305 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NoRST) || ((SOURCE) == OB_STDBY_RST))
306 
313 #define OB_BOR_LEVEL3 ((uint8_t)0x00)
314 #define OB_BOR_LEVEL2 ((uint8_t)0x04)
315 #define OB_BOR_LEVEL1 ((uint8_t)0x08)
316 #define OB_BOR_OFF ((uint8_t)0x0C)
317 #define IS_OB_BOR(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\
318  ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF))
319 
326 #define OB_Dual_BootEnabled ((uint8_t)0x10)
327 #define OB_Dual_BootDisabled ((uint8_t)0x00)
328 #define IS_OB_BOOT(BOOT) (((BOOT) == OB_Dual_BootEnabled) || ((BOOT) == OB_Dual_BootDisabled))
329 
336 #define FLASH_IT_EOP ((uint32_t)0x01000000)
337 #define FLASH_IT_ERR ((uint32_t)0x02000000)
338 #define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0xFCFFFFFF) == 0x00000000) && ((IT) != 0x00000000))
339 
346 #define FLASH_FLAG_EOP ((uint32_t)0x00000001)
347 #define FLASH_FLAG_OPERR ((uint32_t)0x00000002)
348 #define FLASH_FLAG_WRPERR ((uint32_t)0x00000010)
349 #define FLASH_FLAG_PGAERR ((uint32_t)0x00000020)
350 #define FLASH_FLAG_PGPERR ((uint32_t)0x00000040)
351 #define FLASH_FLAG_PGSERR ((uint32_t)0x00000080)
352 #define FLASH_FLAG_RDERR ((uint32_t)0x00000100)
353 #define FLASH_FLAG_BSY ((uint32_t)0x00010000)
354 #define IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFE0C) == 0x00000000) && ((FLAG) != 0x00000000))
355 #define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_EOP) || ((FLAG) == FLASH_FLAG_OPERR) || \
356  ((FLAG) == FLASH_FLAG_WRPERR) || ((FLAG) == FLASH_FLAG_PGAERR) || \
357  ((FLAG) == FLASH_FLAG_PGPERR) || ((FLAG) == FLASH_FLAG_PGSERR) || \
358  ((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_RDERR))
359 
366 #define FLASH_PSIZE_BYTE ((uint32_t)0x00000000)
367 #define FLASH_PSIZE_HALF_WORD ((uint32_t)0x00000100)
368 #define FLASH_PSIZE_WORD ((uint32_t)0x00000200)
369 #define FLASH_PSIZE_DOUBLE_WORD ((uint32_t)0x00000300)
370 #define CR_PSIZE_MASK ((uint32_t)0xFFFFFCFF)
371 
378 #define RDP_KEY ((uint16_t)0x00A5)
379 #define FLASH_KEY1 ((uint32_t)0x45670123)
380 #define FLASH_KEY2 ((uint32_t)0xCDEF89AB)
381 #define FLASH_OPT_KEY1 ((uint32_t)0x08192A3B)
382 #define FLASH_OPT_KEY2 ((uint32_t)0x4C5D6E7F)
383 
390 #define ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00)
391 
394 #define OPTCR_BYTE0_ADDRESS ((uint32_t)0x40023C14)
395 
398 #define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15)
399 
402 #define OPTCR_BYTE2_ADDRESS ((uint32_t)0x40023C16)
403 
406 #define OPTCR_BYTE3_ADDRESS ((uint32_t)0x40023C17)
407 
411 #define OPTCR1_BYTE2_ADDRESS ((uint32_t)0x40023C1A)
412 
417 /* Exported macro ------------------------------------------------------------*/
418 /* Exported functions --------------------------------------------------------*/
419 
420 /* FLASH Interface configuration functions ************************************/
421 void FLASH_SetLatency(uint32_t FLASH_Latency);
422 void FLASH_PrefetchBufferCmd(FunctionalState NewState);
423 void FLASH_InstructionCacheCmd(FunctionalState NewState);
424 void FLASH_DataCacheCmd(FunctionalState NewState);
425 void FLASH_InstructionCacheReset(void);
426 void FLASH_DataCacheReset(void);
427 
428 /* FLASH Memory Programming functions *****************************************/
429 void FLASH_Unlock(void);
430 void FLASH_Lock(void);
431 FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange);
432 FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange);
433 FLASH_Status FLASH_EraseAllBank1Sectors(uint8_t VoltageRange);
434 FLASH_Status FLASH_EraseAllBank2Sectors(uint8_t VoltageRange);
435 FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data);
436 FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data);
437 FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data);
438 FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data);
439 
440 /* Option Bytes Programming functions *****************************************/
441 void FLASH_OB_Unlock(void);
442 void FLASH_OB_Lock(void);
443 void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState);
444 void FLASH_OB_WRP1Config(uint32_t OB_WRP, FunctionalState NewState);
445 void FLASH_OB_PCROPSelectionConfig(uint8_t OB_PcROP);
446 void FLASH_OB_PCROPConfig(uint32_t OB_PCROP, FunctionalState NewState);
447 void FLASH_OB_PCROP1Config(uint32_t OB_PCROP, FunctionalState NewState);
448 void FLASH_OB_RDPConfig(uint8_t OB_RDP);
449 void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY);
450 void FLASH_OB_BORConfig(uint8_t OB_BOR);
451 void FLASH_OB_BootConfig(uint8_t OB_BOOT);
453 uint8_t FLASH_OB_GetUser(void);
454 uint16_t FLASH_OB_GetWRP(void);
455 uint16_t FLASH_OB_GetWRP1(void);
456 uint16_t FLASH_OB_GetPCROP(void);
457 uint16_t FLASH_OB_GetPCROP1(void);
458 FlagStatus FLASH_OB_GetRDP(void);
459 uint8_t FLASH_OB_GetBOR(void);
460 
461 /* Interrupts and flags management functions **********************************/
462 void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState);
463 FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG);
464 void FLASH_ClearFlag(uint32_t FLASH_FLAG);
467 
468 #ifdef __cplusplus
469 }
470 #endif
471 
472 #endif /* __STM32F4xx_FLASH_H */
473 
482 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void FLASH_OB_WRP1Config(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors, for the second 1 Mb of the Flash...
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
Programs a half word (16-bit) at a specified address.
void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)
Enables or disables the specified FLASH interrupts.
FLASH_Status FLASH_EraseAllBank1Sectors(uint8_t VoltageRange)
Erases all FLASH Sectors in Bank 1.
void FLASH_OB_RDPConfig(uint8_t OB_RDP)
Sets the read protection level.
FLASH_Status FLASH_EraseAllBank2Sectors(uint8_t VoltageRange)
Erases all FLASH Sectors in Bank 2.
FLASH_Status FLASH_WaitForLastOperation(void)
Waits for a FLASH operation to complete.
FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
Erases a specified FLASH Sector.
uint16_t FLASH_OB_GetWRP1(void)
Returns the FLASH Write Protection Option Bytes value.
uint16_t FLASH_OB_GetWRP(void)
Returns the FLASH Write Protection Option Bytes value.
void FLASH_ClearFlag(uint32_t FLASH_FLAG)
Clears the FLASH's pending flags.
void FLASH_OB_Lock(void)
Locks the FLASH Option Control Registers access.
FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange)
Erases all FLASH Sectors.
void FLASH_OB_PCROPConfig(uint32_t OB_PCROP, FunctionalState NewState)
Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of t...
void FLASH_OB_BORConfig(uint8_t OB_BOR)
Sets the BOR Level.
void FLASH_DataCacheCmd(FunctionalState NewState)
Enables or disables the Data Cache feature.
void FLASH_InstructionCacheReset(void)
Resets the Instruction Cache.
void FLASH_InstructionCacheCmd(FunctionalState NewState)
Enables or disables the Instruction Cache feature.
FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data)
Programs a double word (64-bit) at a specified address.
void FLASH_Unlock(void)
Unlocks the FLASH control register access.
void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors, for the first 1 Mb of the Flash...
FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG)
Checks whether the specified FLASH flag is set or not.
void FLASH_OB_Unlock(void)
Unlocks the FLASH Option Control Registers access.
void FLASH_DataCacheReset(void)
Resets the Data Cache.
uint16_t FLASH_OB_GetPCROP1(void)
Returns the FLASH PC Read/Write Protection Option Bytes value.
void FLASH_OB_PCROPSelectionConfig(uint8_t OB_PcROP)
Select the Protection Mode (SPRMOD).
FlagStatus FLASH_OB_GetRDP(void)
Returns the FLASH Read Protection level.
uint8_t FLASH_OB_GetUser(void)
Returns the FLASH User Option Bytes values.
void FLASH_PrefetchBufferCmd(FunctionalState NewState)
Enables or disables the Prefetch Buffer.
uint8_t FLASH_OB_GetBOR(void)
Returns the FLASH BOR level.
FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
Programs a byte (8-bit) at a specified address.
void FLASH_OB_PCROP1Config(uint32_t OB_PCROP, FunctionalState NewState)
Enables or disables the read/write protection (PCROP) of the desired sectors.
void FLASH_SetLatency(uint32_t FLASH_Latency)
Sets the code latency value.
FLASH_Status FLASH_OB_Launch(void)
Launch the option byte loading.
FLASH_Status FLASH_GetStatus(void)
Returns the FLASH Status.
void FLASH_OB_BootConfig(uint8_t OB_BOOT)
Configure the Dual Bank Boot.
void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
void FLASH_Lock(void)
Locks the FLASH control register access.
FLASH_Status
FLASH Status.
uint16_t FLASH_OB_GetPCROP(void)
Returns the FLASH PC Read/Write Protection Option Bytes value.
FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
Programs a word (32-bit) at a specified address.