mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Parent:
441:d2c15dda23c1
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 340:28d1f895c6fe 1 /**
mbed_official 340:28d1f895c6fe 2 ******************************************************************************
mbed_official 340:28d1f895c6fe 3 * @file stm32f0xx_hal_flash.h
mbed_official 340:28d1f895c6fe 4 * @author MCD Application Team
mbed_official 630:825f75ca301e 5 * @version V1.3.0
mbed_official 630:825f75ca301e 6 * @date 26-June-2015
mbed_official 340:28d1f895c6fe 7 * @brief Header file of Flash HAL module.
mbed_official 340:28d1f895c6fe 8 ******************************************************************************
mbed_official 340:28d1f895c6fe 9 * @attention
mbed_official 340:28d1f895c6fe 10 *
mbed_official 630:825f75ca301e 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 340:28d1f895c6fe 12 *
mbed_official 340:28d1f895c6fe 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 340:28d1f895c6fe 14 * are permitted provided that the following conditions are met:
mbed_official 340:28d1f895c6fe 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 340:28d1f895c6fe 16 * this list of conditions and the following disclaimer.
mbed_official 340:28d1f895c6fe 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 340:28d1f895c6fe 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 340:28d1f895c6fe 19 * and/or other materials provided with the distribution.
mbed_official 340:28d1f895c6fe 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 340:28d1f895c6fe 21 * may be used to endorse or promote products derived from this software
mbed_official 340:28d1f895c6fe 22 * without specific prior written permission.
mbed_official 340:28d1f895c6fe 23 *
mbed_official 340:28d1f895c6fe 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 340:28d1f895c6fe 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 340:28d1f895c6fe 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 340:28d1f895c6fe 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 340:28d1f895c6fe 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 340:28d1f895c6fe 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 340:28d1f895c6fe 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 340:28d1f895c6fe 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 340:28d1f895c6fe 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 340:28d1f895c6fe 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 340:28d1f895c6fe 34 *
mbed_official 340:28d1f895c6fe 35 ******************************************************************************
mbed_official 340:28d1f895c6fe 36 */
mbed_official 340:28d1f895c6fe 37
mbed_official 340:28d1f895c6fe 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 340:28d1f895c6fe 39 #ifndef __STM32F0xx_HAL_FLASH_H
mbed_official 340:28d1f895c6fe 40 #define __STM32F0xx_HAL_FLASH_H
mbed_official 340:28d1f895c6fe 41
mbed_official 340:28d1f895c6fe 42 #ifdef __cplusplus
mbed_official 340:28d1f895c6fe 43 extern "C" {
mbed_official 340:28d1f895c6fe 44 #endif
mbed_official 340:28d1f895c6fe 45
mbed_official 340:28d1f895c6fe 46 /* Includes ------------------------------------------------------------------*/
mbed_official 340:28d1f895c6fe 47 #include "stm32f0xx_hal_def.h"
mbed_official 630:825f75ca301e 48
mbed_official 340:28d1f895c6fe 49 /** @addtogroup STM32F0xx_HAL_Driver
mbed_official 340:28d1f895c6fe 50 * @{
mbed_official 340:28d1f895c6fe 51 */
mbed_official 340:28d1f895c6fe 52
mbed_official 340:28d1f895c6fe 53 /** @addtogroup FLASH
mbed_official 340:28d1f895c6fe 54 * @{
mbed_official 630:825f75ca301e 55 */
mbed_official 630:825f75ca301e 56
mbed_official 630:825f75ca301e 57 /** @addtogroup FLASH_Private_Constants
mbed_official 630:825f75ca301e 58 * @{
mbed_official 630:825f75ca301e 59 */
mbed_official 630:825f75ca301e 60 #define FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */
mbed_official 630:825f75ca301e 61 /**
mbed_official 630:825f75ca301e 62 * @}
mbed_official 630:825f75ca301e 63 */
mbed_official 630:825f75ca301e 64
mbed_official 630:825f75ca301e 65 /** @addtogroup FLASH_Private_Macros
mbed_official 630:825f75ca301e 66 * @{
mbed_official 630:825f75ca301e 67 */
mbed_official 630:825f75ca301e 68
mbed_official 630:825f75ca301e 69 #define IS_FLASH_TYPEPROGRAM(VALUE) (((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \
mbed_official 630:825f75ca301e 70 ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \
mbed_official 630:825f75ca301e 71 ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD))
mbed_official 630:825f75ca301e 72
mbed_official 630:825f75ca301e 73 #define IS_FLASH_LATENCY(__LATENCY__) (((__LATENCY__) == FLASH_LATENCY_0) || \
mbed_official 630:825f75ca301e 74 ((__LATENCY__) == FLASH_LATENCY_1))
mbed_official 630:825f75ca301e 75
mbed_official 630:825f75ca301e 76 /**
mbed_official 630:825f75ca301e 77 * @}
mbed_official 630:825f75ca301e 78 */
mbed_official 340:28d1f895c6fe 79
mbed_official 340:28d1f895c6fe 80 /* Exported types ------------------------------------------------------------*/
mbed_official 340:28d1f895c6fe 81 /** @defgroup FLASH_Exported_Types FLASH Exported Types
mbed_official 340:28d1f895c6fe 82 * @{
mbed_official 340:28d1f895c6fe 83 */
mbed_official 340:28d1f895c6fe 84
mbed_official 340:28d1f895c6fe 85
mbed_official 340:28d1f895c6fe 86 /**
mbed_official 340:28d1f895c6fe 87 * @brief FLASH Procedure structure definition
mbed_official 340:28d1f895c6fe 88 */
mbed_official 340:28d1f895c6fe 89 typedef enum
mbed_official 340:28d1f895c6fe 90 {
mbed_official 340:28d1f895c6fe 91 FLASH_PROC_NONE = 0,
mbed_official 340:28d1f895c6fe 92 FLASH_PROC_PAGEERASE = 1,
mbed_official 340:28d1f895c6fe 93 FLASH_PROC_MASSERASE = 2,
mbed_official 340:28d1f895c6fe 94 FLASH_PROC_PROGRAMHALFWORD = 3,
mbed_official 340:28d1f895c6fe 95 FLASH_PROC_PROGRAMWORD = 4,
mbed_official 340:28d1f895c6fe 96 FLASH_PROC_PROGRAMDOUBLEWORD = 5
mbed_official 340:28d1f895c6fe 97 } FLASH_ProcedureTypeDef;
mbed_official 340:28d1f895c6fe 98
mbed_official 340:28d1f895c6fe 99 /**
mbed_official 340:28d1f895c6fe 100 * @brief FLASH handle Structure definition
mbed_official 340:28d1f895c6fe 101 */
mbed_official 340:28d1f895c6fe 102 typedef struct
mbed_official 340:28d1f895c6fe 103 {
mbed_official 441:d2c15dda23c1 104 __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */
mbed_official 340:28d1f895c6fe 105
mbed_official 441:d2c15dda23c1 106 __IO uint32_t DataRemaining; /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */
mbed_official 340:28d1f895c6fe 107
mbed_official 441:d2c15dda23c1 108 __IO uint32_t Address; /*!< Internal variable to save address selected for program or erase */
mbed_official 340:28d1f895c6fe 109
mbed_official 441:d2c15dda23c1 110 __IO uint64_t Data; /*!< Internal variable to save data to be programmed */
mbed_official 340:28d1f895c6fe 111
mbed_official 441:d2c15dda23c1 112 HAL_LockTypeDef Lock; /*!< FLASH locking object */
mbed_official 340:28d1f895c6fe 113
mbed_official 441:d2c15dda23c1 114 __IO uint32_t ErrorCode; /*!< FLASH error code
mbed_official 630:825f75ca301e 115 This parameter can be a value of @ref FLASH_Error_Codes */
mbed_official 340:28d1f895c6fe 116 } FLASH_ProcessTypeDef;
mbed_official 340:28d1f895c6fe 117
mbed_official 340:28d1f895c6fe 118 /**
mbed_official 340:28d1f895c6fe 119 * @}
mbed_official 340:28d1f895c6fe 120 */
mbed_official 340:28d1f895c6fe 121
mbed_official 340:28d1f895c6fe 122 /* Exported constants --------------------------------------------------------*/
mbed_official 340:28d1f895c6fe 123 /** @defgroup FLASH_Exported_Constants FLASH Exported Constants
mbed_official 340:28d1f895c6fe 124 * @{
mbed_official 340:28d1f895c6fe 125 */
mbed_official 340:28d1f895c6fe 126
mbed_official 630:825f75ca301e 127 /** @defgroup FLASH_Error_Codes FLASH Error Codes
mbed_official 441:d2c15dda23c1 128 * @{
mbed_official 441:d2c15dda23c1 129 */
mbed_official 630:825f75ca301e 130
mbed_official 630:825f75ca301e 131 #define HAL_FLASH_ERROR_NONE ((uint32_t)0x00)
mbed_official 630:825f75ca301e 132 #define HAL_FLASH_ERROR_PROG ((uint32_t)0x01)
mbed_official 630:825f75ca301e 133 #define HAL_FLASH_ERROR_WRP ((uint32_t)0x02)
mbed_official 441:d2c15dda23c1 134
mbed_official 340:28d1f895c6fe 135 /**
mbed_official 340:28d1f895c6fe 136 * @}
mbed_official 340:28d1f895c6fe 137 */
mbed_official 340:28d1f895c6fe 138
mbed_official 340:28d1f895c6fe 139 /** @defgroup FLASH_Type_Program FLASH Type Program
mbed_official 340:28d1f895c6fe 140 * @{
mbed_official 340:28d1f895c6fe 141 */
mbed_official 630:825f75ca301e 142 #define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01) /*!<Program a half-word (16-bit) at a specified address.*/
mbed_official 630:825f75ca301e 143 #define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02) /*!<Program a word (32-bit) at a specified address.*/
mbed_official 630:825f75ca301e 144 #define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03) /*!<Program a double word (64-bit) at a specified address*/
mbed_official 340:28d1f895c6fe 145
mbed_official 340:28d1f895c6fe 146 /**
mbed_official 340:28d1f895c6fe 147 * @}
mbed_official 340:28d1f895c6fe 148 */
mbed_official 340:28d1f895c6fe 149
mbed_official 340:28d1f895c6fe 150 /** @defgroup FLASH_Latency FLASH Latency
mbed_official 340:28d1f895c6fe 151 * @{
mbed_official 340:28d1f895c6fe 152 */
mbed_official 340:28d1f895c6fe 153 #define FLASH_LATENCY_0 ((uint32_t)0x00000000) /*!< FLASH Zero Latency cycle */
mbed_official 340:28d1f895c6fe 154 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */
mbed_official 340:28d1f895c6fe 155
mbed_official 340:28d1f895c6fe 156 /**
mbed_official 340:28d1f895c6fe 157 * @}
mbed_official 340:28d1f895c6fe 158 */
mbed_official 340:28d1f895c6fe 159
mbed_official 340:28d1f895c6fe 160
mbed_official 340:28d1f895c6fe 161 /** @defgroup FLASH_Flag_definition FLASH Flag definition
mbed_official 340:28d1f895c6fe 162 * @{
mbed_official 340:28d1f895c6fe 163 */
mbed_official 340:28d1f895c6fe 164 #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */
mbed_official 340:28d1f895c6fe 165 #define FLASH_FLAG_PGERR FLASH_SR_PGERR /*!< FLASH Programming error flag */
mbed_official 340:28d1f895c6fe 166 #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */
mbed_official 340:28d1f895c6fe 167 #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Operation flag */
mbed_official 340:28d1f895c6fe 168 /**
mbed_official 340:28d1f895c6fe 169 * @}
mbed_official 340:28d1f895c6fe 170 */
mbed_official 340:28d1f895c6fe 171
mbed_official 340:28d1f895c6fe 172 /** @defgroup FLASH_Interrupt_definition FLASH Interrupt definition
mbed_official 340:28d1f895c6fe 173 * @{
mbed_official 340:28d1f895c6fe 174 */
mbed_official 340:28d1f895c6fe 175 #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */
mbed_official 340:28d1f895c6fe 176 #define FLASH_IT_ERR FLASH_CR_ERRIE /*!< Error Interrupt source */
mbed_official 340:28d1f895c6fe 177 /**
mbed_official 340:28d1f895c6fe 178 * @}
mbed_official 340:28d1f895c6fe 179 */
mbed_official 340:28d1f895c6fe 180
mbed_official 340:28d1f895c6fe 181 /**
mbed_official 340:28d1f895c6fe 182 * @}
mbed_official 340:28d1f895c6fe 183 */
mbed_official 340:28d1f895c6fe 184
mbed_official 340:28d1f895c6fe 185 /* Exported macro ------------------------------------------------------------*/
mbed_official 340:28d1f895c6fe 186
mbed_official 340:28d1f895c6fe 187 /** @defgroup FLASH_Exported_Macros FLASH Exported Macros
mbed_official 340:28d1f895c6fe 188 * @brief macros to control FLASH features
mbed_official 340:28d1f895c6fe 189 * @{
mbed_official 340:28d1f895c6fe 190 */
mbed_official 630:825f75ca301e 191
mbed_official 340:28d1f895c6fe 192 /** @defgroup FLASH_Latency FLASH Latency
mbed_official 340:28d1f895c6fe 193 * @brief macros to handle FLASH Latency
mbed_official 340:28d1f895c6fe 194 * @{
mbed_official 340:28d1f895c6fe 195 */
mbed_official 340:28d1f895c6fe 196
mbed_official 340:28d1f895c6fe 197 /**
mbed_official 340:28d1f895c6fe 198 * @brief Set the FLASH Latency.
mbed_official 340:28d1f895c6fe 199 * @param __LATENCY__: FLASH Latency
mbed_official 340:28d1f895c6fe 200 * The value of this parameter depend on device used within the same series
mbed_official 340:28d1f895c6fe 201 * @retval None
mbed_official 340:28d1f895c6fe 202 */
mbed_official 340:28d1f895c6fe 203 #define __HAL_FLASH_SET_LATENCY(__LATENCY__) (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__))
mbed_official 630:825f75ca301e 204
mbed_official 630:825f75ca301e 205
mbed_official 630:825f75ca301e 206 /**
mbed_official 630:825f75ca301e 207 * @brief Get the FLASH Latency.
mbed_official 630:825f75ca301e 208 * @retval FLASH Latency
mbed_official 630:825f75ca301e 209 * The value of this parameter depend on device used within the same series
mbed_official 630:825f75ca301e 210 */
mbed_official 630:825f75ca301e 211 #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
mbed_official 630:825f75ca301e 212
mbed_official 340:28d1f895c6fe 213 /**
mbed_official 340:28d1f895c6fe 214 * @}
mbed_official 340:28d1f895c6fe 215 */
mbed_official 340:28d1f895c6fe 216
mbed_official 340:28d1f895c6fe 217 /** @defgroup FLASH_Prefetch FLASH Prefetch
mbed_official 340:28d1f895c6fe 218 * @brief macros to handle FLASH Prefetch buffer
mbed_official 340:28d1f895c6fe 219 * @{
mbed_official 340:28d1f895c6fe 220 */
mbed_official 340:28d1f895c6fe 221 /**
mbed_official 340:28d1f895c6fe 222 * @brief Enable the FLASH prefetch buffer.
mbed_official 340:28d1f895c6fe 223 * @retval None
mbed_official 340:28d1f895c6fe 224 */
mbed_official 340:28d1f895c6fe 225 #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTBE)
mbed_official 340:28d1f895c6fe 226
mbed_official 340:28d1f895c6fe 227 /**
mbed_official 340:28d1f895c6fe 228 * @brief Disable the FLASH prefetch buffer.
mbed_official 340:28d1f895c6fe 229 * @retval None
mbed_official 340:28d1f895c6fe 230 */
mbed_official 340:28d1f895c6fe 231 #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTBE))
mbed_official 340:28d1f895c6fe 232
mbed_official 340:28d1f895c6fe 233 /**
mbed_official 340:28d1f895c6fe 234 * @}
mbed_official 340:28d1f895c6fe 235 */
mbed_official 630:825f75ca301e 236
mbed_official 630:825f75ca301e 237 /** @defgroup FLASH_Interrupt FLASH Interrupts
mbed_official 340:28d1f895c6fe 238 * @brief macros to handle FLASH interrupts
mbed_official 340:28d1f895c6fe 239 * @{
mbed_official 340:28d1f895c6fe 240 */
mbed_official 340:28d1f895c6fe 241
mbed_official 340:28d1f895c6fe 242 /**
mbed_official 340:28d1f895c6fe 243 * @brief Enable the specified FLASH interrupt.
mbed_official 340:28d1f895c6fe 244 * @param __INTERRUPT__ : FLASH interrupt
mbed_official 340:28d1f895c6fe 245 * This parameter can be any combination of the following values:
mbed_official 340:28d1f895c6fe 246 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
mbed_official 340:28d1f895c6fe 247 * @arg FLASH_IT_ERR: Error Interrupt
mbed_official 340:28d1f895c6fe 248 * @retval none
mbed_official 340:28d1f895c6fe 249 */
mbed_official 630:825f75ca301e 250 #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) SET_BIT((FLASH->CR), (__INTERRUPT__))
mbed_official 340:28d1f895c6fe 251
mbed_official 340:28d1f895c6fe 252 /**
mbed_official 340:28d1f895c6fe 253 * @brief Disable the specified FLASH interrupt.
mbed_official 340:28d1f895c6fe 254 * @param __INTERRUPT__ : FLASH interrupt
mbed_official 340:28d1f895c6fe 255 * This parameter can be any combination of the following values:
mbed_official 340:28d1f895c6fe 256 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
mbed_official 340:28d1f895c6fe 257 * @arg FLASH_IT_ERR: Error Interrupt
mbed_official 340:28d1f895c6fe 258 * @retval none
mbed_official 340:28d1f895c6fe 259 */
mbed_official 630:825f75ca301e 260 #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) CLEAR_BIT((FLASH->CR), (uint32_t)(__INTERRUPT__))
mbed_official 340:28d1f895c6fe 261
mbed_official 340:28d1f895c6fe 262 /**
mbed_official 340:28d1f895c6fe 263 * @brief Get the specified FLASH flag status.
mbed_official 340:28d1f895c6fe 264 * @param __FLAG__: specifies the FLASH flag to check.
mbed_official 340:28d1f895c6fe 265 * This parameter can be one of the following values:
mbed_official 630:825f75ca301e 266 * @arg FLASH_FLAG_BSY : FLASH Busy flag
mbed_official 630:825f75ca301e 267 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
mbed_official 630:825f75ca301e 268 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
mbed_official 630:825f75ca301e 269 * @arg FLASH_FLAG_PGERR : FLASH Programming error flag
mbed_official 340:28d1f895c6fe 270 * @retval The new state of __FLAG__ (SET or RESET).
mbed_official 340:28d1f895c6fe 271 */
mbed_official 630:825f75ca301e 272 #define __HAL_FLASH_GET_FLAG(__FLAG__) (((FLASH->SR) & (__FLAG__)) == (__FLAG__))
mbed_official 340:28d1f895c6fe 273
mbed_official 340:28d1f895c6fe 274 /**
mbed_official 340:28d1f895c6fe 275 * @brief Clear the specified FLASH flag.
mbed_official 340:28d1f895c6fe 276 * @param __FLAG__: specifies the FLASH flags to clear.
mbed_official 340:28d1f895c6fe 277 * This parameter can be any combination of the following values:
mbed_official 630:825f75ca301e 278 * @arg FLASH_FLAG_BSY : FLASH Busy flag
mbed_official 630:825f75ca301e 279 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
mbed_official 630:825f75ca301e 280 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
mbed_official 630:825f75ca301e 281 * @arg FLASH_FLAG_PGERR : FLASH Programming error flag
mbed_official 340:28d1f895c6fe 282 * @retval none
mbed_official 340:28d1f895c6fe 283 */
mbed_official 630:825f75ca301e 284 #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) ((FLASH->SR) = (__FLAG__))
mbed_official 340:28d1f895c6fe 285
mbed_official 340:28d1f895c6fe 286 /**
mbed_official 340:28d1f895c6fe 287 * @}
mbed_official 340:28d1f895c6fe 288 */
mbed_official 340:28d1f895c6fe 289
mbed_official 340:28d1f895c6fe 290 /**
mbed_official 340:28d1f895c6fe 291 * @}
mbed_official 340:28d1f895c6fe 292 */
mbed_official 630:825f75ca301e 293
mbed_official 630:825f75ca301e 294 /* Include FLASH HAL Extended module */
mbed_official 340:28d1f895c6fe 295 #include "stm32f0xx_hal_flash_ex.h"
mbed_official 340:28d1f895c6fe 296
mbed_official 340:28d1f895c6fe 297 /* Exported functions --------------------------------------------------------*/
mbed_official 340:28d1f895c6fe 298 /** @addtogroup FLASH_Exported_Functions
mbed_official 340:28d1f895c6fe 299 * @{
mbed_official 630:825f75ca301e 300 */
mbed_official 340:28d1f895c6fe 301
mbed_official 630:825f75ca301e 302 /** @addtogroup FLASH_Exported_Functions_Group1
mbed_official 630:825f75ca301e 303 * @{
mbed_official 630:825f75ca301e 304 */
mbed_official 340:28d1f895c6fe 305 /* IO operation functions *****************************************************/
mbed_official 630:825f75ca301e 306 HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
mbed_official 630:825f75ca301e 307 HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
mbed_official 340:28d1f895c6fe 308
mbed_official 340:28d1f895c6fe 309 /* FLASH IRQ handler method */
mbed_official 630:825f75ca301e 310 void HAL_FLASH_IRQHandler(void);
mbed_official 340:28d1f895c6fe 311 /* Callbacks in non blocking modes */
mbed_official 630:825f75ca301e 312 void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
mbed_official 630:825f75ca301e 313 void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
mbed_official 340:28d1f895c6fe 314
mbed_official 340:28d1f895c6fe 315 /**
mbed_official 340:28d1f895c6fe 316 * @}
mbed_official 340:28d1f895c6fe 317 */
mbed_official 340:28d1f895c6fe 318
mbed_official 630:825f75ca301e 319 /** @addtogroup FLASH_Exported_Functions_Group2
mbed_official 630:825f75ca301e 320 * @{
mbed_official 630:825f75ca301e 321 */
mbed_official 630:825f75ca301e 322 /* Peripheral Control functions ***********************************************/
mbed_official 630:825f75ca301e 323 HAL_StatusTypeDef HAL_FLASH_Unlock(void);
mbed_official 630:825f75ca301e 324 HAL_StatusTypeDef HAL_FLASH_Lock(void);
mbed_official 630:825f75ca301e 325 HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
mbed_official 630:825f75ca301e 326 HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
mbed_official 630:825f75ca301e 327 HAL_StatusTypeDef HAL_FLASH_OB_Launch(void);
mbed_official 630:825f75ca301e 328
mbed_official 630:825f75ca301e 329 /**
mbed_official 630:825f75ca301e 330 * @}
mbed_official 630:825f75ca301e 331 */
mbed_official 630:825f75ca301e 332
mbed_official 630:825f75ca301e 333 /** @addtogroup FLASH_Exported_Functions_Group3
mbed_official 630:825f75ca301e 334 * @{
mbed_official 630:825f75ca301e 335 */
mbed_official 340:28d1f895c6fe 336 /* Peripheral State and Error functions ***************************************/
mbed_official 441:d2c15dda23c1 337 uint32_t HAL_FLASH_GetError(void);
mbed_official 340:28d1f895c6fe 338
mbed_official 340:28d1f895c6fe 339 /**
mbed_official 340:28d1f895c6fe 340 * @}
mbed_official 340:28d1f895c6fe 341 */
mbed_official 340:28d1f895c6fe 342
mbed_official 340:28d1f895c6fe 343 /**
mbed_official 340:28d1f895c6fe 344 * @}
mbed_official 340:28d1f895c6fe 345 */
mbed_official 340:28d1f895c6fe 346
mbed_official 630:825f75ca301e 347 /* Private function -------------------------------------------------*/
mbed_official 630:825f75ca301e 348 /** @addtogroup FLASH_Private_Functions
mbed_official 630:825f75ca301e 349 * @{
mbed_official 630:825f75ca301e 350 */
mbed_official 630:825f75ca301e 351 void FLASH_PageErase(uint32_t PageAddress);
mbed_official 630:825f75ca301e 352 HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
mbed_official 630:825f75ca301e 353
mbed_official 630:825f75ca301e 354 /**
mbed_official 630:825f75ca301e 355 * @}
mbed_official 630:825f75ca301e 356 */
mbed_official 630:825f75ca301e 357
mbed_official 340:28d1f895c6fe 358 /**
mbed_official 340:28d1f895c6fe 359 * @}
mbed_official 340:28d1f895c6fe 360 */
mbed_official 340:28d1f895c6fe 361
mbed_official 340:28d1f895c6fe 362 /**
mbed_official 340:28d1f895c6fe 363 * @}
mbed_official 340:28d1f895c6fe 364 */
mbed_official 340:28d1f895c6fe 365
mbed_official 340:28d1f895c6fe 366 #ifdef __cplusplus
mbed_official 340:28d1f895c6fe 367 }
mbed_official 340:28d1f895c6fe 368 #endif
mbed_official 340:28d1f895c6fe 369
mbed_official 340:28d1f895c6fe 370 #endif /* __STM32F0xx_HAL_FLASH_H */
mbed_official 340:28d1f895c6fe 371
mbed_official 340:28d1f895c6fe 372 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
mbed_official 340:28d1f895c6fe 373