1 /** 2 ****************************************************************************** 3 * @file stm32g0xx_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) 2018 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 STM32G0xx_HAL_FLASH_EX_H 20 #define STM32G0xx_HAL_FLASH_EX_H 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 /* Includes ------------------------------------------------------------------*/ 27 #include "stm32g0xx_hal_def.h" 28 29 /** @addtogroup STM32G0xx_HAL_Driver 30 * @{ 31 */ 32 33 /** @addtogroup FLASHEx 34 * @{ 35 */ 36 37 /* Exported types ------------------------------------------------------------*/ 38 /* Exported constants --------------------------------------------------------*/ 39 /** @defgroup FLASHEx_Exported_Constants FLASH Exported Constants 40 * @{ 41 */ 42 /** @defgroup FLASHEx_Empty_Check FLASHEx Empty Check 43 * @{ 44 */ 45 #define FLASH_PROG_NOT_EMPTY 0x00000000u /*!< 1st location in Flash is programmed */ 46 #define FLASH_PROG_EMPTY FLASH_ACR_PROGEMPTY /*!< 1st location in Flash is empty */ 47 /** 48 * @} 49 */ 50 /** 51 * @} 52 */ 53 54 /* Exported macro ------------------------------------------------------------*/ 55 /* Exported functions --------------------------------------------------------*/ 56 /** @addtogroup FLASHEx_Exported_Functions 57 * @{ 58 */ 59 60 /* Extended Program operation functions *************************************/ 61 /** @addtogroup FLASHEx_Exported_Functions_Group1 62 * @{ 63 */ 64 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); 65 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); 66 void HAL_FLASHEx_EnableDebugger(void); 67 void HAL_FLASHEx_DisableDebugger(void); 68 uint32_t HAL_FLASHEx_FlashEmptyCheck(void); 69 void HAL_FLASHEx_ForceFlashEmpty(uint32_t FlashEmpty); 70 #if defined(FLASH_SECURABLE_MEMORY_SUPPORT) 71 void HAL_FLASHEx_EnableSecMemProtection(uint32_t Banks); 72 #endif /* FLASH_SECURABLE_MEMORY_SUPPORT */ 73 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); 74 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); 75 /** 76 * @} 77 */ 78 79 /** 80 * @} 81 */ 82 83 /* Private macros ------------------------------------------------------------*/ 84 /** @defgroup FLASHEx_Private_Constants FLASHEx Private Constants 85 * @{ 86 */ 87 #define FLASH_PCROP_GRANULARITY_OFFSET 9u /*!< FLASH Code Readout Protection granularity offset */ 88 #define FLASH_PCROP_GRANULARITY (1UL << FLASH_PCROP_GRANULARITY_OFFSET) /*!< FLASH Code Readout Protection granularity, 512 Bytes */ 89 /** 90 * @} 91 */ 92 93 94 /** @defgroup FLASHEx_Private_Macros FLASHEx Private Macros 95 * @{ 96 */ 97 #define IS_FLASH_EMPTY_CHECK(__VALUE__) (((__VALUE__) == FLASH_PROG_EMPTY) || ((__VALUE__) == FLASH_PROG_NOT_EMPTY)) 98 void FLASH_PageErase(uint32_t Banks, uint32_t Page); 99 /** 100 * @} 101 */ 102 103 /** 104 * @} 105 */ 106 107 /** 108 * @} 109 */ 110 111 #ifdef __cplusplus 112 } 113 #endif 114 115 #endif /* STM32G0xx_HAL_FLASH_EX_H */ 116 117