The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_F072RB/stm32f0xx_hal_flash.h@122:f9eeca106725, 2016-07-07 (annotated)
- Committer:
- Kojto
- Date:
- Thu Jul 07 14:34:11 2016 +0100
- Revision:
- 122:f9eeca106725
- Parent:
- 108:34e6b704fe68
Release 122 of the mbed library
Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 85:024bf7f99721 | 1 | /** |
bogdanm | 85:024bf7f99721 | 2 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 3 | * @file stm32f0xx_hal_flash.h |
bogdanm | 85:024bf7f99721 | 4 | * @author MCD Application Team |
Kojto | 122:f9eeca106725 | 5 | * @version V1.4.0 |
Kojto | 122:f9eeca106725 | 6 | * @date 27-May-2016 |
bogdanm | 85:024bf7f99721 | 7 | * @brief Header file of Flash HAL module. |
bogdanm | 85:024bf7f99721 | 8 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 9 | * @attention |
bogdanm | 85:024bf7f99721 | 10 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
bogdanm | 85:024bf7f99721 | 12 | * |
bogdanm | 85:024bf7f99721 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 85:024bf7f99721 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 85:024bf7f99721 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 85:024bf7f99721 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 85:024bf7f99721 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 85:024bf7f99721 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 85:024bf7f99721 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 85:024bf7f99721 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 85:024bf7f99721 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 85:024bf7f99721 | 22 | * without specific prior written permission. |
bogdanm | 85:024bf7f99721 | 23 | * |
bogdanm | 85:024bf7f99721 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 85:024bf7f99721 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 85:024bf7f99721 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 85:024bf7f99721 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 85:024bf7f99721 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 85:024bf7f99721 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 85:024bf7f99721 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 85:024bf7f99721 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 85:024bf7f99721 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 85:024bf7f99721 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 85:024bf7f99721 | 34 | * |
bogdanm | 85:024bf7f99721 | 35 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 36 | */ |
bogdanm | 85:024bf7f99721 | 37 | |
bogdanm | 85:024bf7f99721 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 39 | #ifndef __STM32F0xx_HAL_FLASH_H |
bogdanm | 85:024bf7f99721 | 40 | #define __STM32F0xx_HAL_FLASH_H |
bogdanm | 85:024bf7f99721 | 41 | |
bogdanm | 85:024bf7f99721 | 42 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 43 | extern "C" { |
bogdanm | 85:024bf7f99721 | 44 | #endif |
bogdanm | 85:024bf7f99721 | 45 | |
bogdanm | 85:024bf7f99721 | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 47 | #include "stm32f0xx_hal_def.h" |
Kojto | 108:34e6b704fe68 | 48 | |
bogdanm | 85:024bf7f99721 | 49 | /** @addtogroup STM32F0xx_HAL_Driver |
bogdanm | 85:024bf7f99721 | 50 | * @{ |
bogdanm | 85:024bf7f99721 | 51 | */ |
bogdanm | 85:024bf7f99721 | 52 | |
bogdanm | 85:024bf7f99721 | 53 | /** @addtogroup FLASH |
bogdanm | 85:024bf7f99721 | 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 | 122:f9eeca106725 | 60 | #define FLASH_TIMEOUT_VALUE ((uint32_t)50000U) /* 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 | */ |
bogdanm | 85:024bf7f99721 | 79 | |
bogdanm | 85:024bf7f99721 | 80 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 81 | /** @defgroup FLASH_Exported_Types FLASH Exported Types |
bogdanm | 85:024bf7f99721 | 82 | * @{ |
bogdanm | 85:024bf7f99721 | 83 | */ |
bogdanm | 85:024bf7f99721 | 84 | |
bogdanm | 85:024bf7f99721 | 85 | /** |
bogdanm | 85:024bf7f99721 | 86 | * @brief FLASH Procedure structure definition |
bogdanm | 85:024bf7f99721 | 87 | */ |
bogdanm | 85:024bf7f99721 | 88 | typedef enum |
bogdanm | 85:024bf7f99721 | 89 | { |
bogdanm | 85:024bf7f99721 | 90 | FLASH_PROC_NONE = 0, |
bogdanm | 85:024bf7f99721 | 91 | FLASH_PROC_PAGEERASE = 1, |
bogdanm | 85:024bf7f99721 | 92 | FLASH_PROC_MASSERASE = 2, |
bogdanm | 85:024bf7f99721 | 93 | FLASH_PROC_PROGRAMHALFWORD = 3, |
bogdanm | 85:024bf7f99721 | 94 | FLASH_PROC_PROGRAMWORD = 4, |
bogdanm | 85:024bf7f99721 | 95 | FLASH_PROC_PROGRAMDOUBLEWORD = 5 |
bogdanm | 85:024bf7f99721 | 96 | } FLASH_ProcedureTypeDef; |
bogdanm | 85:024bf7f99721 | 97 | |
bogdanm | 85:024bf7f99721 | 98 | /** |
bogdanm | 85:024bf7f99721 | 99 | * @brief FLASH handle Structure definition |
bogdanm | 85:024bf7f99721 | 100 | */ |
bogdanm | 85:024bf7f99721 | 101 | typedef struct |
bogdanm | 85:024bf7f99721 | 102 | { |
Kojto | 93:e188a91d3eaa | 103 | __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */ |
bogdanm | 85:024bf7f99721 | 104 | |
Kojto | 93:e188a91d3eaa | 105 | __IO uint32_t DataRemaining; /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */ |
Kojto | 122:f9eeca106725 | 106 | |
Kojto | 93:e188a91d3eaa | 107 | __IO uint32_t Address; /*!< Internal variable to save address selected for program or erase */ |
Kojto | 122:f9eeca106725 | 108 | |
Kojto | 93:e188a91d3eaa | 109 | __IO uint64_t Data; /*!< Internal variable to save data to be programmed */ |
bogdanm | 85:024bf7f99721 | 110 | |
Kojto | 93:e188a91d3eaa | 111 | HAL_LockTypeDef Lock; /*!< FLASH locking object */ |
bogdanm | 85:024bf7f99721 | 112 | |
Kojto | 93:e188a91d3eaa | 113 | __IO uint32_t ErrorCode; /*!< FLASH error code |
Kojto | 108:34e6b704fe68 | 114 | This parameter can be a value of @ref FLASH_Error_Codes */ |
bogdanm | 85:024bf7f99721 | 115 | } FLASH_ProcessTypeDef; |
bogdanm | 85:024bf7f99721 | 116 | |
bogdanm | 85:024bf7f99721 | 117 | /** |
bogdanm | 85:024bf7f99721 | 118 | * @} |
bogdanm | 85:024bf7f99721 | 119 | */ |
bogdanm | 85:024bf7f99721 | 120 | |
bogdanm | 85:024bf7f99721 | 121 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 122 | /** @defgroup FLASH_Exported_Constants FLASH Exported Constants |
bogdanm | 85:024bf7f99721 | 123 | * @{ |
bogdanm | 85:024bf7f99721 | 124 | */ |
bogdanm | 85:024bf7f99721 | 125 | |
Kojto | 108:34e6b704fe68 | 126 | /** @defgroup FLASH_Error_Codes FLASH Error Codes |
Kojto | 93:e188a91d3eaa | 127 | * @{ |
Kojto | 93:e188a91d3eaa | 128 | */ |
Kojto | 122:f9eeca106725 | 129 | |
Kojto | 122:f9eeca106725 | 130 | #define HAL_FLASH_ERROR_NONE 0x00U /*!< No error */ |
Kojto | 122:f9eeca106725 | 131 | #define HAL_FLASH_ERROR_PROG 0x01U /*!< Programming error */ |
Kojto | 122:f9eeca106725 | 132 | #define HAL_FLASH_ERROR_WRP 0x02U /*!< Write protection error */ |
Kojto | 93:e188a91d3eaa | 133 | |
bogdanm | 85:024bf7f99721 | 134 | /** |
bogdanm | 85:024bf7f99721 | 135 | * @} |
bogdanm | 85:024bf7f99721 | 136 | */ |
bogdanm | 85:024bf7f99721 | 137 | |
bogdanm | 85:024bf7f99721 | 138 | /** @defgroup FLASH_Type_Program FLASH Type Program |
bogdanm | 85:024bf7f99721 | 139 | * @{ |
bogdanm | 85:024bf7f99721 | 140 | */ |
Kojto | 122:f9eeca106725 | 141 | #define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01U) /*!<Program a half-word (16-bit) at a specified address.*/ |
Kojto | 122:f9eeca106725 | 142 | #define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02U) /*!<Program a word (32-bit) at a specified address.*/ |
Kojto | 122:f9eeca106725 | 143 | #define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03U) /*!<Program a double word (64-bit) at a specified address*/ |
bogdanm | 85:024bf7f99721 | 144 | |
bogdanm | 85:024bf7f99721 | 145 | /** |
bogdanm | 85:024bf7f99721 | 146 | * @} |
bogdanm | 85:024bf7f99721 | 147 | */ |
bogdanm | 85:024bf7f99721 | 148 | |
bogdanm | 92:4fc01daae5a5 | 149 | /** @defgroup FLASH_Latency FLASH Latency |
bogdanm | 85:024bf7f99721 | 150 | * @{ |
bogdanm | 85:024bf7f99721 | 151 | */ |
Kojto | 122:f9eeca106725 | 152 | #define FLASH_LATENCY_0 ((uint32_t)0x00000000U) /*!< FLASH Zero Latency cycle */ |
bogdanm | 85:024bf7f99721 | 153 | #define FLASH_LATENCY_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */ |
bogdanm | 85:024bf7f99721 | 154 | |
bogdanm | 85:024bf7f99721 | 155 | /** |
bogdanm | 85:024bf7f99721 | 156 | * @} |
Kojto | 122:f9eeca106725 | 157 | */ |
bogdanm | 85:024bf7f99721 | 158 | |
bogdanm | 85:024bf7f99721 | 159 | |
bogdanm | 92:4fc01daae5a5 | 160 | /** @defgroup FLASH_Flag_definition FLASH Flag definition |
bogdanm | 85:024bf7f99721 | 161 | * @{ |
bogdanm | 85:024bf7f99721 | 162 | */ |
bogdanm | 85:024bf7f99721 | 163 | #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */ |
bogdanm | 85:024bf7f99721 | 164 | #define FLASH_FLAG_PGERR FLASH_SR_PGERR /*!< FLASH Programming error flag */ |
bogdanm | 85:024bf7f99721 | 165 | #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */ |
bogdanm | 85:024bf7f99721 | 166 | #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Operation flag */ |
bogdanm | 85:024bf7f99721 | 167 | /** |
bogdanm | 85:024bf7f99721 | 168 | * @} |
bogdanm | 85:024bf7f99721 | 169 | */ |
bogdanm | 85:024bf7f99721 | 170 | |
bogdanm | 92:4fc01daae5a5 | 171 | /** @defgroup FLASH_Interrupt_definition FLASH Interrupt definition |
bogdanm | 85:024bf7f99721 | 172 | * @{ |
bogdanm | 85:024bf7f99721 | 173 | */ |
bogdanm | 85:024bf7f99721 | 174 | #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */ |
bogdanm | 85:024bf7f99721 | 175 | #define FLASH_IT_ERR FLASH_CR_ERRIE /*!< Error Interrupt source */ |
bogdanm | 85:024bf7f99721 | 176 | /** |
bogdanm | 85:024bf7f99721 | 177 | * @} |
bogdanm | 85:024bf7f99721 | 178 | */ |
bogdanm | 85:024bf7f99721 | 179 | |
bogdanm | 85:024bf7f99721 | 180 | /** |
bogdanm | 85:024bf7f99721 | 181 | * @} |
bogdanm | 85:024bf7f99721 | 182 | */ |
bogdanm | 85:024bf7f99721 | 183 | |
bogdanm | 85:024bf7f99721 | 184 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 185 | |
bogdanm | 92:4fc01daae5a5 | 186 | /** @defgroup FLASH_Exported_Macros FLASH Exported Macros |
bogdanm | 85:024bf7f99721 | 187 | * @brief macros to control FLASH features |
bogdanm | 85:024bf7f99721 | 188 | * @{ |
bogdanm | 85:024bf7f99721 | 189 | */ |
Kojto | 108:34e6b704fe68 | 190 | |
Kojto | 122:f9eeca106725 | 191 | |
Kojto | 122:f9eeca106725 | 192 | /** @defgroup FLASH_EM_Latency FLASH Latency |
bogdanm | 92:4fc01daae5a5 | 193 | * @brief macros to handle FLASH Latency |
bogdanm | 92:4fc01daae5a5 | 194 | * @{ |
bogdanm | 92:4fc01daae5a5 | 195 | */ |
bogdanm | 92:4fc01daae5a5 | 196 | |
bogdanm | 85:024bf7f99721 | 197 | /** |
bogdanm | 85:024bf7f99721 | 198 | * @brief Set the FLASH Latency. |
Kojto | 122:f9eeca106725 | 199 | * @param __LATENCY__ FLASH Latency |
bogdanm | 85:024bf7f99721 | 200 | * The value of this parameter depend on device used within the same series |
bogdanm | 85:024bf7f99721 | 201 | * @retval None |
bogdanm | 85:024bf7f99721 | 202 | */ |
bogdanm | 85:024bf7f99721 | 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 | 122:f9eeca106725 | 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 | |
bogdanm | 92:4fc01daae5a5 | 213 | /** |
bogdanm | 92:4fc01daae5a5 | 214 | * @} |
bogdanm | 92:4fc01daae5a5 | 215 | */ |
bogdanm | 85:024bf7f99721 | 216 | |
bogdanm | 92:4fc01daae5a5 | 217 | /** @defgroup FLASH_Prefetch FLASH Prefetch |
bogdanm | 92:4fc01daae5a5 | 218 | * @brief macros to handle FLASH Prefetch buffer |
bogdanm | 92:4fc01daae5a5 | 219 | * @{ |
bogdanm | 92:4fc01daae5a5 | 220 | */ |
bogdanm | 85:024bf7f99721 | 221 | /** |
bogdanm | 85:024bf7f99721 | 222 | * @brief Enable the FLASH prefetch buffer. |
bogdanm | 85:024bf7f99721 | 223 | * @retval None |
bogdanm | 85:024bf7f99721 | 224 | */ |
bogdanm | 85:024bf7f99721 | 225 | #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTBE) |
bogdanm | 85:024bf7f99721 | 226 | |
bogdanm | 85:024bf7f99721 | 227 | /** |
bogdanm | 85:024bf7f99721 | 228 | * @brief Disable the FLASH prefetch buffer. |
bogdanm | 85:024bf7f99721 | 229 | * @retval None |
bogdanm | 85:024bf7f99721 | 230 | */ |
bogdanm | 85:024bf7f99721 | 231 | #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTBE)) |
bogdanm | 85:024bf7f99721 | 232 | |
bogdanm | 85:024bf7f99721 | 233 | /** |
bogdanm | 85:024bf7f99721 | 234 | * @} |
bogdanm | 92:4fc01daae5a5 | 235 | */ |
Kojto | 108:34e6b704fe68 | 236 | |
Kojto | 108:34e6b704fe68 | 237 | /** @defgroup FLASH_Interrupt FLASH Interrupts |
bogdanm | 85:024bf7f99721 | 238 | * @brief macros to handle FLASH interrupts |
bogdanm | 85:024bf7f99721 | 239 | * @{ |
bogdanm | 85:024bf7f99721 | 240 | */ |
bogdanm | 85:024bf7f99721 | 241 | |
bogdanm | 85:024bf7f99721 | 242 | /** |
bogdanm | 85:024bf7f99721 | 243 | * @brief Enable the specified FLASH interrupt. |
Kojto | 122:f9eeca106725 | 244 | * @param __INTERRUPT__ FLASH interrupt |
bogdanm | 85:024bf7f99721 | 245 | * This parameter can be any combination of the following values: |
Kojto | 122:f9eeca106725 | 246 | * @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt |
Kojto | 122:f9eeca106725 | 247 | * @arg @ref FLASH_IT_ERR Error Interrupt |
bogdanm | 85:024bf7f99721 | 248 | * @retval none |
bogdanm | 85:024bf7f99721 | 249 | */ |
Kojto | 108:34e6b704fe68 | 250 | #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) SET_BIT((FLASH->CR), (__INTERRUPT__)) |
bogdanm | 85:024bf7f99721 | 251 | |
bogdanm | 85:024bf7f99721 | 252 | /** |
bogdanm | 85:024bf7f99721 | 253 | * @brief Disable the specified FLASH interrupt. |
Kojto | 122:f9eeca106725 | 254 | * @param __INTERRUPT__ FLASH interrupt |
bogdanm | 85:024bf7f99721 | 255 | * This parameter can be any combination of the following values: |
Kojto | 122:f9eeca106725 | 256 | * @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt |
Kojto | 122:f9eeca106725 | 257 | * @arg @ref FLASH_IT_ERR Error Interrupt |
bogdanm | 85:024bf7f99721 | 258 | * @retval none |
bogdanm | 85:024bf7f99721 | 259 | */ |
Kojto | 108:34e6b704fe68 | 260 | #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) CLEAR_BIT((FLASH->CR), (uint32_t)(__INTERRUPT__)) |
bogdanm | 85:024bf7f99721 | 261 | |
bogdanm | 85:024bf7f99721 | 262 | /** |
bogdanm | 85:024bf7f99721 | 263 | * @brief Get the specified FLASH flag status. |
Kojto | 122:f9eeca106725 | 264 | * @param __FLAG__ specifies the FLASH flag to check. |
bogdanm | 85:024bf7f99721 | 265 | * This parameter can be one of the following values: |
Kojto | 122:f9eeca106725 | 266 | * @arg @ref FLASH_FLAG_BSY FLASH Busy flag |
Kojto | 122:f9eeca106725 | 267 | * @arg @ref FLASH_FLAG_EOP FLASH End of Operation flag |
Kojto | 122:f9eeca106725 | 268 | * @arg @ref FLASH_FLAG_WRPERR FLASH Write protected error flag |
Kojto | 122:f9eeca106725 | 269 | * @arg @ref FLASH_FLAG_PGERR FLASH Programming error flag |
bogdanm | 85:024bf7f99721 | 270 | * @retval The new state of __FLAG__ (SET or RESET). |
bogdanm | 85:024bf7f99721 | 271 | */ |
Kojto | 108:34e6b704fe68 | 272 | #define __HAL_FLASH_GET_FLAG(__FLAG__) (((FLASH->SR) & (__FLAG__)) == (__FLAG__)) |
bogdanm | 85:024bf7f99721 | 273 | |
bogdanm | 85:024bf7f99721 | 274 | /** |
bogdanm | 85:024bf7f99721 | 275 | * @brief Clear the specified FLASH flag. |
Kojto | 122:f9eeca106725 | 276 | * @param __FLAG__ specifies the FLASH flags to clear. |
bogdanm | 85:024bf7f99721 | 277 | * This parameter can be any combination of the following values: |
Kojto | 122:f9eeca106725 | 278 | * @arg @ref FLASH_FLAG_EOP FLASH End of Operation flag |
Kojto | 122:f9eeca106725 | 279 | * @arg @ref FLASH_FLAG_WRPERR FLASH Write protected error flag |
Kojto | 122:f9eeca106725 | 280 | * @arg @ref FLASH_FLAG_PGERR FLASH Programming error flag |
bogdanm | 85:024bf7f99721 | 281 | * @retval none |
bogdanm | 85:024bf7f99721 | 282 | */ |
Kojto | 108:34e6b704fe68 | 283 | #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) ((FLASH->SR) = (__FLAG__)) |
bogdanm | 85:024bf7f99721 | 284 | |
bogdanm | 85:024bf7f99721 | 285 | /** |
bogdanm | 85:024bf7f99721 | 286 | * @} |
bogdanm | 85:024bf7f99721 | 287 | */ |
bogdanm | 85:024bf7f99721 | 288 | |
bogdanm | 92:4fc01daae5a5 | 289 | /** |
bogdanm | 92:4fc01daae5a5 | 290 | * @} |
bogdanm | 92:4fc01daae5a5 | 291 | */ |
Kojto | 108:34e6b704fe68 | 292 | |
Kojto | 108:34e6b704fe68 | 293 | /* Include FLASH HAL Extended module */ |
bogdanm | 85:024bf7f99721 | 294 | #include "stm32f0xx_hal_flash_ex.h" |
bogdanm | 85:024bf7f99721 | 295 | |
bogdanm | 85:024bf7f99721 | 296 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 297 | /** @addtogroup FLASH_Exported_Functions |
bogdanm | 85:024bf7f99721 | 298 | * @{ |
Kojto | 108:34e6b704fe68 | 299 | */ |
bogdanm | 92:4fc01daae5a5 | 300 | |
Kojto | 108:34e6b704fe68 | 301 | /** @addtogroup FLASH_Exported_Functions_Group1 |
Kojto | 108:34e6b704fe68 | 302 | * @{ |
Kojto | 108:34e6b704fe68 | 303 | */ |
bogdanm | 85:024bf7f99721 | 304 | /* IO operation functions *****************************************************/ |
Kojto | 108:34e6b704fe68 | 305 | HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); |
Kojto | 108:34e6b704fe68 | 306 | HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data); |
bogdanm | 85:024bf7f99721 | 307 | |
Kojto | 122:f9eeca106725 | 308 | /* FLASH IRQ handler function */ |
Kojto | 108:34e6b704fe68 | 309 | void HAL_FLASH_IRQHandler(void); |
bogdanm | 85:024bf7f99721 | 310 | /* Callbacks in non blocking modes */ |
Kojto | 108:34e6b704fe68 | 311 | void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue); |
Kojto | 108:34e6b704fe68 | 312 | void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue); |
bogdanm | 85:024bf7f99721 | 313 | |
bogdanm | 92:4fc01daae5a5 | 314 | /** |
bogdanm | 92:4fc01daae5a5 | 315 | * @} |
bogdanm | 92:4fc01daae5a5 | 316 | */ |
bogdanm | 92:4fc01daae5a5 | 317 | |
Kojto | 108:34e6b704fe68 | 318 | /** @addtogroup FLASH_Exported_Functions_Group2 |
Kojto | 108:34e6b704fe68 | 319 | * @{ |
Kojto | 108:34e6b704fe68 | 320 | */ |
Kojto | 108:34e6b704fe68 | 321 | /* Peripheral Control functions ***********************************************/ |
Kojto | 108:34e6b704fe68 | 322 | HAL_StatusTypeDef HAL_FLASH_Unlock(void); |
Kojto | 108:34e6b704fe68 | 323 | HAL_StatusTypeDef HAL_FLASH_Lock(void); |
Kojto | 108:34e6b704fe68 | 324 | HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void); |
Kojto | 108:34e6b704fe68 | 325 | HAL_StatusTypeDef HAL_FLASH_OB_Lock(void); |
Kojto | 108:34e6b704fe68 | 326 | HAL_StatusTypeDef HAL_FLASH_OB_Launch(void); |
Kojto | 108:34e6b704fe68 | 327 | |
Kojto | 108:34e6b704fe68 | 328 | /** |
Kojto | 108:34e6b704fe68 | 329 | * @} |
Kojto | 108:34e6b704fe68 | 330 | */ |
Kojto | 108:34e6b704fe68 | 331 | |
Kojto | 108:34e6b704fe68 | 332 | /** @addtogroup FLASH_Exported_Functions_Group3 |
Kojto | 108:34e6b704fe68 | 333 | * @{ |
Kojto | 108:34e6b704fe68 | 334 | */ |
bogdanm | 85:024bf7f99721 | 335 | /* Peripheral State and Error functions ***************************************/ |
Kojto | 93:e188a91d3eaa | 336 | uint32_t HAL_FLASH_GetError(void); |
bogdanm | 85:024bf7f99721 | 337 | |
bogdanm | 85:024bf7f99721 | 338 | /** |
bogdanm | 85:024bf7f99721 | 339 | * @} |
bogdanm | 85:024bf7f99721 | 340 | */ |
bogdanm | 85:024bf7f99721 | 341 | |
bogdanm | 85:024bf7f99721 | 342 | /** |
bogdanm | 85:024bf7f99721 | 343 | * @} |
bogdanm | 85:024bf7f99721 | 344 | */ |
bogdanm | 85:024bf7f99721 | 345 | |
Kojto | 108:34e6b704fe68 | 346 | /* Private function -------------------------------------------------*/ |
Kojto | 108:34e6b704fe68 | 347 | /** @addtogroup FLASH_Private_Functions |
Kojto | 108:34e6b704fe68 | 348 | * @{ |
Kojto | 108:34e6b704fe68 | 349 | */ |
Kojto | 108:34e6b704fe68 | 350 | HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); |
Kojto | 108:34e6b704fe68 | 351 | |
Kojto | 108:34e6b704fe68 | 352 | /** |
Kojto | 108:34e6b704fe68 | 353 | * @} |
Kojto | 108:34e6b704fe68 | 354 | */ |
Kojto | 108:34e6b704fe68 | 355 | |
bogdanm | 85:024bf7f99721 | 356 | /** |
bogdanm | 85:024bf7f99721 | 357 | * @} |
bogdanm | 85:024bf7f99721 | 358 | */ |
bogdanm | 85:024bf7f99721 | 359 | |
bogdanm | 92:4fc01daae5a5 | 360 | /** |
bogdanm | 92:4fc01daae5a5 | 361 | * @} |
bogdanm | 92:4fc01daae5a5 | 362 | */ |
bogdanm | 92:4fc01daae5a5 | 363 | |
bogdanm | 85:024bf7f99721 | 364 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 365 | } |
bogdanm | 85:024bf7f99721 | 366 | #endif |
bogdanm | 85:024bf7f99721 | 367 | |
bogdanm | 85:024bf7f99721 | 368 | #endif /* __STM32F0xx_HAL_FLASH_H */ |
bogdanm | 85:024bf7f99721 | 369 | |
bogdanm | 85:024bf7f99721 | 370 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
bogdanm | 92:4fc01daae5a5 | 371 |