stm32g0xx_hal_flash_ex.h 3.6 KB

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