stm32f0xx_hal_flash_ex.h 19 KB

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