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