Mbed for VNG board

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Nov 07 15:45:07 2014 +0000
Revision:
394:83f921546702
Parent:
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_hal_flash.h@354:e67efb2aab0e
Synchronized with git revision aab52cb7ec5a665869e507dd988bbfd55b7e087e

Full URL: https://github.com/mbedmicro/mbed/commit/aab52cb7ec5a665869e507dd988bbfd55b7e087e/

Tests: Fix cpputest testrunner

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 354:e67efb2aab0e 1 /**
mbed_official 354:e67efb2aab0e 2 ******************************************************************************
mbed_official 354:e67efb2aab0e 3 * @file stm32l1xx_hal_flash.h
mbed_official 354:e67efb2aab0e 4 * @author MCD Application Team
mbed_official 354:e67efb2aab0e 5 * @version V1.0.0
mbed_official 354:e67efb2aab0e 6 * @date 5-September-2014
mbed_official 354:e67efb2aab0e 7 * @brief Header file of Flash HAL module.
mbed_official 354:e67efb2aab0e 8 ******************************************************************************
mbed_official 354:e67efb2aab0e 9 * @attention
mbed_official 354:e67efb2aab0e 10 *
mbed_official 354:e67efb2aab0e 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 354:e67efb2aab0e 12 *
mbed_official 354:e67efb2aab0e 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 354:e67efb2aab0e 14 * are permitted provided that the following conditions are met:
mbed_official 354:e67efb2aab0e 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 354:e67efb2aab0e 16 * this list of conditions and the following disclaimer.
mbed_official 354:e67efb2aab0e 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 354:e67efb2aab0e 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 354:e67efb2aab0e 19 * and/or other materials provided with the distribution.
mbed_official 354:e67efb2aab0e 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 354:e67efb2aab0e 21 * may be used to endorse or promote products derived from this software
mbed_official 354:e67efb2aab0e 22 * without specific prior written permission.
mbed_official 354:e67efb2aab0e 23 *
mbed_official 354:e67efb2aab0e 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 354:e67efb2aab0e 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 354:e67efb2aab0e 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 354:e67efb2aab0e 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 354:e67efb2aab0e 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 354:e67efb2aab0e 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 354:e67efb2aab0e 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 354:e67efb2aab0e 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 354:e67efb2aab0e 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 354:e67efb2aab0e 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 354:e67efb2aab0e 34 *
mbed_official 354:e67efb2aab0e 35 ******************************************************************************
mbed_official 354:e67efb2aab0e 36 */
mbed_official 354:e67efb2aab0e 37
mbed_official 354:e67efb2aab0e 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 354:e67efb2aab0e 39 #ifndef __STM32L1xx_HAL_FLASH_H
mbed_official 354:e67efb2aab0e 40 #define __STM32L1xx_HAL_FLASH_H
mbed_official 354:e67efb2aab0e 41
mbed_official 354:e67efb2aab0e 42 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 43 extern "C" {
mbed_official 354:e67efb2aab0e 44 #endif
mbed_official 354:e67efb2aab0e 45
mbed_official 354:e67efb2aab0e 46 /* Includes ------------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 47 #include "stm32l1xx_hal_def.h"
mbed_official 354:e67efb2aab0e 48
mbed_official 354:e67efb2aab0e 49 /** @addtogroup STM32L1xx_HAL_Driver
mbed_official 354:e67efb2aab0e 50 * @{
mbed_official 354:e67efb2aab0e 51 */
mbed_official 354:e67efb2aab0e 52
mbed_official 354:e67efb2aab0e 53 /** @addtogroup FLASH
mbed_official 354:e67efb2aab0e 54 * @{
mbed_official 354:e67efb2aab0e 55 */
mbed_official 354:e67efb2aab0e 56
mbed_official 354:e67efb2aab0e 57 /* Exported types ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 58
mbed_official 354:e67efb2aab0e 59 /** @defgroup FLASH_Exported_Types FLASH Exported Types
mbed_official 354:e67efb2aab0e 60 * @{
mbed_official 354:e67efb2aab0e 61 */
mbed_official 354:e67efb2aab0e 62
mbed_official 354:e67efb2aab0e 63 /**
mbed_official 354:e67efb2aab0e 64 * @brief FLASH Error structure definition
mbed_official 354:e67efb2aab0e 65 */
mbed_official 354:e67efb2aab0e 66 typedef enum
mbed_official 354:e67efb2aab0e 67 {
mbed_official 354:e67efb2aab0e 68 FLASH_ERROR_SIZE = 0x01,
mbed_official 354:e67efb2aab0e 69 FLASH_ERROR_OPTV = 0x02,
mbed_official 354:e67efb2aab0e 70 FLASH_ERROR_OPTVUSR = 0x04,
mbed_official 354:e67efb2aab0e 71 FLASH_ERROR_PGA = 0x08,
mbed_official 354:e67efb2aab0e 72 FLASH_ERROR_WRP = 0x10,
mbed_official 354:e67efb2aab0e 73 FLASH_ERROR_RD = 0x20,
mbed_official 354:e67efb2aab0e 74 FLASH_ERROR_OPERATION = 0x40
mbed_official 354:e67efb2aab0e 75 }FLASH_ErrorTypeDef;
mbed_official 354:e67efb2aab0e 76
mbed_official 354:e67efb2aab0e 77
mbed_official 354:e67efb2aab0e 78 /**
mbed_official 354:e67efb2aab0e 79 * @brief FLASH Procedure structure definition
mbed_official 354:e67efb2aab0e 80 */
mbed_official 354:e67efb2aab0e 81 typedef enum
mbed_official 354:e67efb2aab0e 82 {
mbed_official 354:e67efb2aab0e 83 FLASH_PROC_NONE = 0,
mbed_official 354:e67efb2aab0e 84 FLASH_PROC_PAGEERASE,
mbed_official 354:e67efb2aab0e 85 FLASH_PROC_PROGRAM
mbed_official 354:e67efb2aab0e 86 } FLASH_ProcedureTypeDef;
mbed_official 354:e67efb2aab0e 87
mbed_official 354:e67efb2aab0e 88 /**
mbed_official 354:e67efb2aab0e 89 * @brief FLASH handle Structure definition
mbed_official 354:e67efb2aab0e 90 */
mbed_official 354:e67efb2aab0e 91 typedef struct
mbed_official 354:e67efb2aab0e 92 {
mbed_official 354:e67efb2aab0e 93 __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*Internal variable to indicate which procedure is ongoing or not in IT context*/
mbed_official 354:e67efb2aab0e 94
mbed_official 354:e67efb2aab0e 95 __IO uint32_t NbPagesToErase; /*Internal variable to save the remaining sectors to erase in IT context*/
mbed_official 354:e67efb2aab0e 96
mbed_official 354:e67efb2aab0e 97 __IO uint32_t Page; /*Internal variable to define the current sector which is erasing*/
mbed_official 354:e67efb2aab0e 98
mbed_official 354:e67efb2aab0e 99 __IO uint32_t Address; /*Internal variable to save address selected for program*/
mbed_official 354:e67efb2aab0e 100
mbed_official 354:e67efb2aab0e 101 HAL_LockTypeDef Lock; /* FLASH locking object */
mbed_official 354:e67efb2aab0e 102
mbed_official 354:e67efb2aab0e 103 __IO FLASH_ErrorTypeDef ErrorCode; /* FLASH error code */
mbed_official 354:e67efb2aab0e 104
mbed_official 354:e67efb2aab0e 105 }FLASH_ProcessTypeDef;
mbed_official 354:e67efb2aab0e 106
mbed_official 354:e67efb2aab0e 107 /**
mbed_official 354:e67efb2aab0e 108 * @}
mbed_official 354:e67efb2aab0e 109 */
mbed_official 354:e67efb2aab0e 110
mbed_official 354:e67efb2aab0e 111 /** @addtogroup FLASH_Internal_Variables
mbed_official 354:e67efb2aab0e 112 * @{
mbed_official 354:e67efb2aab0e 113 */
mbed_official 354:e67efb2aab0e 114
mbed_official 354:e67efb2aab0e 115 /**
mbed_official 354:e67efb2aab0e 116 * @brief Variable used for Program/Erase sectors under interruption.
mbed_official 354:e67efb2aab0e 117 * Put as extern as used also in flash_ex.c.
mbed_official 354:e67efb2aab0e 118 */
mbed_official 354:e67efb2aab0e 119 extern FLASH_ProcessTypeDef ProcFlash;
mbed_official 354:e67efb2aab0e 120
mbed_official 354:e67efb2aab0e 121 /**
mbed_official 354:e67efb2aab0e 122 * @}
mbed_official 354:e67efb2aab0e 123 */
mbed_official 354:e67efb2aab0e 124
mbed_official 354:e67efb2aab0e 125 /* Exported constants --------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 126
mbed_official 354:e67efb2aab0e 127 /** @defgroup FLASH_Exported_Constants FLASH Exported Constants
mbed_official 354:e67efb2aab0e 128 * @{
mbed_official 354:e67efb2aab0e 129 */
mbed_official 354:e67efb2aab0e 130
mbed_official 354:e67efb2aab0e 131 #define HAL_FLASH_TIMEOUT_VALUE ((uint32_t)50000) /* 50 s */
mbed_official 354:e67efb2aab0e 132
mbed_official 354:e67efb2aab0e 133 #define FLASH_PAGE_SIZE ((uint32_t)256)
mbed_official 354:e67efb2aab0e 134
mbed_official 354:e67efb2aab0e 135 /** @defgroup FLASH_Type_Program FLASH Type Program
mbed_official 354:e67efb2aab0e 136 * @{
mbed_official 354:e67efb2aab0e 137 */
mbed_official 354:e67efb2aab0e 138 #define TYPEPROGRAM_WORD ((uint32_t)0x02) /*!< Program a word (32-bit) at a specified address */
mbed_official 354:e67efb2aab0e 139
mbed_official 354:e67efb2aab0e 140 #define IS_TYPEPROGRAMFLASH(_VALUE_) (((_VALUE_) == TYPEPROGRAM_WORD))
mbed_official 354:e67efb2aab0e 141
mbed_official 354:e67efb2aab0e 142 /**
mbed_official 354:e67efb2aab0e 143 * @}
mbed_official 354:e67efb2aab0e 144 */
mbed_official 354:e67efb2aab0e 145
mbed_official 354:e67efb2aab0e 146 /** @defgroup FLASH_Latency FLASH Latency
mbed_official 354:e67efb2aab0e 147 * @{
mbed_official 354:e67efb2aab0e 148 */
mbed_official 354:e67efb2aab0e 149 #define FLASH_LATENCY_0 ((uint8_t)0x00) /*!< FLASH Zero Latency cycle */
mbed_official 354:e67efb2aab0e 150 #define FLASH_LATENCY_1 ((uint8_t)0x01) /*!< FLASH One Latency cycle */
mbed_official 354:e67efb2aab0e 151
mbed_official 354:e67efb2aab0e 152 #define IS_FLASH_LATENCY(__LATENCY__) (((__LATENCY__) == FLASH_LATENCY_0) || \
mbed_official 354:e67efb2aab0e 153 ((__LATENCY__) == FLASH_LATENCY_1))
mbed_official 354:e67efb2aab0e 154 /**
mbed_official 354:e67efb2aab0e 155 * @}
mbed_official 354:e67efb2aab0e 156 */
mbed_official 354:e67efb2aab0e 157
mbed_official 354:e67efb2aab0e 158 /** @defgroup FLASH_Interrupts FLASH Interrupts
mbed_official 354:e67efb2aab0e 159 * @{
mbed_official 354:e67efb2aab0e 160 */
mbed_official 354:e67efb2aab0e 161
mbed_official 354:e67efb2aab0e 162 #define FLASH_IT_EOP FLASH_PECR_EOPIE /*!< End of programming interrupt source */
mbed_official 354:e67efb2aab0e 163 #define FLASH_IT_ERR FLASH_PECR_ERRIE /*!< Error interrupt source */
mbed_official 354:e67efb2aab0e 164 /**
mbed_official 354:e67efb2aab0e 165 * @}
mbed_official 354:e67efb2aab0e 166 */
mbed_official 354:e67efb2aab0e 167
mbed_official 354:e67efb2aab0e 168 /** @defgroup FLASH_Flags FLASH Flags
mbed_official 354:e67efb2aab0e 169 * @{
mbed_official 354:e67efb2aab0e 170 */
mbed_official 354:e67efb2aab0e 171
mbed_official 354:e67efb2aab0e 172 #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */
mbed_official 354:e67efb2aab0e 173 #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Programming flag */
mbed_official 354:e67efb2aab0e 174 #define FLASH_FLAG_ENDHV FLASH_SR_ENDHV /*!< FLASH End of High Voltage flag */
mbed_official 354:e67efb2aab0e 175 #define FLASH_FLAG_READY FLASH_SR_READY /*!< FLASH Ready flag after low power mode */
mbed_official 354:e67efb2aab0e 176 #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */
mbed_official 354:e67efb2aab0e 177 #define FLASH_FLAG_PGAERR FLASH_SR_PGAERR /*!< FLASH Programming Alignment error flag */
mbed_official 354:e67efb2aab0e 178 #define FLASH_FLAG_SIZERR FLASH_SR_SIZERR /*!< FLASH Size error flag */
mbed_official 354:e67efb2aab0e 179 #define FLASH_FLAG_OPTVERR FLASH_SR_OPTVERR /*!< FLASH Option Validity error flag */
mbed_official 354:e67efb2aab0e 180
mbed_official 354:e67efb2aab0e 181 /**
mbed_official 354:e67efb2aab0e 182 * @}
mbed_official 354:e67efb2aab0e 183 */
mbed_official 354:e67efb2aab0e 184
mbed_official 354:e67efb2aab0e 185 /** @defgroup FLASH_Keys FLASH Keys
mbed_official 354:e67efb2aab0e 186 * @{
mbed_official 354:e67efb2aab0e 187 */
mbed_official 354:e67efb2aab0e 188
mbed_official 354:e67efb2aab0e 189 #define FLASH_PDKEY1 ((uint32_t)0x04152637) /*!< Flash power down key1 */
mbed_official 354:e67efb2aab0e 190 #define FLASH_PDKEY2 ((uint32_t)0xFAFBFCFD) /*!< Flash power down key2: used with FLASH_PDKEY1
mbed_official 354:e67efb2aab0e 191 to unlock the RUN_PD bit in FLASH_ACR */
mbed_official 354:e67efb2aab0e 192
mbed_official 354:e67efb2aab0e 193 #define FLASH_PEKEY1 ((uint32_t)0x89ABCDEF) /*!< Flash program erase key1 */
mbed_official 354:e67efb2aab0e 194 #define FLASH_PEKEY2 ((uint32_t)0x02030405) /*!< Flash program erase key: used with FLASH_PEKEY2
mbed_official 354:e67efb2aab0e 195 to unlock the write access to the FLASH_PECR register and
mbed_official 354:e67efb2aab0e 196 data EEPROM */
mbed_official 354:e67efb2aab0e 197
mbed_official 354:e67efb2aab0e 198 #define FLASH_PRGKEY1 ((uint32_t)0x8C9DAEBF) /*!< Flash program memory key1 */
mbed_official 354:e67efb2aab0e 199 #define FLASH_PRGKEY2 ((uint32_t)0x13141516) /*!< Flash program memory key2: used with FLASH_PRGKEY2
mbed_official 354:e67efb2aab0e 200 to unlock the program memory */
mbed_official 354:e67efb2aab0e 201
mbed_official 354:e67efb2aab0e 202 #define FLASH_OPTKEY1 ((uint32_t)0xFBEAD9C8) /*!< Flash option key1 */
mbed_official 354:e67efb2aab0e 203 #define FLASH_OPTKEY2 ((uint32_t)0x24252627) /*!< Flash option key2: used with FLASH_OPTKEY1 to
mbed_official 354:e67efb2aab0e 204 unlock the write access to the option byte block */
mbed_official 354:e67efb2aab0e 205 /**
mbed_official 354:e67efb2aab0e 206 * @}
mbed_official 354:e67efb2aab0e 207 */
mbed_official 354:e67efb2aab0e 208
mbed_official 354:e67efb2aab0e 209
mbed_official 354:e67efb2aab0e 210
mbed_official 354:e67efb2aab0e 211 #if defined ( __ICCARM__ )
mbed_official 354:e67efb2aab0e 212 #define InterruptType_ACTLR_DISMCYCINT_Msk IntType_ACTLR_DISMCYCINT_Msk
mbed_official 354:e67efb2aab0e 213 #endif
mbed_official 354:e67efb2aab0e 214
mbed_official 354:e67efb2aab0e 215 /**
mbed_official 354:e67efb2aab0e 216 * @}
mbed_official 354:e67efb2aab0e 217 */
mbed_official 354:e67efb2aab0e 218
mbed_official 354:e67efb2aab0e 219 /* Exported macro ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 220
mbed_official 354:e67efb2aab0e 221 /** @defgroup FLASH_Exported_Macros FLASH Exported Macros
mbed_official 354:e67efb2aab0e 222 * @{
mbed_official 354:e67efb2aab0e 223 */
mbed_official 354:e67efb2aab0e 224
mbed_official 354:e67efb2aab0e 225 /** @defgroup FLASH_Interrupt FLASH Interrupts
mbed_official 354:e67efb2aab0e 226 * @brief macros to handle FLASH interrupts
mbed_official 354:e67efb2aab0e 227 * @{
mbed_official 354:e67efb2aab0e 228 */
mbed_official 354:e67efb2aab0e 229
mbed_official 354:e67efb2aab0e 230 /**
mbed_official 354:e67efb2aab0e 231 * @brief Enable the specified FLASH interrupt.
mbed_official 354:e67efb2aab0e 232 * @param __INTERRUPT__ : FLASH interrupt
mbed_official 354:e67efb2aab0e 233 * This parameter can be any combination of the following values:
mbed_official 354:e67efb2aab0e 234 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
mbed_official 354:e67efb2aab0e 235 * @arg FLASH_IT_ERR: Error Interrupt
mbed_official 354:e67efb2aab0e 236 * @retval none
mbed_official 354:e67efb2aab0e 237 */
mbed_official 354:e67efb2aab0e 238 #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) ((FLASH->PECR) |= (__INTERRUPT__))
mbed_official 354:e67efb2aab0e 239
mbed_official 354:e67efb2aab0e 240 /**
mbed_official 354:e67efb2aab0e 241 * @brief Disable the specified FLASH interrupt.
mbed_official 354:e67efb2aab0e 242 * @param __INTERRUPT__ : FLASH interrupt
mbed_official 354:e67efb2aab0e 243 * This parameter can be any combination of the following values:
mbed_official 354:e67efb2aab0e 244 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
mbed_official 354:e67efb2aab0e 245 * @arg FLASH_IT_ERR: Error Interrupt
mbed_official 354:e67efb2aab0e 246 * @retval none
mbed_official 354:e67efb2aab0e 247 */
mbed_official 354:e67efb2aab0e 248 #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) ((FLASH->PECR) &= ~(uint32_t)(__INTERRUPT__))
mbed_official 354:e67efb2aab0e 249
mbed_official 354:e67efb2aab0e 250 /**
mbed_official 354:e67efb2aab0e 251 * @brief Get the specified FLASH flag status.
mbed_official 354:e67efb2aab0e 252 * @param __FLAG__: specifies the FLASH flag to check.
mbed_official 354:e67efb2aab0e 253 * This parameter can be one of the following values:
mbed_official 354:e67efb2aab0e 254 * @arg FLASH_FLAG_BSY : FLASH Busy flag
mbed_official 354:e67efb2aab0e 255 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
mbed_official 354:e67efb2aab0e 256 * @arg FLASH_FLAG_ENDHV : FLASH End of High Voltage flag
mbed_official 354:e67efb2aab0e 257 * @arg FLASH_FLAG_READY: FLASH Ready flag after low power mode
mbed_official 354:e67efb2aab0e 258 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
mbed_official 354:e67efb2aab0e 259 * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
mbed_official 354:e67efb2aab0e 260 * @arg FLASH_FLAG_SIZERR: FLASH Size error flag
mbed_official 354:e67efb2aab0e 261 * @arg FLASH_FLAG_OPTVERR: FLASH Option validity error error flag
mbed_official 354:e67efb2aab0e 262 * @arg FLASH_FLAG_OPTVERRUSR : FLASH Option UserValidity (available only Cat.3, Cat.4 and Cat.5 devices)
mbed_official 354:e67efb2aab0e 263 * @arg FLASH_FLAG_RDERR : FLASH Read Protection error flag (PCROP) (available only Cat.2 and Cat.3 devices)
mbed_official 354:e67efb2aab0e 264 * @retval The new state of __FLAG__ (SET or RESET).
mbed_official 354:e67efb2aab0e 265 */
mbed_official 354:e67efb2aab0e 266 #define __HAL_FLASH_GET_FLAG(__FLAG__) (((FLASH->SR) & (__FLAG__)) == (__FLAG__))
mbed_official 354:e67efb2aab0e 267
mbed_official 354:e67efb2aab0e 268 /**
mbed_official 354:e67efb2aab0e 269 * @brief Clear the specified FLASH flag.
mbed_official 354:e67efb2aab0e 270 * @param __FLAG__: specifies the FLASH flags to clear.
mbed_official 354:e67efb2aab0e 271 * This parameter can be any combination of the following values:
mbed_official 354:e67efb2aab0e 272 * @arg FLASH_FLAG_BSY : FLASH Busy flag
mbed_official 354:e67efb2aab0e 273 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
mbed_official 354:e67efb2aab0e 274 * @arg FLASH_FLAG_ENDHV : FLASH End of High Voltage flag
mbed_official 354:e67efb2aab0e 275 * @arg FLASH_FLAG_READY: FLASH Ready flag after low power mode
mbed_official 354:e67efb2aab0e 276 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
mbed_official 354:e67efb2aab0e 277 * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
mbed_official 354:e67efb2aab0e 278 * @arg FLASH_FLAG_SIZERR: FLASH Size error flag
mbed_official 354:e67efb2aab0e 279 * @arg FLASH_FLAG_OPTVERR: FLASH Option validity error error flag
mbed_official 354:e67efb2aab0e 280 * @arg FLASH_FLAG_OPTVERRUSR : FLASH Option UserValidity (available only Cat.3, Cat.4 and Cat.5 devices)
mbed_official 354:e67efb2aab0e 281 * @arg FLASH_FLAG_RDERR : FLASH Read Protection error flag (PCROP) (available only Cat.2 and Cat.3 devices)
mbed_official 354:e67efb2aab0e 282 * @retval none
mbed_official 354:e67efb2aab0e 283 */
mbed_official 354:e67efb2aab0e 284 #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) ((FLASH->SR) = (__FLAG__))
mbed_official 354:e67efb2aab0e 285
mbed_official 354:e67efb2aab0e 286 /**
mbed_official 354:e67efb2aab0e 287 * @}
mbed_official 354:e67efb2aab0e 288 */
mbed_official 354:e67efb2aab0e 289
mbed_official 354:e67efb2aab0e 290 /**
mbed_official 354:e67efb2aab0e 291 * @}
mbed_official 354:e67efb2aab0e 292 */
mbed_official 354:e67efb2aab0e 293
mbed_official 354:e67efb2aab0e 294 /* Include FLASH HAL Extension module */
mbed_official 354:e67efb2aab0e 295 #include "stm32l1xx_hal_flash_ex.h"
mbed_official 354:e67efb2aab0e 296 #include "stm32l1xx_hal_flash_ramfunc.h"
mbed_official 354:e67efb2aab0e 297
mbed_official 354:e67efb2aab0e 298 /* Exported functions ------------------------------------------------------- */
mbed_official 354:e67efb2aab0e 299
mbed_official 354:e67efb2aab0e 300 /** @addtogroup FLASH_Exported_Functions
mbed_official 354:e67efb2aab0e 301 * @{
mbed_official 354:e67efb2aab0e 302 */
mbed_official 354:e67efb2aab0e 303
mbed_official 354:e67efb2aab0e 304 /** @addtogroup FLASH_Exported_Functions_Group1
mbed_official 354:e67efb2aab0e 305 * @{
mbed_official 354:e67efb2aab0e 306 */
mbed_official 354:e67efb2aab0e 307
mbed_official 354:e67efb2aab0e 308 /**
mbed_official 354:e67efb2aab0e 309 * @brief FLASH memory functions that can be executed from FLASH.
mbed_official 354:e67efb2aab0e 310 */
mbed_official 354:e67efb2aab0e 311 /* Program operation functions ***********************************************/
mbed_official 354:e67efb2aab0e 312 HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
mbed_official 354:e67efb2aab0e 313 HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
mbed_official 354:e67efb2aab0e 314
mbed_official 354:e67efb2aab0e 315 /* FLASH IRQ handler function */
mbed_official 354:e67efb2aab0e 316 void HAL_FLASH_IRQHandler(void);
mbed_official 354:e67efb2aab0e 317
mbed_official 354:e67efb2aab0e 318 /* Callbacks in non blocking modes */
mbed_official 354:e67efb2aab0e 319 void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
mbed_official 354:e67efb2aab0e 320 void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
mbed_official 354:e67efb2aab0e 321
mbed_official 354:e67efb2aab0e 322 /**
mbed_official 354:e67efb2aab0e 323 * @}
mbed_official 354:e67efb2aab0e 324 */
mbed_official 354:e67efb2aab0e 325
mbed_official 354:e67efb2aab0e 326 /** @addtogroup FLASH_Exported_Functions_Group2
mbed_official 354:e67efb2aab0e 327 * @{
mbed_official 354:e67efb2aab0e 328 */
mbed_official 354:e67efb2aab0e 329
mbed_official 354:e67efb2aab0e 330 /* FLASH Memory Programming functions *****************************************/
mbed_official 354:e67efb2aab0e 331 HAL_StatusTypeDef HAL_FLASH_Unlock(void);
mbed_official 354:e67efb2aab0e 332 HAL_StatusTypeDef HAL_FLASH_Lock(void);
mbed_official 354:e67efb2aab0e 333
mbed_official 354:e67efb2aab0e 334 /* Option Bytes Programming functions *****************************************/
mbed_official 354:e67efb2aab0e 335 HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
mbed_official 354:e67efb2aab0e 336 HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
mbed_official 354:e67efb2aab0e 337 HAL_StatusTypeDef HAL_FLASH_OB_Launch(void);
mbed_official 354:e67efb2aab0e 338
mbed_official 354:e67efb2aab0e 339 /**
mbed_official 354:e67efb2aab0e 340 * @}
mbed_official 354:e67efb2aab0e 341 */
mbed_official 354:e67efb2aab0e 342
mbed_official 354:e67efb2aab0e 343 /** @addtogroup FLASH_Exported_Functions_Group3
mbed_official 354:e67efb2aab0e 344 * @{
mbed_official 354:e67efb2aab0e 345 */
mbed_official 354:e67efb2aab0e 346
mbed_official 354:e67efb2aab0e 347 /* Peripheral State methods **************************************************/
mbed_official 354:e67efb2aab0e 348 FLASH_ErrorTypeDef HAL_FLASH_GetError(void);
mbed_official 354:e67efb2aab0e 349
mbed_official 354:e67efb2aab0e 350 /**
mbed_official 354:e67efb2aab0e 351 * @}
mbed_official 354:e67efb2aab0e 352 */
mbed_official 354:e67efb2aab0e 353
mbed_official 354:e67efb2aab0e 354 /**
mbed_official 354:e67efb2aab0e 355 * @}
mbed_official 354:e67efb2aab0e 356 */
mbed_official 354:e67efb2aab0e 357
mbed_official 354:e67efb2aab0e 358 /** @addtogroup FLASH_Internal_Functions
mbed_official 354:e67efb2aab0e 359 * @{
mbed_official 354:e67efb2aab0e 360 */
mbed_official 354:e67efb2aab0e 361
mbed_official 354:e67efb2aab0e 362 /**
mbed_official 354:e67efb2aab0e 363 * @brief Function used internally by HAL FLASH driver.
mbed_official 354:e67efb2aab0e 364 */
mbed_official 354:e67efb2aab0e 365 HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
mbed_official 354:e67efb2aab0e 366
mbed_official 354:e67efb2aab0e 367 /**
mbed_official 354:e67efb2aab0e 368 * @}
mbed_official 354:e67efb2aab0e 369 */
mbed_official 354:e67efb2aab0e 370
mbed_official 354:e67efb2aab0e 371 /**
mbed_official 354:e67efb2aab0e 372 * @}
mbed_official 354:e67efb2aab0e 373 */
mbed_official 354:e67efb2aab0e 374
mbed_official 354:e67efb2aab0e 375 /**
mbed_official 354:e67efb2aab0e 376 * @}
mbed_official 354:e67efb2aab0e 377 */
mbed_official 354:e67efb2aab0e 378
mbed_official 354:e67efb2aab0e 379 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 380 }
mbed_official 354:e67efb2aab0e 381 #endif
mbed_official 354:e67efb2aab0e 382
mbed_official 354:e67efb2aab0e 383 #endif /* __STM32L1xx_HAL_FLASH_H */
mbed_official 354:e67efb2aab0e 384
mbed_official 354:e67efb2aab0e 385 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/