py32f0xx_hal_flash_ex.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. ******************************************************************************
  3. * @file py32f0xx_hal_flash_ex.h
  4. * @author MCU Application Team
  5. * @brief Header file of FLASH HAL Extended module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by Puya under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. * @attention
  19. *
  20. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  21. * All rights reserved.</center></h2>
  22. *
  23. * This software component is licensed by ST under BSD 3-Clause license,
  24. * the "License"; You may not use this file except in compliance with the
  25. * License. You may obtain a copy of the License at:
  26. * opensource.org/licenses/BSD-3-Clause
  27. *
  28. ******************************************************************************
  29. */
  30. /* Define to prevent recursive inclusion -------------------------------------*/
  31. #ifndef __PY32F0xx_HAL_FLASH_EX_H
  32. #define __PY32F0xx_HAL_FLASH_EX_H
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /* Includes ------------------------------------------------------------------*/
  37. #include "py32f0xx_hal_def.h"
  38. /** @addtogroup PY32F0xx_HAL_Driver
  39. * @{
  40. */
  41. /** @addtogroup FLASHEx
  42. * @{
  43. */
  44. /* Exported types ------------------------------------------------------------*/
  45. /* Exported constants --------------------------------------------------------*/
  46. /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
  47. * @{
  48. */
  49. /** @defgroup FLASHEx_Empty_Check FLASHEx Empty Check
  50. * @{
  51. */
  52. #define FLASH_PROG_NOT_EMPTY 0x00000000u /*!< 1st location in Flash is programmed */
  53. #define FLASH_PROG_EMPTY FLASH_ACR_PROGEMPTY /*!< 1st location in Flash is empty */
  54. /**
  55. * @}
  56. */
  57. /**
  58. * @}
  59. */
  60. /* Exported macro ------------------------------------------------------------*/
  61. /* Exported functions --------------------------------------------------------*/
  62. /** @defgroup FLASHEx_Exported_Functions FLASHEx Exported Functions
  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. void HAL_FLASHEx_EnableDebugger(void);
  72. void HAL_FLASHEx_DisableDebugger(void);
  73. uint32_t HAL_FLASHEx_FlashEmptyCheck(void);
  74. void HAL_FLASHEx_ForceFlashEmpty(uint32_t FlashEmpty);
  75. #if defined(FLASH_SECURABLE_MEMORY_SUPPORT)
  76. void HAL_FLASHEx_EnableSecMemProtection(uint32_t Bank);
  77. #endif
  78. HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
  79. void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
  80. /**
  81. * @}
  82. */
  83. /**
  84. * @}
  85. */
  86. /* Private macros ------------------------------------------------------------*/
  87. /** @defgroup FLASHEx_Private_Constants FLASHEx Private Constants
  88. * @{
  89. */
  90. #define FLASH_PCROP_GRANULARITY_OFFSET 9u /*!< FLASH Code Readout Protection granularity offset */
  91. #define FLASH_PCROP_GRANULARITY (1UL << FLASH_PCROP_GRANULARITY_OFFSET) /*!< FLASH Code Readout Protection granularity, 512 Bytes */
  92. /**
  93. * @}
  94. */
  95. /** @defgroup FLASHEx_Private_Macros FLASHEx Private Macros
  96. * @{
  97. */
  98. #define IS_FLASH_EMPTY_CHECK(__VALUE__) (((__VALUE__) == FLASH_PROG_EMPTY) || ((__VALUE__) == FLASH_PROG_NOT_EMPTY))
  99. void FLASH_PageErase(uint32_t Page);
  100. /**
  101. * @}
  102. */
  103. /**
  104. * @}
  105. */
  106. /**
  107. * @}
  108. */
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif /* __PY32F0xx_HAL_FLASH_EX_H */
  113. /************************ (C) COPYRIGHT Puya *****END OF FILE****/