stm32l4xx_hal_flash_ex.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_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) 2017 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 STM32L4xx_HAL_FLASH_EX_H
  19. #define STM32L4xx_HAL_FLASH_EX_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32l4xx_hal_def.h"
  25. /** @addtogroup STM32L4xx_HAL_Driver
  26. * @{
  27. */
  28. /** @addtogroup FLASHEx
  29. * @{
  30. */
  31. /* Exported types ------------------------------------------------------------*/
  32. /* Exported constants --------------------------------------------------------*/
  33. #if defined (FLASH_CFGR_LVEN)
  34. /** @addtogroup FLASHEx_Exported_Constants
  35. * @{
  36. */
  37. /** @defgroup FLASHEx_LVE_PIN_CFG FLASHEx LVE pin configuration
  38. * @{
  39. */
  40. #define FLASH_LVE_PIN_CTRL 0x00000000U /*!< LVE FLASH pin controlled by power controller */
  41. #define FLASH_LVE_PIN_FORCED FLASH_CFGR_LVEN /*!< LVE FLASH pin enforced to low (external SMPS used) */
  42. /**
  43. * @}
  44. */
  45. /**
  46. * @}
  47. */
  48. #endif /* FLASH_CFGR_LVEN */
  49. /* Exported macro ------------------------------------------------------------*/
  50. /* Exported functions --------------------------------------------------------*/
  51. /** @addtogroup FLASHEx_Exported_Functions
  52. * @{
  53. */
  54. /* Extended Program operation functions *************************************/
  55. /** @addtogroup FLASHEx_Exported_Functions_Group1
  56. * @{
  57. */
  58. HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
  59. HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
  60. HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
  61. void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
  62. /**
  63. * @}
  64. */
  65. #if defined (FLASH_CFGR_LVEN)
  66. /** @addtogroup FLASHEx_Exported_Functions_Group2
  67. * @{
  68. */
  69. HAL_StatusTypeDef HAL_FLASHEx_ConfigLVEPin(uint32_t ConfigLVE);
  70. /**
  71. * @}
  72. */
  73. #endif /* FLASH_CFGR_LVEN */
  74. /**
  75. * @}
  76. */
  77. /* Private function ----------------------------------------------------------*/
  78. /** @addtogroup FLASHEx_Private_Functions FLASHEx Private Functions
  79. * @{
  80. */
  81. void FLASH_PageErase(uint32_t Page, uint32_t Banks);
  82. void FLASH_FlushCaches(void);
  83. /**
  84. * @}
  85. */
  86. /* Private macros ------------------------------------------------------------*/
  87. /**
  88. @cond 0
  89. */
  90. #if defined (FLASH_CFGR_LVEN)
  91. #define IS_FLASH_LVE_PIN(CFG) (((CFG) == FLASH_LVE_PIN_CTRL) || ((CFG) == FLASH_LVE_PIN_FORCED))
  92. #endif /* FLASH_CFGR_LVEN */
  93. /**
  94. @endcond
  95. */
  96. /**
  97. * @}
  98. */
  99. /**
  100. * @}
  101. */
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* STM32L4xx_HAL_FLASH_EX_H */