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