1 /** 2 ****************************************************************************** 3 * @file stm32wlxx_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) 2020 STMicroelectronics. 10 * All rights reserved. 11 * 12 * This software is licensed under terms that can be found in the LICENSE file 13 * in 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 19 /* Define to prevent recursive inclusion -------------------------------------*/ 20 #ifndef STM32WLxx_HAL_FLASH_EX_H 21 #define STM32WLxx_HAL_FLASH_EX_H 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 /* Includes ------------------------------------------------------------------*/ 28 #include "stm32wlxx_hal_def.h" 29 30 /** @addtogroup STM32WLxx_HAL_Driver 31 * @{ 32 */ 33 34 /** @addtogroup FLASHEx 35 * @{ 36 */ 37 38 /* Exported types ------------------------------------------------------------*/ 39 /* Exported constants --------------------------------------------------------*/ 40 /** @defgroup FLASHEx_Exported_Constants FLASH Exported Constants 41 * @{ 42 */ 43 /** @defgroup FLASHEx_EMPTY_CHECK FLASHEx Empty Check 44 * @{ 45 */ 46 #define FLASH_PROG_NOT_EMPTY 0x00000000U /*!< 1st location in Flash is programmed */ 47 #define FLASH_PROG_EMPTY FLASH_ACR_EMPTY /*!< 1st location in Flash is empty */ 48 /** 49 * @} 50 */ 51 52 /** @defgroup FLASHEx_PRIV_MODE_CFG FLASHEx privilege mode configuration 53 * @{ 54 */ 55 #define FLASH_PRIV_GRANTED 0x00000000U /*!< access to Flash registers is granted */ 56 #define FLASH_PRIV_DENIED FLASH_ACR2_PRIVMODE /*!< access to Flash registers is denied to non-privilege access */ 57 /** 58 * @} 59 */ 60 /** 61 * @} 62 */ 63 64 /* Exported macro ------------------------------------------------------------*/ 65 /* Exported functions --------------------------------------------------------*/ 66 /** @addtogroup FLASHEx_Exported_Functions 67 * @{ 68 */ 69 70 /* Extended Program operation functions *************************************/ 71 /** @addtogroup FLASHEx_Exported_Functions_Group1 72 * @{ 73 */ 74 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); 75 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); 76 uint32_t HAL_FLASHEx_FlashEmptyCheck(void); 77 void HAL_FLASHEx_ForceFlashEmpty(uint32_t FlashEmpty); 78 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); 79 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); 80 void HAL_FLASHEx_SuspendOperation(void); 81 void HAL_FLASHEx_AllowOperation(void); 82 uint32_t HAL_FLASHEx_IsOperationSuspended(void); 83 #if defined(DUAL_CORE) 84 void HAL_FLASHEx_DisableC2Debug(void); 85 void HAL_FLASHEx_EnableC2Debug(void); 86 void HAL_FLASHEx_EnableSecHideProtection(void); 87 void HAL_FLASHEx_ConfigPrivMode(uint32_t PrivMode); 88 uint32_t HAL_FLASHEx_GetPrivMode(void); 89 #endif /* DUAL_CORE */ 90 /** 91 * @} 92 */ 93 94 /** 95 * @} 96 */ 97 98 /* Private macros ------------------------------------------------------------*/ 99 /** @defgroup FLASHEx_Private_Macros FLASHEx Private Macros 100 * @{ 101 */ 102 #define IS_FLASH_EMPTY_CHECK(__VALUE__) (((__VALUE__) == FLASH_PROG_EMPTY) || ((__VALUE__) == FLASH_PROG_NOT_EMPTY)) 103 104 #define IS_FLASH_CFGPRIVMODE(__VALUE__) (((__VALUE__) == FLASH_PRIV_GRANTED) || ((__VALUE__) == FLASH_PRIV_DENIED)) 105 /** 106 * @} 107 */ 108 109 /* Private Functions ---------------------------------------------------------*/ 110 /** @defgroup FLASHEx_Private_Functions FLASHEx Private Functions 111 * @{ 112 */ 113 void FLASH_PageErase(uint32_t Page); 114 /** 115 * @} 116 */ 117 118 /** 119 * @} 120 */ 121 122 /** 123 * @} 124 */ 125 126 #ifdef __cplusplus 127 } 128 #endif 129 130 #endif /* STM32WLxx_HAL_FLASH_EX_H */ 131 132