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