stm32l0xx_hal_flash_ex.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_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. /* Define to prevent recursive inclusion -------------------------------------*/
  18. #ifndef __STM32L0xx_HAL_FLASH_EX_H
  19. #define __STM32L0xx_HAL_FLASH_EX_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32l0xx_hal_def.h"
  25. /** @addtogroup STM32L0xx_HAL_Driver
  26. * @{
  27. */
  28. /** @addtogroup FLASHEx
  29. * @{
  30. */
  31. /** @addtogroup FLASHEx_Private_Constants
  32. * @{
  33. */
  34. #define FLASH_NBPAGES_MAX (FLASH_SIZE / FLASH_PAGE_SIZE)
  35. #define WRP_MASK_LOW (0x0000FFFFU)
  36. #define WRP_MASK_HIGH (0xFFFF0000U)
  37. /**
  38. * @}
  39. */
  40. /** @addtogroup FLASHEx_Private_Macros
  41. * @{
  42. */
  43. #define IS_FLASH_TYPEERASE(__VALUE__) (((__VALUE__) == FLASH_TYPEERASE_PAGES))
  44. #define IS_OPTIONBYTE(__VALUE__) (((__VALUE__) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | \
  45. OPTIONBYTE_USER | OPTIONBYTE_BOR | OPTIONBYTE_BOOT_BIT1)))
  46. #define IS_WRPSTATE(__VALUE__) (((__VALUE__) == OB_WRPSTATE_DISABLE) || \
  47. ((__VALUE__) == OB_WRPSTATE_ENABLE))
  48. #define IS_OB_WRP(__PAGE__) (((__PAGE__) != 0x0000000U))
  49. #define IS_OB_RDP(__LEVEL__) (((__LEVEL__) == OB_RDP_LEVEL_0) ||\
  50. ((__LEVEL__) == OB_RDP_LEVEL_1) ||\
  51. ((__LEVEL__) == OB_RDP_LEVEL_2))
  52. #define IS_OB_BOR_LEVEL(__LEVEL__) (((__LEVEL__) == OB_BOR_OFF) || \
  53. ((__LEVEL__) == OB_BOR_LEVEL1) || \
  54. ((__LEVEL__) == OB_BOR_LEVEL2) || \
  55. ((__LEVEL__) == OB_BOR_LEVEL3) || \
  56. ((__LEVEL__) == OB_BOR_LEVEL4) || \
  57. ((__LEVEL__) == OB_BOR_LEVEL5))
  58. #define IS_OB_IWDG_SOURCE(__SOURCE__) (((__SOURCE__) == OB_IWDG_SW) || ((__SOURCE__) == OB_IWDG_HW))
  59. #define IS_OB_STOP_SOURCE(__SOURCE__) (((__SOURCE__) == OB_STOP_NORST) || ((__SOURCE__) == OB_STOP_RST))
  60. #define IS_OB_STDBY_SOURCE(__SOURCE__) (((__SOURCE__) == OB_STDBY_NORST) || ((__SOURCE__) == OB_STDBY_RST))
  61. #if defined(FLASH_OPTR_WPRMOD) && defined(FLASH_OPTR_BFB2)
  62. #define IS_OBEX(__VALUE__) (((__VALUE__) <= (OPTIONBYTE_PCROP | OPTIONBYTE_BOOTCONFIG)) && ((__VALUE__) != 0U))
  63. #elif defined(FLASH_OPTR_WPRMOD) && !defined(FLASH_OPTR_BFB2)
  64. #define IS_OBEX(__VALUE__) ((__VALUE__) == OPTIONBYTE_PCROP)
  65. #elif !defined(FLASH_OPTR_WPRMOD) && defined(FLASH_OPTR_BFB2)
  66. #define IS_OBEX(__VALUE__) ((__VALUE__) == OPTIONBYTE_BOOTCONFIG)
  67. #endif /* FLASH_OPTR_WPRMOD && FLASH_OPTR_BFB2 */
  68. #if defined(FLASH_OPTR_WPRMOD)
  69. #define IS_PCROPSTATE(__VALUE__) (((__VALUE__) == OB_PCROP_STATE_DISABLE) || \
  70. ((__VALUE__) == OB_PCROP_STATE_ENABLE))
  71. #define IS_OB_PCROP(__PAGE__) (((__PAGE__) != 0x0000000U))
  72. #endif /* FLASH_OPTR_WPRMOD */
  73. #if defined(FLASH_OPTR_BFB2)
  74. #define IS_OB_BOOT_BANK(__BANK__) (((__BANK__) == OB_BOOT_BANK2) || ((__BANK__) == OB_BOOT_BANK1))
  75. #endif /* FLASH_OPTR_BFB2 */
  76. #define IS_OB_BOOT1(__BOOT_BIT1__) (((__BOOT_BIT1__) == OB_BOOT_BIT1_RESET) || ((__BOOT_BIT1__) == OB_BOOT_BIT1_SET))
  77. #define IS_TYPEPROGRAMDATA(__VALUE__) (((__VALUE__) == FLASH_TYPEPROGRAMDATA_BYTE) || \
  78. ((__VALUE__) == FLASH_TYPEPROGRAMDATA_HALFWORD) || \
  79. ((__VALUE__) == FLASH_TYPEPROGRAMDATA_WORD))
  80. #if defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx)
  81. #define IS_FLASH_DATA_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= DATA_EEPROM_BASE) && ((__ADDRESS__) <= DATA_EEPROM_BANK2_END))
  82. #define IS_FLASH_DATA_BANK1_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= DATA_EEPROM_BASE) && ((__ADDRESS__) <= DATA_EEPROM_BANK1_END))
  83. #define IS_FLASH_DATA_BANK2_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= DATA_EEPROM_BANK2_BASE) && ((__ADDRESS__) <= DATA_EEPROM_BANK2_END))
  84. #define IS_FLASH_PROGRAM_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) < (FLASH_BASE + FLASH_SIZE)))
  85. #define IS_FLASH_PROGRAM_BANK1_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) < (FLASH_BASE + (FLASH_SIZE >> 1))))
  86. #define IS_FLASH_PROGRAM_BANK2_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BANK2_BASE) && ((__ADDRESS__) < (FLASH_BASE + FLASH_SIZE)))
  87. #else
  88. #define IS_FLASH_DATA_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= DATA_EEPROM_BASE) && ((__ADDRESS__) <= DATA_EEPROM_END))
  89. #define IS_FLASH_PROGRAM_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) < (FLASH_BASE + FLASH_SIZE)))
  90. #endif
  91. #define IS_NBPAGES(__PAGES__) (((__PAGES__) >= 1) && ((__PAGES__) <= FLASH_NBPAGES_MAX))
  92. /**
  93. * @}
  94. */
  95. /** @addtogroup FLASHEx_Private_Functions
  96. * @{
  97. */
  98. void FLASH_PageErase(uint32_t PageAddress);
  99. /**
  100. * @}
  101. */
  102. /* Exported types ------------------------------------------------------------*/
  103. /** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types
  104. * @{
  105. */
  106. /**
  107. * @brief FLASH Erase structure definition
  108. */
  109. typedef struct
  110. {
  111. uint32_t TypeErase; /*!< TypeErase: Page Erase only.
  112. This parameter can be a value of @ref FLASHEx_Type_Erase */
  113. uint32_t PageAddress; /*!< PageAddress: Initial FLASH address to be erased
  114. This parameter must be a value belonging to FLASH Program address (depending on the devices) */
  115. uint32_t NbPages; /*!< NbPages: Number of pages to be erased.
  116. This parameter must be a value between 1 and (max number of pages - value of Initial page)*/
  117. } FLASH_EraseInitTypeDef;
  118. /**
  119. * @brief FLASH Option Bytes PROGRAM structure definition
  120. */
  121. typedef struct
  122. {
  123. uint32_t OptionType; /*!< OptionType: Option byte to be configured.
  124. This parameter can be a value of @ref FLASHEx_Option_Type */
  125. uint32_t WRPState; /*!< WRPState: Write protection activation or deactivation.
  126. This parameter can be a value of @ref FLASHEx_WRP_State */
  127. uint32_t WRPSector; /*!< WRPSector: This bitfield specifies the sector (s) which are write protected.
  128. This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection */
  129. #if defined(STM32L071xx) || defined(STM32L072xx) || defined(STM32L073xx) || defined(STM32L081xx) || defined(STM32L082xx) || defined(STM32L083xx)
  130. uint32_t WRPSector2; /*!< WRPSector2 : This bitfield specifies the sector(s) upper Sector31 which are write protected.
  131. This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection2 */
  132. #endif
  133. uint8_t RDPLevel; /*!< RDPLevel: Set the read protection level.
  134. This parameter can be a value of @ref FLASHEx_Option_Bytes_Read_Protection */
  135. uint8_t BORLevel; /*!< BORLevel: Set the BOR Level.
  136. This parameter can be a value of @ref FLASHEx_Option_Bytes_BOR_Level */
  137. uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
  138. This parameter can be a combination of @ref FLASHEx_Option_Bytes_IWatchdog,
  139. @ref FLASHEx_Option_Bytes_nRST_STOP and @ref FLASHEx_Option_Bytes_nRST_STDBY*/
  140. uint8_t BOOTBit1Config; /*!< BOOT1Config: Together with input pad Boot0, this bit selects the boot source, flash, ram or system memory
  141. This parameter can be a value of @ref FLASHEx_Option_Bytes_BOOTBit1 */
  142. } FLASH_OBProgramInitTypeDef;
  143. #if defined(FLASH_OPTR_WPRMOD) || defined(FLASH_OPTR_BFB2)
  144. /**
  145. * @brief FLASH Advanced Option Bytes Program structure definition
  146. */
  147. typedef struct
  148. {
  149. uint32_t OptionType; /*!< OptionType: Option byte to be configured for extension .
  150. This parameter can be a value of @ref FLASHEx_OptionAdv_Type */
  151. #if defined(FLASH_OPTR_WPRMOD)
  152. uint32_t PCROPState; /*!< PCROPState: PCROP activation or deactivation.
  153. This parameter can be a value of @ref FLASHEx_PCROP_State */
  154. uint32_t PCROPSector; /*!< PCROPSector : This bitfield specifies the sector(s) which are read/write protected.
  155. This parameter can be a combination of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
  156. #if defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx)
  157. uint32_t PCROPSector2; /*!< PCROPSector : This bitfield specifies the sector(s) upper Sector31 which are read/write protected.
  158. This parameter can be a combination of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection2 */
  159. #endif /* STM32L071xx || STM32L072xx || STM32L073xx || STM32L081xx || STM32L082xx || STM32L083xx */
  160. #endif /* FLASH_OPTR_WPRMOD */
  161. #if defined(FLASH_OPTR_BFB2)
  162. uint16_t BootConfig; /*!< BootConfig: specifies Option bytes for boot config
  163. This parameter can be a value of @ref FLASHEx_Option_Bytes_BOOT */
  164. #endif /* FLASH_OPTR_BFB2*/
  165. } FLASH_AdvOBProgramInitTypeDef;
  166. /**
  167. * @}
  168. */
  169. #endif /* FLASH_OPTR_WPRMOD || FLASH_OPTR_BFB2 */
  170. /* Exported constants --------------------------------------------------------*/
  171. /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
  172. * @{
  173. */
  174. /** @defgroup FLASHEx_Type_Erase FLASHEx_Type_Erase
  175. * @{
  176. */
  177. #define FLASH_TYPEERASE_PAGES (0x00U) /*!<Page erase only*/
  178. /**
  179. * @}
  180. */
  181. /** @defgroup FLASHEx_Option_Type FLASHEx Option Type
  182. * @{
  183. */
  184. #define OPTIONBYTE_WRP (0x01U) /*!<WRP option byte configuration*/
  185. #define OPTIONBYTE_RDP (0x02U) /*!<RDP option byte configuration*/
  186. #define OPTIONBYTE_USER (0x04U) /*!<USER option byte configuration*/
  187. #define OPTIONBYTE_BOR (0x08U) /*!<BOR option byte configuration*/
  188. #define OPTIONBYTE_BOOT_BIT1 (0x10U) /*!< BOOT PIN1 option byte configuration*/
  189. /**
  190. * @}
  191. */
  192. /** @defgroup FLASHEx_WRP_State FLASHEx WRP State
  193. * @{
  194. */
  195. #define OB_WRPSTATE_DISABLE (0x00U) /*!<Disable the write protection of the desired sectors*/
  196. #define OB_WRPSTATE_ENABLE (0x01U) /*!<Enable the write protection of the desired sectors*/
  197. /**
  198. * @}
  199. */
  200. #if defined (STM32L011xx) || defined (STM32L021xx) || defined (STM32L031xx) || defined (STM32L041xx)
  201. /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write Protection
  202. * @{
  203. */
  204. #define OB_WRP_Pages0to31 (0x00000001U) /* Write protection of Sector0 */
  205. #define OB_WRP_Pages32to63 (0x00000002U) /* Write protection of Sector1 */
  206. #define OB_WRP_Pages64to95 (0x00000004U) /* Write protection of Sector2 */
  207. #define OB_WRP_Pages96to127 (0x00000008U) /* Write protection of Sector3 */
  208. #define OB_WRP_Pages128to159 (0x00000010U) /* Write protection of Sector4 */
  209. #define OB_WRP_Pages160to191 (0x00000020U) /* Write protection of Sector5 */
  210. #define OB_WRP_Pages192to223 (0x00000040U) /* Write protection of Sector6 */
  211. #define OB_WRP_Pages224to255 (0x00000080U) /* Write protection of Sector7 */
  212. #define OB_WRP_AllPages (0x000000FFU) /*!< Write protection of all Sectors */
  213. /**
  214. * @}
  215. */
  216. #elif defined (STM32L051xx) || defined (STM32L052xx) || defined (STM32L053xx) || defined (STM32L062xx) || defined (STM32L063xx)
  217. /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write Protection
  218. * @{
  219. */
  220. #define OB_WRP_Pages0to31 (0x00000001U) /* Write protection of Sector0 */
  221. #define OB_WRP_Pages32to63 (0x00000002U) /* Write protection of Sector1 */
  222. #define OB_WRP_Pages64to95 (0x00000004U) /* Write protection of Sector2 */
  223. #define OB_WRP_Pages96to127 (0x00000008U) /* Write protection of Sector3 */
  224. #define OB_WRP_Pages128to159 (0x00000010U) /* Write protection of Sector4 */
  225. #define OB_WRP_Pages160to191 (0x00000020U) /* Write protection of Sector5 */
  226. #define OB_WRP_Pages192to223 (0x00000040U) /* Write protection of Sector6 */
  227. #define OB_WRP_Pages224to255 (0x00000080U) /* Write protection of Sector7 */
  228. #define OB_WRP_Pages256to287 (0x00000100U) /* Write protection of Sector8 */
  229. #define OB_WRP_Pages288to319 (0x00000200U) /* Write protection of Sector9 */
  230. #define OB_WRP_Pages320to351 (0x00000400U) /* Write protection of Sector10 */
  231. #define OB_WRP_Pages352to383 (0x00000800U) /* Write protection of Sector11 */
  232. #define OB_WRP_Pages384to415 (0x00001000U) /* Write protection of Sector12 */
  233. #define OB_WRP_Pages416to447 (0x00002000U) /* Write protection of Sector13 */
  234. #define OB_WRP_Pages448to479 (0x00004000U) /* Write protection of Sector14 */
  235. #define OB_WRP_Pages480to511 (0x00008000U) /* Write protection of Sector15 */
  236. #define OB_WRP_AllPages (0x0000FFFFU) /*!< Write protection of all Sectors */
  237. /**
  238. * @}
  239. */
  240. #elif defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx)
  241. /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write ProtectionP
  242. * @{
  243. */
  244. #define OB_WRP_Pages0to31 (0x00000001U) /* Write protection of Sector0 */
  245. #define OB_WRP_Pages32to63 (0x00000002U) /* Write protection of Sector1 */
  246. #define OB_WRP_Pages64to95 (0x00000004U) /* Write protection of Sector2 */
  247. #define OB_WRP_Pages96to127 (0x00000008U) /* Write protection of Sector3 */
  248. #define OB_WRP_Pages128to159 (0x00000010U) /* Write protection of Sector4 */
  249. #define OB_WRP_Pages160to191 (0x00000020U) /* Write protection of Sector5 */
  250. #define OB_WRP_Pages192to223 (0x00000040U) /* Write protection of Sector6 */
  251. #define OB_WRP_Pages224to255 (0x00000080U) /* Write protection of Sector7 */
  252. #define OB_WRP_Pages256to287 (0x00000100U) /* Write protection of Sector8 */
  253. #define OB_WRP_Pages288to319 (0x00000200U) /* Write protection of Sector9 */
  254. #define OB_WRP_Pages320to351 (0x00000400U) /* Write protection of Sector10 */
  255. #define OB_WRP_Pages352to383 (0x00000800U) /* Write protection of Sector11 */
  256. #define OB_WRP_Pages384to415 (0x00001000U) /* Write protection of Sector12 */
  257. #define OB_WRP_Pages416to447 (0x00002000U) /* Write protection of Sector13 */
  258. #define OB_WRP_Pages448to479 (0x00004000U) /* Write protection of Sector14 */
  259. #define OB_WRP_Pages480to511 (0x00008000U) /* Write protection of Sector15 */
  260. #define OB_WRP_Pages512to543 (0x00010000U) /* Write protection of Sector16 */
  261. #define OB_WRP_Pages544to575 (0x00020000U) /* Write protection of Sector17 */
  262. #define OB_WRP_Pages576to607 (0x00040000U) /* Write protection of Sector18 */
  263. #define OB_WRP_Pages608to639 (0x00080000U) /* Write protection of Sector19 */
  264. #define OB_WRP_Pages640to671 (0x00100000U) /* Write protection of Sector20 */
  265. #define OB_WRP_Pages672to703 (0x00200000U) /* Write protection of Sector21 */
  266. #define OB_WRP_Pages704to735 (0x00400000U) /* Write protection of Sector22 */
  267. #define OB_WRP_Pages736to767 (0x00800000U) /* Write protection of Sector23 */
  268. #define OB_WRP_Pages768to799 (0x01000000U) /* Write protection of Sector24 */
  269. #define OB_WRP_Pages800to831 (0x02000000U) /* Write protection of Sector25 */
  270. #define OB_WRP_Pages832to863 (0x04000000U) /* Write protection of Sector26 */
  271. #define OB_WRP_Pages864to895 (0x08000000U) /* Write protection of Sector27 */
  272. #define OB_WRP_Pages896to927 (0x10000000U) /* Write protection of Sector28 */
  273. #define OB_WRP_Pages928to959 (0x20000000U) /* Write protection of Sector29 */
  274. #define OB_WRP_Pages960to991 (0x40000000U) /* Write protection of Sector30 */
  275. #define OB_WRP_Pages992to1023 (0x80000000U) /* Write protection of Sector31 */
  276. #define OB_WRP_AllPages (0xFFFFFFFFU) /*!<Write protection of all Sectors */
  277. /**
  278. * @}
  279. */
  280. /** @defgroup FLASHEx_Option_Bytes_Write_Protection2 FLASH Option Bytes Write Protection
  281. * @{
  282. */
  283. #define OB_WRP2_Pages1024to1055 (0x00000001U) /* Write protection of Sector32 */
  284. #define OB_WRP2_Pages1056to1087 (0x00000002U) /* Write protection of Sector33 */
  285. #define OB_WRP2_Pages1088to1119 (0x00000004U) /* Write protection of Sector34 */
  286. #define OB_WRP2_Pages1120to1151 (0x00000008U) /* Write protection of Sector35 */
  287. #define OB_WRP2_Pages1152to1183 (0x00000010U) /* Write protection of Sector36 */
  288. #define OB_WRP2_Pages1184to1215 (0x00000020U) /* Write protection of Sector37 */
  289. #define OB_WRP2_Pages1216to1247 (0x00000040U) /* Write protection of Sector38 */
  290. #define OB_WRP2_Pages1248to1279 (0x00000080U) /* Write protection of Sector39 */
  291. #define OB_WRP2_Pages1280to1311 (0x00000100U) /* Write protection of Sector40 */
  292. #define OB_WRP2_Pages1312to1343 (0x00000200U) /* Write protection of Sector41 */
  293. #define OB_WRP2_Pages1344to1375 (0x00000400U) /* Write protection of Sector42 */
  294. #define OB_WRP2_Pages1376to1407 (0x00000800U) /* Write protection of Sector43 */
  295. #define OB_WRP2_Pages1408to1439 (0x00001000U) /* Write protection of Sector44 */
  296. #define OB_WRP2_Pages1440to1471 (0x00002000U) /* Write protection of Sector45 */
  297. #define OB_WRP2_Pages1472to1503 (0x00004000U) /* Write protection of Sector46 */
  298. #define OB_WRP2_Pages1504to1535 (0x00008000U) /* Write protection of Sector47 */
  299. #define OB_WRP2_AllPages (0x0000FFFFU) /*!< Write protection of all Sectors WRP2 */
  300. /**
  301. * @}
  302. */
  303. #endif /* STM32L071xx || STM32L072xx || (STM32L073xx) || (STM32L081xx) || (STM32L082xx) || (STM32L083xx) */
  304. /** @defgroup FLASHEx_Option_Bytes_Read_Protection FLASHEx Option Bytes Read Protection
  305. * @{
  306. */
  307. #define OB_RDP_LEVEL_0 ((uint8_t)0xAA)
  308. #define OB_RDP_LEVEL_1 ((uint8_t)0xBB)
  309. #define OB_RDP_LEVEL_2 ((uint8_t)0xCC) /* Warning: When enabling read protection level 2
  310. it is no more possible to go back to level 1 or 0 */
  311. /**
  312. * @}
  313. */
  314. /** @defgroup FLASHEx_Option_Bytes_BOR_Level FLASHEx Option Bytes BOR Level
  315. * @{
  316. */
  317. #define OB_BOR_OFF ((uint8_t)0x00) /*!< BOR is disabled at power down, the reset is asserted when the VDD
  318. power supply reaches the PDR(Power Down Reset) threshold (1.5V) */
  319. #define OB_BOR_LEVEL1 ((uint8_t)0x08) /*!< BOR Reset threshold levels for 1.7V - 1.8V VDD power supply */
  320. #define OB_BOR_LEVEL2 ((uint8_t)0x09) /*!< BOR Reset threshold levels for 1.9V - 2.0V VDD power supply */
  321. #define OB_BOR_LEVEL3 ((uint8_t)0x0A) /*!< BOR Reset threshold levels for 2.3V - 2.4V VDD power supply */
  322. #define OB_BOR_LEVEL4 ((uint8_t)0x0B) /*!< BOR Reset threshold levels for 2.55V - 2.65V VDD power supply */
  323. #define OB_BOR_LEVEL5 ((uint8_t)0x0C) /*!< BOR Reset threshold levels for 2.8V - 2.9V VDD power supply */
  324. /**
  325. * @}
  326. */
  327. /** @defgroup FLASHEx_Option_Bytes_IWatchdog FLASHEx Option Bytes IWatchdog
  328. * @{
  329. */
  330. #define OB_IWDG_SW ((uint8_t)0x10) /*!< Software WDG selected */
  331. #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware WDG selected */
  332. /**
  333. * @}
  334. */
  335. /** @defgroup FLASHEx_Option_Bytes_nRST_STOP FLASHEx Option Bytes nRST_STOP
  336. * @{
  337. */
  338. #define OB_STOP_NORST ((uint8_t)0x20) /*!< No reset generated when entering in STOP */
  339. #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */
  340. /**
  341. * @}
  342. */
  343. /** @defgroup FLASHEx_Option_Bytes_nRST_STDBY FLASHEx Option Bytes nRST_STDBY
  344. * @{
  345. */
  346. #define OB_STDBY_NORST ((uint8_t)0x40) /*!< No reset generated when entering in STANDBY */
  347. #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */
  348. /**
  349. * @}
  350. */
  351. #if defined(FLASH_OPTR_WPRMOD)
  352. /** @defgroup FLASHEx_OptionAdv_Type FLASHEx Option Advanced Type
  353. * @{
  354. */
  355. #define OPTIONBYTE_PCROP (0x01U) /*!<PCROP option byte configuration*/
  356. /**
  357. * @}
  358. */
  359. #endif /* FLASH_OPTR_WPRMOD */
  360. #if defined(FLASH_OPTR_BFB2)
  361. /** @defgroup FLASHEx_OptionAdv_Type FLASHEx Option Advanced Type
  362. * @{
  363. */
  364. #define OPTIONBYTE_BOOTCONFIG (0x02U) /*!<BOOTConfig option byte configuration*/
  365. /**
  366. * @}
  367. */
  368. #endif /* FLASH_OPTR_BFB2 */
  369. #if defined(FLASH_OPTR_WPRMOD)
  370. /** @defgroup FLASHEx_PCROP_State FLASHEx PCROP State
  371. * @{
  372. */
  373. #define OB_PCROP_STATE_DISABLE (0x00U) /*!<Disable PCROP for selected sectors */
  374. #define OB_PCROP_STATE_ENABLE (0x01U) /*!<Enable PCROP for selected sectors */
  375. /**
  376. * @}
  377. */
  378. /** @defgroup FLASHEx_Selection_Protection_Mode FLASHEx Selection Protection Mode
  379. * @{
  380. */
  381. #define OB_PCROP_DESELECTED ((uint16_t)0x0000) /*!< Disabled PCROP, nWPRi bits used for Write Protection on sector i */
  382. #define OB_PCROP_SELECTED ((uint16_t)FLASH_OPTR_WPRMOD) /*!< Enable PCROP, nWPRi bits used for PCRoP Protection on sector i */
  383. /**
  384. * @}
  385. */
  386. #endif /* FLASH_OPTR_WPRMOD */
  387. #if defined (STM32L011xx) || defined (STM32L021xx) || defined (STM32L031xx) || defined (STM32L041xx)
  388. /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection FLASHEx Option Bytes PC Read/Write Protection
  389. * @{
  390. */
  391. #define OB_PCROP_Pages0to31 (0x00000001U) /* PC Read/Write protection of Sector0 */
  392. #define OB_PCROP_Pages32to63 (0x00000002U) /* PC Read/Write protection of Sector1 */
  393. #define OB_PCROP_Pages64to95 (0x00000004U) /* PC Read/Write protection of Sector2 */
  394. #define OB_PCROP_Pages96to127 (0x00000008U) /* PC Read/Write protection of Sector3 */
  395. #define OB_PCROP_Pages128to159 (0x00000010U) /* PC Read/Write protection of Sector4 */
  396. #define OB_PCROP_Pages160to191 (0x00000020U) /* PC Read/Write protection of Sector5 */
  397. #define OB_PCROP_Pages192to223 (0x00000040U) /* PC Read/Write protection of Sector6 */
  398. #define OB_PCROP_Pages224to255 (0x00000080U) /* PC Read/Write protection of Sector7 */
  399. #define OB_PCROP_AllPages (0x000000FFU) /*!< PC Read/Write protection of all Sectors */
  400. /**
  401. * @}
  402. */
  403. #elif defined (STM32L051xx) || defined (STM32L052xx) || defined (STM32L053xx) || defined (STM32L062xx) || defined (STM32L063xx)
  404. /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection FLASHEx Option Bytes PC Read/Write Protection
  405. * @{
  406. */
  407. #define OB_PCROP_Pages0to31 (0x00000001U) /* PC Read/Write protection of Sector0 */
  408. #define OB_PCROP_Pages32to63 (0x00000002U) /* PC Read/Write protection of Sector1 */
  409. #define OB_PCROP_Pages64to95 (0x00000004U) /* PC Read/Write protection of Sector2 */
  410. #define OB_PCROP_Pages96to127 (0x00000008U) /* PC Read/Write protection of Sector3 */
  411. #define OB_PCROP_Pages128to159 (0x00000010U) /* PC Read/Write protection of Sector4 */
  412. #define OB_PCROP_Pages160to191 (0x00000020U) /* PC Read/Write protection of Sector5 */
  413. #define OB_PCROP_Pages192to223 (0x00000040U) /* PC Read/Write protection of Sector6 */
  414. #define OB_PCROP_Pages224to255 (0x00000080U) /* PC Read/Write protection of Sector7 */
  415. #define OB_PCROP_Pages256to287 (0x00000100U) /* PC Read/Write protection of Sector8 */
  416. #define OB_PCROP_Pages288to319 (0x00000200U) /* PC Read/Write protection of Sector9 */
  417. #define OB_PCROP_Pages320to351 (0x00000400U) /* PC Read/Write protection of Sector10 */
  418. #define OB_PCROP_Pages352to383 (0x00000800U) /* PC Read/Write protection of Sector11 */
  419. #define OB_PCROP_Pages384to415 (0x00001000U) /* PC Read/Write protection of Sector12 */
  420. #define OB_PCROP_Pages416to447 (0x00002000U) /* PC Read/Write protection of Sector13 */
  421. #define OB_PCROP_Pages448to479 (0x00004000U) /* PC Read/Write protection of Sector14 */
  422. #define OB_PCROP_Pages480to511 (0x00008000U) /* PC Read/Write protection of Sector15 */
  423. #define OB_PCROP_AllPages (0x0000FFFFU) /*!< PC Read/Write protection of all Sectors */
  424. /**
  425. * @}
  426. */
  427. #endif
  428. #if defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx)
  429. /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection FLASH Option Bytes PC Read/Write Protection
  430. * @{
  431. */
  432. #define OB_PCROP_Pages0to31 (0x00000001U) /* PC Read/Write protection of Sector0 */
  433. #define OB_PCROP_Pages32to63 (0x00000002U) /* PC Read/Write protection of Sector1 */
  434. #define OB_PCROP_Pages64to95 (0x00000004U) /* PC Read/Write protection of Sector2 */
  435. #define OB_PCROP_Pages96to127 (0x00000008U) /* PC Read/Write protection of Sector3 */
  436. #define OB_PCROP_Pages128to159 (0x00000010U) /* PC Read/Write protection of Sector4 */
  437. #define OB_PCROP_Pages160to191 (0x00000020U) /* PC Read/Write protection of Sector5 */
  438. #define OB_PCROP_Pages192to223 (0x00000040U) /* PC Read/Write protection of Sector6 */
  439. #define OB_PCROP_Pages224to255 (0x00000080U) /* PC Read/Write protection of Sector7 */
  440. #define OB_PCROP_Pages256to287 (0x00000100U) /* PC Read/Write protection of Sector8 */
  441. #define OB_PCROP_Pages288to319 (0x00000200U) /* PC Read/Write protection of Sector9 */
  442. #define OB_PCROP_Pages320to351 (0x00000400U) /* PC Read/Write protection of Sector10 */
  443. #define OB_PCROP_Pages352to383 (0x00000800U) /* PC Read/Write protection of Sector11 */
  444. #define OB_PCROP_Pages384to415 (0x00001000U) /* PC Read/Write protection of Sector12 */
  445. #define OB_PCROP_Pages416to447 (0x00002000U) /* PC Read/Write protection of Sector13 */
  446. #define OB_PCROP_Pages448to479 (0x00004000U) /* PC Read/Write protection of Sector14 */
  447. #define OB_PCROP_Pages480to511 (0x00008000U) /* PC Read/Write protection of Sector15 */
  448. #define OB_PCROP_Pages512to543 (0x00010000U) /* PC Read/Write protection of Sector16 */
  449. #define OB_PCROP_Pages544to575 (0x00020000U) /* PC Read/Write protection of Sector17 */
  450. #define OB_PCROP_Pages576to607 (0x00040000U) /* PC Read/Write protection of Sector18 */
  451. #define OB_PCROP_Pages608to639 (0x00080000U) /* PC Read/Write protection of Sector19 */
  452. #define OB_PCROP_Pages640to671 (0x00100000U) /* PC Read/Write protection of Sector20 */
  453. #define OB_PCROP_Pages672to703 (0x00200000U) /* PC Read/Write protection of Sector21 */
  454. #define OB_PCROP_Pages704to735 (0x00400000U) /* PC Read/Write protection of Sector22 */
  455. #define OB_PCROP_Pages736to767 (0x00800000U) /* PC Read/Write protection of Sector23 */
  456. #define OB_PCROP_Pages768to799 (0x01000000U) /* PC Read/Write protection of Sector24 */
  457. #define OB_PCROP_Pages800to831 (0x02000000U) /* PC Read/Write protection of Sector25 */
  458. #define OB_PCROP_Pages832to863 (0x04000000U) /* PC Read/Write protection of Sector26 */
  459. #define OB_PCROP_Pages864to895 (0x08000000U) /* PC Read/Write protection of Sector27 */
  460. #define OB_PCROP_Pages896to927 (0x10000000U) /* PC Read/Write protection of Sector28 */
  461. #define OB_PCROP_Pages928to959 (0x20000000U) /* PC Read/Write protection of Sector29 */
  462. #define OB_PCROP_Pages960to991 (0x40000000U) /* PC Read/Write protection of Sector30 */
  463. #define OB_PCROP_Pages992to1023 (0x80000000U) /* PC Read/Write protection of Sector31 */
  464. #define OB_PCROP_AllPages (0xFFFFFFFFU) /*!<PC Read/Write protection of all Sectors */
  465. /**
  466. * @}
  467. */
  468. /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection2 FLASH Option Bytes PC Read/Write Protection (Sector 2)
  469. * @{
  470. */
  471. #define OB_PCROP2_Pages1024to1055 (0x00000001U) /* PC Read/Write protection of Sector32 */
  472. #define OB_PCROP2_Pages1056to1087 (0x00000002U) /* PC Read/Write protection of Sector33 */
  473. #define OB_PCROP2_Pages1088to1119 (0x00000004U) /* PC Read/Write protection of Sector34 */
  474. #define OB_PCROP2_Pages1120to1151 (0x00000008U) /* PC Read/Write protection of Sector35 */
  475. #define OB_PCROP2_Pages1152to1183 (0x00000010U) /* PC Read/Write protection of Sector36 */
  476. #define OB_PCROP2_Pages1184to1215 (0x00000020U) /* PC Read/Write protection of Sector37 */
  477. #define OB_PCROP2_Pages1216to1247 (0x00000040U) /* PC Read/Write protection of Sector38 */
  478. #define OB_PCROP2_Pages1248to1279 (0x00000080U) /* PC Read/Write protection of Sector39 */
  479. #define OB_PCROP2_Pages1280to1311 (0x00000100U) /* PC Read/Write protection of Sector40 */
  480. #define OB_PCROP2_Pages1312to1343 (0x00000200U) /* PC Read/Write protection of Sector41 */
  481. #define OB_PCROP2_Pages1344to1375 (0x00000400U) /* PC Read/Write protection of Sector42 */
  482. #define OB_PCROP2_Pages1376to1407 (0x00000800U) /* PC Read/Write protection of Sector43 */
  483. #define OB_PCROP2_Pages1408to1439 (0x00001000U) /* PC Read/Write protection of Sector44 */
  484. #define OB_PCROP2_Pages1440to1471 (0x00002000U) /* PC Read/Write protection of Sector45 */
  485. #define OB_PCROP2_Pages1472to1503 (0x00004000U) /* PC Read/Write protection of Sector46 */
  486. #define OB_PCROP2_Pages1504to1535 (0x00008000U) /* PC Read/Write protection of Sector47 */
  487. #define OB_PCROP2_AllPages (0x0000FFFFU) /*!< PC Read/Write protection of all Sectors PCROP2 */
  488. /**
  489. * @}
  490. */
  491. #endif /* STM32L071xx || STM32L072xx || STM32L073xx || STM32L081xx || STM32L082xx || STM32L083xx */
  492. /** @defgroup FLASHEx_Option_Bytes_BOOTBit1 FLASH Option Bytes BOOT Bit1 Setup
  493. * @{
  494. */
  495. #define OB_BOOT_BIT1_RESET (uint8_t)(0x00) /*!< BOOT Bit 1 Reset */
  496. #define OB_BOOT_BIT1_SET (uint8_t)(0x01) /*!< BOOT Bit 1 Set */
  497. /**
  498. * @}
  499. */
  500. /** @defgroup FLASHEx_Type_Program_Data FLASHEx Type Program Data
  501. * @{
  502. */
  503. #define FLASH_TYPEPROGRAMDATA_BYTE (0x00U) /*!<Program byte (8-bit) at a specified address.*/
  504. #define FLASH_TYPEPROGRAMDATA_HALFWORD (0x01U) /*!<Program a half-word (16-bit) at a specified address.*/
  505. #define FLASH_TYPEPROGRAMDATA_WORD (0x02U) /*!<Program a word (32-bit) at a specified address.*/
  506. /**
  507. * @}
  508. */
  509. #if defined(FLASH_OPTR_BFB2)
  510. /** @defgroup FLASHEx_Option_Bytes_BOOT FLASHEx Option Bytes BOOT
  511. * @{
  512. */
  513. #define OB_BOOT_BANK1 ((uint8_t)0x00) /*!< At startup, if boot pin 0 and BOOT1 bit are set in boot from user Flash position
  514. and this parameter is selected the device will boot from Bank 1 (Default)*/
  515. #define OB_BOOT_BANK2 ((uint8_t)(FLASH_OPTR_BFB2 >> 16)) /*!< At startup, if boot pin 0 and BOOT1 bit are set in boot from user Flash position
  516. and this parameter is selected the device will boot from Bank 2 */
  517. /**
  518. * @}
  519. */
  520. #endif /* FLASH_OPTR_BFB2 */
  521. /**
  522. * @}
  523. */
  524. /* Exported macro ------------------------------------------------------------*/
  525. /** @defgroup FLASHEx_Exported_Macros FLASHEx Exported Macros
  526. * @{
  527. */
  528. /**
  529. * @brief Set the FLASH Latency.
  530. * @param __LATENCY__ FLASH Latency
  531. * This parameter can be one of the following values:
  532. * @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle
  533. * @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle
  534. * @retval none
  535. */
  536. #define __HAL_FLASH_SET_LATENCY(__LATENCY__) \
  537. MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(__LATENCY__))
  538. /**
  539. * @brief Get the FLASH Latency.
  540. * @retval FLASH Latency
  541. * This parameter can be one of the following values:
  542. * @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle
  543. * @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle
  544. */
  545. #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
  546. /**
  547. * @brief Enable the FLASH prefetch buffer.
  548. * @retval none
  549. */
  550. #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() SET_BIT((FLASH->ACR), FLASH_ACR_PRFTEN)
  551. /**
  552. * @brief Disable the FLASH prefetch buffer.
  553. * @retval none
  554. */
  555. #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() CLEAR_BIT((FLASH->ACR), FLASH_ACR_PRFTEN)
  556. /**
  557. * @brief Enable the FLASH Buffer cache.
  558. * @retval none
  559. */
  560. #define __HAL_FLASH_BUFFER_CACHE_ENABLE() CLEAR_BIT((FLASH->ACR), FLASH_ACR_DISAB_BUF)
  561. /**
  562. * @brief Disable the FLASH Buffer cache.
  563. * @retval none
  564. */
  565. #define __HAL_FLASH_BUFFER_CACHE_DISABLE() SET_BIT((FLASH->ACR), FLASH_ACR_DISAB_BUF)
  566. /**
  567. * @brief Enable the FLASH preread buffer.
  568. * @retval none
  569. */
  570. #define __HAL_FLASH_PREREAD_BUFFER_ENABLE() SET_BIT((FLASH->ACR), FLASH_ACR_PRE_READ)
  571. /**
  572. * @brief Disable the FLASH preread buffer.
  573. * @retval none
  574. */
  575. #define __HAL_FLASH_PREREAD_BUFFER_DISABLE() CLEAR_BIT((FLASH->ACR), FLASH_ACR_PRE_READ)
  576. /**
  577. * @brief Enable the FLASH power down during Sleep mode
  578. * @retval none
  579. */
  580. #define __HAL_FLASH_SLEEP_POWERDOWN_ENABLE() SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
  581. /**
  582. * @brief Disable the FLASH power down during Sleep mode
  583. * @retval none
  584. */
  585. #define __HAL_FLASH_SLEEP_POWERDOWN_DISABLE() CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
  586. /**
  587. * @brief Enable the Flash Run power down mode.
  588. * @note Writing this bit to 0 this bit, automatically the keys are
  589. * loss and a new unlock sequence is necessary to re-write it to 1.
  590. */
  591. #define __HAL_FLASH_POWER_DOWN_ENABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \
  592. FLASH->PDKEYR = FLASH_PDKEY2; \
  593. SET_BIT((FLASH->ACR), FLASH_ACR_RUN_PD); \
  594. } while (0)
  595. /**
  596. * @brief Disable the Flash Run power down mode.
  597. * @note Writing this bit to 0 this bit, automatically the keys are
  598. * loss and a new unlock sequence is necessary to re-write it to 1.
  599. */
  600. #define __HAL_FLASH_POWER_DOWN_DISABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \
  601. FLASH->PDKEYR = FLASH_PDKEY2; \
  602. CLEAR_BIT((FLASH->ACR), FLASH_ACR_RUN_PD); \
  603. } while (0)
  604. /**
  605. * @}
  606. */
  607. /* Exported functions --------------------------------------------------------*/
  608. /** @addtogroup FLASHEx_Exported_Functions
  609. * @{
  610. */
  611. /** @addtogroup FLASHEx_Exported_Functions_Group1
  612. * @{
  613. */
  614. HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
  615. HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
  616. /**
  617. * @}
  618. */
  619. /** @addtogroup FLASHEx_Exported_Functions_Group2
  620. * @{
  621. */
  622. HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
  623. void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
  624. #if defined(FLASH_OPTR_WPRMOD) || defined(FLASH_OPTR_BFB2)
  625. HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
  626. void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
  627. #endif /* FLASH_OPTR_WPRMOD || FLASH_OPTR_BFB2 */
  628. #if defined(FLASH_OPTR_WPRMOD)
  629. HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void);
  630. HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void);
  631. #endif /* FLASH_OPTR_WPRMOD */
  632. /**
  633. * @}
  634. */
  635. /** @addtogroup FLASHEx_Exported_Functions_Group3
  636. * @{
  637. */
  638. HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Unlock(void);
  639. HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Lock(void);
  640. HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Erase(uint32_t Address);
  641. HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Program(uint32_t TypeProgram, uint32_t Address, uint32_t Data);
  642. void HAL_FLASHEx_DATAEEPROM_EnableFixedTimeProgram(void);
  643. void HAL_FLASHEx_DATAEEPROM_DisableFixedTimeProgram(void);
  644. /**
  645. * @}
  646. */
  647. /**
  648. * @}
  649. */
  650. /**
  651. * @}
  652. */
  653. /**
  654. * @}
  655. */
  656. #ifdef __cplusplus
  657. }
  658. #endif
  659. #endif /* __STM32L0xx_HAL_FLASH_EX_H */