Lancaster University's (short term!) clone of mbed-src for micro:bit. This is a copy of the github branch https://github.com/lancaster-university/mbed-classic
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_hal_flash.h@610:813dcc80987e, 2015-08-14 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Aug 14 13:15:17 2015 +0100
- Revision:
- 610:813dcc80987e
- Parent:
- 573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599
Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/
DISCO_F746NG - Improvements
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 573:ad23fe03a082 | 1 | /** |
mbed_official | 573:ad23fe03a082 | 2 | ****************************************************************************** |
mbed_official | 573:ad23fe03a082 | 3 | * @file stm32f7xx_hal_flash.h |
mbed_official | 573:ad23fe03a082 | 4 | * @author MCD Application Team |
mbed_official | 610:813dcc80987e | 5 | * @version V1.0.1 |
mbed_official | 610:813dcc80987e | 6 | * @date 25-June-2015 |
mbed_official | 573:ad23fe03a082 | 7 | * @brief Header file of FLASH HAL module. |
mbed_official | 573:ad23fe03a082 | 8 | ****************************************************************************** |
mbed_official | 573:ad23fe03a082 | 9 | * @attention |
mbed_official | 573:ad23fe03a082 | 10 | * |
mbed_official | 573:ad23fe03a082 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
mbed_official | 573:ad23fe03a082 | 12 | * |
mbed_official | 573:ad23fe03a082 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 573:ad23fe03a082 | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 573:ad23fe03a082 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 573:ad23fe03a082 | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 573:ad23fe03a082 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 573:ad23fe03a082 | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 573:ad23fe03a082 | 19 | * and/or other materials provided with the distribution. |
mbed_official | 573:ad23fe03a082 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 573:ad23fe03a082 | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 573:ad23fe03a082 | 22 | * without specific prior written permission. |
mbed_official | 573:ad23fe03a082 | 23 | * |
mbed_official | 573:ad23fe03a082 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 573:ad23fe03a082 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 573:ad23fe03a082 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 573:ad23fe03a082 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 573:ad23fe03a082 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 573:ad23fe03a082 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 573:ad23fe03a082 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 573:ad23fe03a082 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 573:ad23fe03a082 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 573:ad23fe03a082 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 573:ad23fe03a082 | 34 | * |
mbed_official | 573:ad23fe03a082 | 35 | ****************************************************************************** |
mbed_official | 573:ad23fe03a082 | 36 | */ |
mbed_official | 573:ad23fe03a082 | 37 | |
mbed_official | 573:ad23fe03a082 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 39 | #ifndef __STM32F7xx_HAL_FLASH_H |
mbed_official | 573:ad23fe03a082 | 40 | #define __STM32F7xx_HAL_FLASH_H |
mbed_official | 573:ad23fe03a082 | 41 | |
mbed_official | 573:ad23fe03a082 | 42 | #ifdef __cplusplus |
mbed_official | 573:ad23fe03a082 | 43 | extern "C" { |
mbed_official | 573:ad23fe03a082 | 44 | #endif |
mbed_official | 573:ad23fe03a082 | 45 | |
mbed_official | 573:ad23fe03a082 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 47 | #include "stm32f7xx_hal_def.h" |
mbed_official | 573:ad23fe03a082 | 48 | |
mbed_official | 573:ad23fe03a082 | 49 | /** @addtogroup STM32F7xx_HAL_Driver |
mbed_official | 573:ad23fe03a082 | 50 | * @{ |
mbed_official | 573:ad23fe03a082 | 51 | */ |
mbed_official | 573:ad23fe03a082 | 52 | |
mbed_official | 573:ad23fe03a082 | 53 | /** @addtogroup FLASH |
mbed_official | 573:ad23fe03a082 | 54 | * @{ |
mbed_official | 573:ad23fe03a082 | 55 | */ |
mbed_official | 573:ad23fe03a082 | 56 | |
mbed_official | 573:ad23fe03a082 | 57 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 58 | /** @defgroup FLASH_Exported_Types FLASH Exported Types |
mbed_official | 573:ad23fe03a082 | 59 | * @{ |
mbed_official | 573:ad23fe03a082 | 60 | */ |
mbed_official | 573:ad23fe03a082 | 61 | |
mbed_official | 573:ad23fe03a082 | 62 | /** |
mbed_official | 573:ad23fe03a082 | 63 | * @brief FLASH Procedure structure definition |
mbed_official | 573:ad23fe03a082 | 64 | */ |
mbed_official | 573:ad23fe03a082 | 65 | typedef enum |
mbed_official | 573:ad23fe03a082 | 66 | { |
mbed_official | 573:ad23fe03a082 | 67 | FLASH_PROC_NONE = 0, |
mbed_official | 573:ad23fe03a082 | 68 | FLASH_PROC_SECTERASE, |
mbed_official | 573:ad23fe03a082 | 69 | FLASH_PROC_MASSERASE, |
mbed_official | 573:ad23fe03a082 | 70 | FLASH_PROC_PROGRAM |
mbed_official | 573:ad23fe03a082 | 71 | } FLASH_ProcedureTypeDef; |
mbed_official | 573:ad23fe03a082 | 72 | |
mbed_official | 573:ad23fe03a082 | 73 | |
mbed_official | 573:ad23fe03a082 | 74 | /** |
mbed_official | 573:ad23fe03a082 | 75 | * @brief FLASH handle Structure definition |
mbed_official | 573:ad23fe03a082 | 76 | */ |
mbed_official | 573:ad23fe03a082 | 77 | typedef struct |
mbed_official | 573:ad23fe03a082 | 78 | { |
mbed_official | 573:ad23fe03a082 | 79 | __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /* Internal variable to indicate which procedure is ongoing or not in IT context */ |
mbed_official | 573:ad23fe03a082 | 80 | |
mbed_official | 573:ad23fe03a082 | 81 | __IO uint32_t NbSectorsToErase; /* Internal variable to save the remaining sectors to erase in IT context */ |
mbed_official | 573:ad23fe03a082 | 82 | |
mbed_official | 573:ad23fe03a082 | 83 | __IO uint8_t VoltageForErase; /* Internal variable to provide voltage range selected by user in IT context */ |
mbed_official | 573:ad23fe03a082 | 84 | |
mbed_official | 573:ad23fe03a082 | 85 | __IO uint32_t Sector; /* Internal variable to define the current sector which is erasing */ |
mbed_official | 573:ad23fe03a082 | 86 | |
mbed_official | 573:ad23fe03a082 | 87 | __IO uint32_t Address; /* Internal variable to save address selected for program */ |
mbed_official | 573:ad23fe03a082 | 88 | |
mbed_official | 573:ad23fe03a082 | 89 | HAL_LockTypeDef Lock; /* FLASH locking object */ |
mbed_official | 573:ad23fe03a082 | 90 | |
mbed_official | 573:ad23fe03a082 | 91 | __IO uint32_t ErrorCode; /* FLASH error code */ |
mbed_official | 573:ad23fe03a082 | 92 | |
mbed_official | 573:ad23fe03a082 | 93 | }FLASH_ProcessTypeDef; |
mbed_official | 573:ad23fe03a082 | 94 | |
mbed_official | 573:ad23fe03a082 | 95 | /** |
mbed_official | 573:ad23fe03a082 | 96 | * @} |
mbed_official | 573:ad23fe03a082 | 97 | */ |
mbed_official | 573:ad23fe03a082 | 98 | |
mbed_official | 573:ad23fe03a082 | 99 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 100 | /** @defgroup FLASH_Exported_Constants FLASH Exported Constants |
mbed_official | 573:ad23fe03a082 | 101 | * @{ |
mbed_official | 573:ad23fe03a082 | 102 | */ |
mbed_official | 573:ad23fe03a082 | 103 | |
mbed_official | 573:ad23fe03a082 | 104 | /** @defgroup FLASH_Error_Code FLASH Error Code |
mbed_official | 573:ad23fe03a082 | 105 | * @brief FLASH Error Code |
mbed_official | 573:ad23fe03a082 | 106 | * @{ |
mbed_official | 573:ad23fe03a082 | 107 | */ |
mbed_official | 573:ad23fe03a082 | 108 | #define HAL_FLASH_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ |
mbed_official | 573:ad23fe03a082 | 109 | #define HAL_FLASH_ERROR_ERS ((uint32_t)0x00000002) /*!< Programming Sequence error */ |
mbed_official | 573:ad23fe03a082 | 110 | #define HAL_FLASH_ERROR_PGP ((uint32_t)0x00000004) /*!< Programming Parallelism error */ |
mbed_official | 573:ad23fe03a082 | 111 | #define HAL_FLASH_ERROR_PGA ((uint32_t)0x00000008) /*!< Programming Alignment error */ |
mbed_official | 573:ad23fe03a082 | 112 | #define HAL_FLASH_ERROR_WRP ((uint32_t)0x00000010) /*!< Write protection error */ |
mbed_official | 573:ad23fe03a082 | 113 | #define HAL_FLASH_ERROR_OPERATION ((uint32_t)0x00000020) /*!< Operation Error */ |
mbed_official | 573:ad23fe03a082 | 114 | /** |
mbed_official | 573:ad23fe03a082 | 115 | * @} |
mbed_official | 573:ad23fe03a082 | 116 | */ |
mbed_official | 573:ad23fe03a082 | 117 | |
mbed_official | 573:ad23fe03a082 | 118 | /** @defgroup FLASH_Type_Program FLASH Type Program |
mbed_official | 573:ad23fe03a082 | 119 | * @{ |
mbed_official | 573:ad23fe03a082 | 120 | */ |
mbed_official | 573:ad23fe03a082 | 121 | #define FLASH_TYPEPROGRAM_BYTE ((uint32_t)0x00) /*!< Program byte (8-bit) at a specified address */ |
mbed_official | 573:ad23fe03a082 | 122 | #define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01) /*!< Program a half-word (16-bit) at a specified address */ |
mbed_official | 573:ad23fe03a082 | 123 | #define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02) /*!< Program a word (32-bit) at a specified address */ |
mbed_official | 573:ad23fe03a082 | 124 | #define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03) /*!< Program a double word (64-bit) at a specified address */ |
mbed_official | 573:ad23fe03a082 | 125 | /** |
mbed_official | 573:ad23fe03a082 | 126 | * @} |
mbed_official | 573:ad23fe03a082 | 127 | */ |
mbed_official | 573:ad23fe03a082 | 128 | |
mbed_official | 573:ad23fe03a082 | 129 | /** @defgroup FLASH_Flag_definition FLASH Flag definition |
mbed_official | 573:ad23fe03a082 | 130 | * @brief Flag definition |
mbed_official | 573:ad23fe03a082 | 131 | * @{ |
mbed_official | 573:ad23fe03a082 | 132 | */ |
mbed_official | 573:ad23fe03a082 | 133 | #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Operation flag */ |
mbed_official | 573:ad23fe03a082 | 134 | #define FLASH_FLAG_OPERR FLASH_SR_OPERR /*!< FLASH operation Error flag */ |
mbed_official | 573:ad23fe03a082 | 135 | #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */ |
mbed_official | 573:ad23fe03a082 | 136 | #define FLASH_FLAG_PGAERR FLASH_SR_PGAERR /*!< FLASH Programming Alignment error flag */ |
mbed_official | 573:ad23fe03a082 | 137 | #define FLASH_FLAG_PGPERR FLASH_SR_PGPERR /*!< FLASH Programming Parallelism error flag */ |
mbed_official | 573:ad23fe03a082 | 138 | #define FLASH_FLAG_ERSERR FLASH_SR_ERSERR /*!< FLASH Erasing Sequence error flag */ |
mbed_official | 573:ad23fe03a082 | 139 | #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */ |
mbed_official | 573:ad23fe03a082 | 140 | /** |
mbed_official | 573:ad23fe03a082 | 141 | * @} |
mbed_official | 573:ad23fe03a082 | 142 | */ |
mbed_official | 573:ad23fe03a082 | 143 | |
mbed_official | 573:ad23fe03a082 | 144 | /** @defgroup FLASH_Interrupt_definition FLASH Interrupt definition |
mbed_official | 573:ad23fe03a082 | 145 | * @brief FLASH Interrupt definition |
mbed_official | 573:ad23fe03a082 | 146 | * @{ |
mbed_official | 573:ad23fe03a082 | 147 | */ |
mbed_official | 573:ad23fe03a082 | 148 | #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */ |
mbed_official | 573:ad23fe03a082 | 149 | #define FLASH_IT_ERR ((uint32_t)0x02000000) /*!< Error Interrupt source */ |
mbed_official | 573:ad23fe03a082 | 150 | /** |
mbed_official | 573:ad23fe03a082 | 151 | * @} |
mbed_official | 573:ad23fe03a082 | 152 | */ |
mbed_official | 573:ad23fe03a082 | 153 | |
mbed_official | 573:ad23fe03a082 | 154 | /** @defgroup FLASH_Program_Parallelism FLASH Program Parallelism |
mbed_official | 573:ad23fe03a082 | 155 | * @{ |
mbed_official | 573:ad23fe03a082 | 156 | */ |
mbed_official | 573:ad23fe03a082 | 157 | #define FLASH_PSIZE_BYTE ((uint32_t)0x00000000) |
mbed_official | 573:ad23fe03a082 | 158 | #define FLASH_PSIZE_HALF_WORD ((uint32_t)FLASH_CR_PSIZE_0) |
mbed_official | 573:ad23fe03a082 | 159 | #define FLASH_PSIZE_WORD ((uint32_t)FLASH_CR_PSIZE_1) |
mbed_official | 573:ad23fe03a082 | 160 | #define FLASH_PSIZE_DOUBLE_WORD ((uint32_t)FLASH_CR_PSIZE) |
mbed_official | 573:ad23fe03a082 | 161 | #define CR_PSIZE_MASK ((uint32_t)0xFFFFFCFF) |
mbed_official | 573:ad23fe03a082 | 162 | /** |
mbed_official | 573:ad23fe03a082 | 163 | * @} |
mbed_official | 573:ad23fe03a082 | 164 | */ |
mbed_official | 573:ad23fe03a082 | 165 | |
mbed_official | 573:ad23fe03a082 | 166 | /** @defgroup FLASH_Keys FLASH Keys |
mbed_official | 573:ad23fe03a082 | 167 | * @{ |
mbed_official | 573:ad23fe03a082 | 168 | */ |
mbed_official | 573:ad23fe03a082 | 169 | #define FLASH_KEY1 ((uint32_t)0x45670123) |
mbed_official | 573:ad23fe03a082 | 170 | #define FLASH_KEY2 ((uint32_t)0xCDEF89AB) |
mbed_official | 573:ad23fe03a082 | 171 | #define FLASH_OPT_KEY1 ((uint32_t)0x08192A3B) |
mbed_official | 573:ad23fe03a082 | 172 | #define FLASH_OPT_KEY2 ((uint32_t)0x4C5D6E7F) |
mbed_official | 573:ad23fe03a082 | 173 | /** |
mbed_official | 573:ad23fe03a082 | 174 | * @} |
mbed_official | 573:ad23fe03a082 | 175 | */ |
mbed_official | 573:ad23fe03a082 | 176 | |
mbed_official | 573:ad23fe03a082 | 177 | /** |
mbed_official | 573:ad23fe03a082 | 178 | * @} |
mbed_official | 573:ad23fe03a082 | 179 | */ |
mbed_official | 573:ad23fe03a082 | 180 | |
mbed_official | 573:ad23fe03a082 | 181 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 182 | /** @defgroup FLASH_Exported_Macros FLASH Exported Macros |
mbed_official | 573:ad23fe03a082 | 183 | * @{ |
mbed_official | 573:ad23fe03a082 | 184 | */ |
mbed_official | 573:ad23fe03a082 | 185 | /** |
mbed_official | 573:ad23fe03a082 | 186 | * @brief Set the FLASH Latency. |
mbed_official | 573:ad23fe03a082 | 187 | * @param __LATENCY__: FLASH Latency |
mbed_official | 573:ad23fe03a082 | 188 | * The value of this parameter depend on device used within the same series |
mbed_official | 573:ad23fe03a082 | 189 | * @retval none |
mbed_official | 573:ad23fe03a082 | 190 | */ |
mbed_official | 573:ad23fe03a082 | 191 | #define __HAL_FLASH_SET_LATENCY(__LATENCY__) \ |
mbed_official | 573:ad23fe03a082 | 192 | MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(__LATENCY__)) |
mbed_official | 573:ad23fe03a082 | 193 | |
mbed_official | 610:813dcc80987e | 194 | /** |
mbed_official | 610:813dcc80987e | 195 | * @brief Get the FLASH Latency. |
mbed_official | 610:813dcc80987e | 196 | * @retval FLASH Latency |
mbed_official | 610:813dcc80987e | 197 | * The value of this parameter depend on device used within the same series |
mbed_official | 610:813dcc80987e | 198 | */ |
mbed_official | 610:813dcc80987e | 199 | #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY)) |
mbed_official | 610:813dcc80987e | 200 | |
mbed_official | 573:ad23fe03a082 | 201 | /** |
mbed_official | 573:ad23fe03a082 | 202 | * @brief Enable the FLASH prefetch buffer. |
mbed_official | 573:ad23fe03a082 | 203 | * @retval none |
mbed_official | 573:ad23fe03a082 | 204 | */ |
mbed_official | 573:ad23fe03a082 | 205 | #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTEN) |
mbed_official | 573:ad23fe03a082 | 206 | |
mbed_official | 573:ad23fe03a082 | 207 | /** |
mbed_official | 573:ad23fe03a082 | 208 | * @brief Disable the FLASH prefetch buffer. |
mbed_official | 573:ad23fe03a082 | 209 | * @retval none |
mbed_official | 573:ad23fe03a082 | 210 | */ |
mbed_official | 573:ad23fe03a082 | 211 | #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTEN)) |
mbed_official | 573:ad23fe03a082 | 212 | |
mbed_official | 573:ad23fe03a082 | 213 | /** |
mbed_official | 573:ad23fe03a082 | 214 | * @brief Enable the FLASH Adaptive Real-Time memory accelerator. |
mbed_official | 573:ad23fe03a082 | 215 | * @note The ART accelerator is available only for flash access on ITCM interface. |
mbed_official | 573:ad23fe03a082 | 216 | * @retval none |
mbed_official | 573:ad23fe03a082 | 217 | */ |
mbed_official | 573:ad23fe03a082 | 218 | #define __HAL_FLASH_ART_ENABLE() SET_BIT(FLASH->ACR, FLASH_ACR_ARTEN) |
mbed_official | 573:ad23fe03a082 | 219 | |
mbed_official | 573:ad23fe03a082 | 220 | /** |
mbed_official | 573:ad23fe03a082 | 221 | * @brief Disable the FLASH Adaptive Real-Time memory accelerator. |
mbed_official | 573:ad23fe03a082 | 222 | * @retval none |
mbed_official | 573:ad23fe03a082 | 223 | */ |
mbed_official | 573:ad23fe03a082 | 224 | #define __HAL_FLASH_ART_DISABLE() CLEAR_BIT(FLASH->ACR, FLASH_ACR_ARTEN) |
mbed_official | 573:ad23fe03a082 | 225 | |
mbed_official | 573:ad23fe03a082 | 226 | /** |
mbed_official | 573:ad23fe03a082 | 227 | * @brief Resets the FLASH Adaptive Real-Time memory accelerator. |
mbed_official | 573:ad23fe03a082 | 228 | * @note This function must be used only when the Adaptive Real-Time memory accelerator |
mbed_official | 573:ad23fe03a082 | 229 | * is disabled. |
mbed_official | 573:ad23fe03a082 | 230 | * @retval None |
mbed_official | 573:ad23fe03a082 | 231 | */ |
mbed_official | 573:ad23fe03a082 | 232 | #define __HAL_FLASH_ART_RESET() (FLASH->ACR |= FLASH_ACR_ARTRST) |
mbed_official | 573:ad23fe03a082 | 233 | |
mbed_official | 573:ad23fe03a082 | 234 | /** |
mbed_official | 573:ad23fe03a082 | 235 | * @brief Enable the specified FLASH interrupt. |
mbed_official | 573:ad23fe03a082 | 236 | * @param __INTERRUPT__ : FLASH interrupt |
mbed_official | 573:ad23fe03a082 | 237 | * This parameter can be any combination of the following values: |
mbed_official | 573:ad23fe03a082 | 238 | * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt |
mbed_official | 573:ad23fe03a082 | 239 | * @arg FLASH_IT_ERR: Error Interrupt |
mbed_official | 573:ad23fe03a082 | 240 | * @retval none |
mbed_official | 573:ad23fe03a082 | 241 | */ |
mbed_official | 573:ad23fe03a082 | 242 | #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) (FLASH->CR |= (__INTERRUPT__)) |
mbed_official | 573:ad23fe03a082 | 243 | |
mbed_official | 573:ad23fe03a082 | 244 | /** |
mbed_official | 573:ad23fe03a082 | 245 | * @brief Disable the specified FLASH interrupt. |
mbed_official | 573:ad23fe03a082 | 246 | * @param __INTERRUPT__ : FLASH interrupt |
mbed_official | 573:ad23fe03a082 | 247 | * This parameter can be any combination of the following values: |
mbed_official | 573:ad23fe03a082 | 248 | * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt |
mbed_official | 573:ad23fe03a082 | 249 | * @arg FLASH_IT_ERR: Error Interrupt |
mbed_official | 573:ad23fe03a082 | 250 | * @retval none |
mbed_official | 573:ad23fe03a082 | 251 | */ |
mbed_official | 573:ad23fe03a082 | 252 | #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) (FLASH->CR &= ~(uint32_t)(__INTERRUPT__)) |
mbed_official | 573:ad23fe03a082 | 253 | |
mbed_official | 573:ad23fe03a082 | 254 | /** |
mbed_official | 573:ad23fe03a082 | 255 | * @brief Get the specified FLASH flag status. |
mbed_official | 573:ad23fe03a082 | 256 | * @param __FLAG__: specifies the FLASH flag to check. |
mbed_official | 573:ad23fe03a082 | 257 | * This parameter can be one of the following values: |
mbed_official | 573:ad23fe03a082 | 258 | * @arg FLASH_FLAG_EOP : FLASH End of Operation flag |
mbed_official | 573:ad23fe03a082 | 259 | * @arg FLASH_FLAG_OPERR : FLASH operation Error flag |
mbed_official | 573:ad23fe03a082 | 260 | * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag |
mbed_official | 573:ad23fe03a082 | 261 | * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag |
mbed_official | 573:ad23fe03a082 | 262 | * @arg FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag |
mbed_official | 573:ad23fe03a082 | 263 | * @arg FLASH_FLAG_ERSERR : FLASH Erasing Sequence error flag |
mbed_official | 573:ad23fe03a082 | 264 | * @arg FLASH_FLAG_BSY : FLASH Busy flag |
mbed_official | 573:ad23fe03a082 | 265 | * @retval The new state of __FLAG__ (SET or RESET). |
mbed_official | 573:ad23fe03a082 | 266 | */ |
mbed_official | 573:ad23fe03a082 | 267 | #define __HAL_FLASH_GET_FLAG(__FLAG__) ((FLASH->SR & (__FLAG__))) |
mbed_official | 573:ad23fe03a082 | 268 | |
mbed_official | 573:ad23fe03a082 | 269 | /** |
mbed_official | 573:ad23fe03a082 | 270 | * @brief Clear the specified FLASH flag. |
mbed_official | 573:ad23fe03a082 | 271 | * @param __FLAG__: specifies the FLASH flags to clear. |
mbed_official | 573:ad23fe03a082 | 272 | * This parameter can be any combination of the following values: |
mbed_official | 573:ad23fe03a082 | 273 | * @arg FLASH_FLAG_EOP : FLASH End of Operation flag |
mbed_official | 573:ad23fe03a082 | 274 | * @arg FLASH_FLAG_OPERR : FLASH operation Error flag |
mbed_official | 573:ad23fe03a082 | 275 | * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag |
mbed_official | 573:ad23fe03a082 | 276 | * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag |
mbed_official | 573:ad23fe03a082 | 277 | * @arg FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag |
mbed_official | 573:ad23fe03a082 | 278 | * @arg FLASH_FLAG_ERSERR : FLASH Erasing Sequence error flag |
mbed_official | 573:ad23fe03a082 | 279 | * @retval none |
mbed_official | 573:ad23fe03a082 | 280 | */ |
mbed_official | 573:ad23fe03a082 | 281 | #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) (FLASH->SR = (__FLAG__)) |
mbed_official | 573:ad23fe03a082 | 282 | /** |
mbed_official | 573:ad23fe03a082 | 283 | * @} |
mbed_official | 573:ad23fe03a082 | 284 | */ |
mbed_official | 573:ad23fe03a082 | 285 | |
mbed_official | 573:ad23fe03a082 | 286 | /* Include FLASH HAL Extension module */ |
mbed_official | 573:ad23fe03a082 | 287 | #include "stm32f7xx_hal_flash_ex.h" |
mbed_official | 573:ad23fe03a082 | 288 | |
mbed_official | 573:ad23fe03a082 | 289 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 290 | /** @addtogroup FLASH_Exported_Functions |
mbed_official | 573:ad23fe03a082 | 291 | * @{ |
mbed_official | 573:ad23fe03a082 | 292 | */ |
mbed_official | 573:ad23fe03a082 | 293 | /** @addtogroup FLASH_Exported_Functions_Group1 |
mbed_official | 573:ad23fe03a082 | 294 | * @{ |
mbed_official | 573:ad23fe03a082 | 295 | */ |
mbed_official | 573:ad23fe03a082 | 296 | /* Program operation functions ***********************************************/ |
mbed_official | 573:ad23fe03a082 | 297 | HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); |
mbed_official | 573:ad23fe03a082 | 298 | HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data); |
mbed_official | 573:ad23fe03a082 | 299 | /* FLASH IRQ handler method */ |
mbed_official | 573:ad23fe03a082 | 300 | void HAL_FLASH_IRQHandler(void); |
mbed_official | 573:ad23fe03a082 | 301 | /* Callbacks in non blocking modes */ |
mbed_official | 573:ad23fe03a082 | 302 | void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue); |
mbed_official | 573:ad23fe03a082 | 303 | void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue); |
mbed_official | 573:ad23fe03a082 | 304 | /** |
mbed_official | 573:ad23fe03a082 | 305 | * @} |
mbed_official | 573:ad23fe03a082 | 306 | */ |
mbed_official | 573:ad23fe03a082 | 307 | |
mbed_official | 573:ad23fe03a082 | 308 | /** @addtogroup FLASH_Exported_Functions_Group2 |
mbed_official | 573:ad23fe03a082 | 309 | * @{ |
mbed_official | 573:ad23fe03a082 | 310 | */ |
mbed_official | 573:ad23fe03a082 | 311 | /* Peripheral Control functions **********************************************/ |
mbed_official | 573:ad23fe03a082 | 312 | HAL_StatusTypeDef HAL_FLASH_Unlock(void); |
mbed_official | 573:ad23fe03a082 | 313 | HAL_StatusTypeDef HAL_FLASH_Lock(void); |
mbed_official | 573:ad23fe03a082 | 314 | HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void); |
mbed_official | 573:ad23fe03a082 | 315 | HAL_StatusTypeDef HAL_FLASH_OB_Lock(void); |
mbed_official | 573:ad23fe03a082 | 316 | /* Option bytes control */ |
mbed_official | 573:ad23fe03a082 | 317 | HAL_StatusTypeDef HAL_FLASH_OB_Launch(void); |
mbed_official | 573:ad23fe03a082 | 318 | /** |
mbed_official | 573:ad23fe03a082 | 319 | * @} |
mbed_official | 573:ad23fe03a082 | 320 | */ |
mbed_official | 573:ad23fe03a082 | 321 | |
mbed_official | 573:ad23fe03a082 | 322 | /** @addtogroup FLASH_Exported_Functions_Group3 |
mbed_official | 573:ad23fe03a082 | 323 | * @{ |
mbed_official | 573:ad23fe03a082 | 324 | */ |
mbed_official | 573:ad23fe03a082 | 325 | /* Peripheral State functions ************************************************/ |
mbed_official | 573:ad23fe03a082 | 326 | uint32_t HAL_FLASH_GetError(void); |
mbed_official | 573:ad23fe03a082 | 327 | HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); |
mbed_official | 573:ad23fe03a082 | 328 | /** |
mbed_official | 573:ad23fe03a082 | 329 | * @} |
mbed_official | 573:ad23fe03a082 | 330 | */ |
mbed_official | 573:ad23fe03a082 | 331 | |
mbed_official | 573:ad23fe03a082 | 332 | /** |
mbed_official | 573:ad23fe03a082 | 333 | * @} |
mbed_official | 573:ad23fe03a082 | 334 | */ |
mbed_official | 573:ad23fe03a082 | 335 | /* Private types -------------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 336 | /* Private variables ---------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 337 | /** @defgroup FLASH_Private_Variables FLASH Private Variables |
mbed_official | 573:ad23fe03a082 | 338 | * @{ |
mbed_official | 573:ad23fe03a082 | 339 | */ |
mbed_official | 573:ad23fe03a082 | 340 | |
mbed_official | 573:ad23fe03a082 | 341 | /** |
mbed_official | 573:ad23fe03a082 | 342 | * @} |
mbed_official | 573:ad23fe03a082 | 343 | */ |
mbed_official | 573:ad23fe03a082 | 344 | /* Private constants ---------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 345 | /** @defgroup FLASH_Private_Constants FLASH Private Constants |
mbed_official | 573:ad23fe03a082 | 346 | * @{ |
mbed_official | 573:ad23fe03a082 | 347 | */ |
mbed_official | 573:ad23fe03a082 | 348 | |
mbed_official | 573:ad23fe03a082 | 349 | /** |
mbed_official | 573:ad23fe03a082 | 350 | * @} |
mbed_official | 573:ad23fe03a082 | 351 | */ |
mbed_official | 573:ad23fe03a082 | 352 | |
mbed_official | 573:ad23fe03a082 | 353 | /* Private macros ------------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 354 | /** @defgroup FLASH_Private_Macros FLASH Private Macros |
mbed_official | 573:ad23fe03a082 | 355 | * @{ |
mbed_official | 573:ad23fe03a082 | 356 | */ |
mbed_official | 573:ad23fe03a082 | 357 | |
mbed_official | 573:ad23fe03a082 | 358 | /** @defgroup FLASH_IS_FLASH_Definitions FLASH Private macros to check input parameters |
mbed_official | 573:ad23fe03a082 | 359 | * @{ |
mbed_official | 573:ad23fe03a082 | 360 | */ |
mbed_official | 573:ad23fe03a082 | 361 | #define IS_FLASH_TYPEPROGRAM(VALUE)(((VALUE) == FLASH_TYPEPROGRAM_BYTE) || \ |
mbed_official | 573:ad23fe03a082 | 362 | ((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \ |
mbed_official | 573:ad23fe03a082 | 363 | ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \ |
mbed_official | 573:ad23fe03a082 | 364 | ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD)) |
mbed_official | 573:ad23fe03a082 | 365 | /** |
mbed_official | 573:ad23fe03a082 | 366 | * @} |
mbed_official | 573:ad23fe03a082 | 367 | */ |
mbed_official | 573:ad23fe03a082 | 368 | |
mbed_official | 573:ad23fe03a082 | 369 | /** |
mbed_official | 573:ad23fe03a082 | 370 | * @} |
mbed_official | 573:ad23fe03a082 | 371 | */ |
mbed_official | 573:ad23fe03a082 | 372 | |
mbed_official | 573:ad23fe03a082 | 373 | /* Private functions ---------------------------------------------------------*/ |
mbed_official | 573:ad23fe03a082 | 374 | /** @defgroup FLASH_Private_Functions FLASH Private Functions |
mbed_official | 573:ad23fe03a082 | 375 | * @{ |
mbed_official | 573:ad23fe03a082 | 376 | */ |
mbed_official | 573:ad23fe03a082 | 377 | |
mbed_official | 573:ad23fe03a082 | 378 | /** |
mbed_official | 573:ad23fe03a082 | 379 | * @} |
mbed_official | 573:ad23fe03a082 | 380 | */ |
mbed_official | 573:ad23fe03a082 | 381 | |
mbed_official | 573:ad23fe03a082 | 382 | /** |
mbed_official | 573:ad23fe03a082 | 383 | * @} |
mbed_official | 573:ad23fe03a082 | 384 | */ |
mbed_official | 573:ad23fe03a082 | 385 | |
mbed_official | 573:ad23fe03a082 | 386 | /** |
mbed_official | 573:ad23fe03a082 | 387 | * @} |
mbed_official | 573:ad23fe03a082 | 388 | */ |
mbed_official | 573:ad23fe03a082 | 389 | |
mbed_official | 573:ad23fe03a082 | 390 | #ifdef __cplusplus |
mbed_official | 573:ad23fe03a082 | 391 | } |
mbed_official | 573:ad23fe03a082 | 392 | #endif |
mbed_official | 573:ad23fe03a082 | 393 | |
mbed_official | 573:ad23fe03a082 | 394 | #endif /* __STM32F7xx_HAL_FLASH_H */ |
mbed_official | 573:ad23fe03a082 | 395 | |
mbed_official | 573:ad23fe03a082 | 396 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |