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