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 mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

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