mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
116:c0f6e94411f5
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?

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 122:f9eeca106725 5 * @version V1.1.0
Kojto 122:f9eeca106725 6 * @date 22-April-2016
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 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 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 122:f9eeca106725 67 FLASH_PROC_NONE = 0U,
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 122:f9eeca106725 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 122:f9eeca106725 108 #define HAL_FLASH_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
Kojto 122:f9eeca106725 109 #define HAL_FLASH_ERROR_ERS ((uint32_t)0x00000002U) /*!< Programming Sequence error */
Kojto 122:f9eeca106725 110 #define HAL_FLASH_ERROR_PGP ((uint32_t)0x00000004U) /*!< Programming Parallelism error */
Kojto 122:f9eeca106725 111 #define HAL_FLASH_ERROR_PGA ((uint32_t)0x00000008U) /*!< Programming Alignment error */
Kojto 122:f9eeca106725 112 #define HAL_FLASH_ERROR_WRP ((uint32_t)0x00000010U) /*!< Write protection error */
Kojto 122:f9eeca106725 113 #define HAL_FLASH_ERROR_OPERATION ((uint32_t)0x00000020U) /*!< 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 122:f9eeca106725 121 #define FLASH_TYPEPROGRAM_BYTE ((uint32_t)0x00U) /*!< Program byte (8-bit) at a specified address */
Kojto 122:f9eeca106725 122 #define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01U) /*!< Program a half-word (16-bit) at a specified address */
Kojto 122:f9eeca106725 123 #define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02U) /*!< Program a word (32-bit) at a specified address */
Kojto 122:f9eeca106725 124 #define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03U) /*!< 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 122:f9eeca106725 149 #define FLASH_IT_ERR ((uint32_t)0x02000000U) /*!< 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 122:f9eeca106725 157 #define FLASH_PSIZE_BYTE ((uint32_t)0x00000000U)
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 122:f9eeca106725 161 #define CR_PSIZE_MASK ((uint32_t)0xFFFFFCFFU)
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 122:f9eeca106725 169 #define FLASH_KEY1 ((uint32_t)0x45670123U)
Kojto 122:f9eeca106725 170 #define FLASH_KEY2 ((uint32_t)0xCDEF89ABU)
Kojto 122:f9eeca106725 171 #define FLASH_OPT_KEY1 ((uint32_t)0x08192A3BU)
Kojto 122:f9eeca106725 172 #define FLASH_OPT_KEY2 ((uint32_t)0x4C5D6E7FU)
Kojto 107:4f6c30876dfa 173 /**
Kojto 107:4f6c30876dfa 174 * @}
Kojto 107:4f6c30876dfa 175 */
Kojto 107:4f6c30876dfa 176
Kojto 122:f9eeca106725 177 /** @defgroup FLASH_Sectors FLASH Sectors
Kojto 122:f9eeca106725 178 * @{
Kojto 122:f9eeca106725 179 */
Kojto 122:f9eeca106725 180 #define FLASH_SECTOR_0 ((uint32_t)0U) /*!< Sector Number 0 */
Kojto 122:f9eeca106725 181 #define FLASH_SECTOR_1 ((uint32_t)1U) /*!< Sector Number 1 */
Kojto 122:f9eeca106725 182 #define FLASH_SECTOR_2 ((uint32_t)2U) /*!< Sector Number 2 */
Kojto 122:f9eeca106725 183 #define FLASH_SECTOR_3 ((uint32_t)3U) /*!< Sector Number 3 */
Kojto 122:f9eeca106725 184 #define FLASH_SECTOR_4 ((uint32_t)4U) /*!< Sector Number 4 */
Kojto 122:f9eeca106725 185 #define FLASH_SECTOR_5 ((uint32_t)5U) /*!< Sector Number 5 */
Kojto 122:f9eeca106725 186 #define FLASH_SECTOR_6 ((uint32_t)6U) /*!< Sector Number 6 */
Kojto 122:f9eeca106725 187 #define FLASH_SECTOR_7 ((uint32_t)7U) /*!< Sector Number 7 */
Kojto 122:f9eeca106725 188 /**
Kojto 122:f9eeca106725 189 * @}
Kojto 122:f9eeca106725 190 */
Kojto 122:f9eeca106725 191
Kojto 107:4f6c30876dfa 192 /**
Kojto 107:4f6c30876dfa 193 * @}
Kojto 107:4f6c30876dfa 194 */
Kojto 107:4f6c30876dfa 195
Kojto 107:4f6c30876dfa 196 /* Exported macro ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 197 /** @defgroup FLASH_Exported_Macros FLASH Exported Macros
Kojto 107:4f6c30876dfa 198 * @{
Kojto 107:4f6c30876dfa 199 */
Kojto 107:4f6c30876dfa 200 /**
Kojto 107:4f6c30876dfa 201 * @brief Set the FLASH Latency.
Kojto 107:4f6c30876dfa 202 * @param __LATENCY__: FLASH Latency
Kojto 107:4f6c30876dfa 203 * The value of this parameter depend on device used within the same series
Kojto 107:4f6c30876dfa 204 * @retval none
Kojto 107:4f6c30876dfa 205 */
Kojto 107:4f6c30876dfa 206 #define __HAL_FLASH_SET_LATENCY(__LATENCY__) \
Kojto 107:4f6c30876dfa 207 MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(__LATENCY__))
Kojto 107:4f6c30876dfa 208
Kojto 107:4f6c30876dfa 209 /**
Kojto 107:4f6c30876dfa 210 * @brief Get the FLASH Latency.
Kojto 107:4f6c30876dfa 211 * @retval FLASH Latency
Kojto 107:4f6c30876dfa 212 * The value of this parameter depend on device used within the same series
Kojto 107:4f6c30876dfa 213 */
Kojto 107:4f6c30876dfa 214 #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
Kojto 107:4f6c30876dfa 215
Kojto 107:4f6c30876dfa 216 /**
Kojto 107:4f6c30876dfa 217 * @brief Enable the FLASH prefetch buffer.
Kojto 107:4f6c30876dfa 218 * @retval none
Kojto 107:4f6c30876dfa 219 */
Kojto 107:4f6c30876dfa 220 #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTEN)
Kojto 107:4f6c30876dfa 221
Kojto 107:4f6c30876dfa 222 /**
Kojto 107:4f6c30876dfa 223 * @brief Disable the FLASH prefetch buffer.
Kojto 107:4f6c30876dfa 224 * @retval none
Kojto 107:4f6c30876dfa 225 */
Kojto 107:4f6c30876dfa 226 #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTEN))
Kojto 107:4f6c30876dfa 227
Kojto 107:4f6c30876dfa 228 /**
Kojto 107:4f6c30876dfa 229 * @brief Enable the FLASH Adaptive Real-Time memory accelerator.
Kojto 107:4f6c30876dfa 230 * @note The ART accelerator is available only for flash access on ITCM interface.
Kojto 107:4f6c30876dfa 231 * @retval none
Kojto 107:4f6c30876dfa 232 */
Kojto 107:4f6c30876dfa 233 #define __HAL_FLASH_ART_ENABLE() SET_BIT(FLASH->ACR, FLASH_ACR_ARTEN)
Kojto 107:4f6c30876dfa 234
Kojto 107:4f6c30876dfa 235 /**
Kojto 107:4f6c30876dfa 236 * @brief Disable the FLASH Adaptive Real-Time memory accelerator.
Kojto 107:4f6c30876dfa 237 * @retval none
Kojto 107:4f6c30876dfa 238 */
Kojto 107:4f6c30876dfa 239 #define __HAL_FLASH_ART_DISABLE() CLEAR_BIT(FLASH->ACR, FLASH_ACR_ARTEN)
Kojto 107:4f6c30876dfa 240
Kojto 107:4f6c30876dfa 241 /**
Kojto 107:4f6c30876dfa 242 * @brief Resets the FLASH Adaptive Real-Time memory accelerator.
Kojto 107:4f6c30876dfa 243 * @note This function must be used only when the Adaptive Real-Time memory accelerator
Kojto 107:4f6c30876dfa 244 * is disabled.
Kojto 107:4f6c30876dfa 245 * @retval None
Kojto 107:4f6c30876dfa 246 */
Kojto 107:4f6c30876dfa 247 #define __HAL_FLASH_ART_RESET() (FLASH->ACR |= FLASH_ACR_ARTRST)
Kojto 107:4f6c30876dfa 248
Kojto 107:4f6c30876dfa 249 /**
Kojto 107:4f6c30876dfa 250 * @brief Enable the specified FLASH interrupt.
Kojto 107:4f6c30876dfa 251 * @param __INTERRUPT__ : FLASH interrupt
Kojto 107:4f6c30876dfa 252 * This parameter can be any combination of the following values:
Kojto 107:4f6c30876dfa 253 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
Kojto 107:4f6c30876dfa 254 * @arg FLASH_IT_ERR: Error Interrupt
Kojto 107:4f6c30876dfa 255 * @retval none
Kojto 107:4f6c30876dfa 256 */
Kojto 107:4f6c30876dfa 257 #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) (FLASH->CR |= (__INTERRUPT__))
Kojto 107:4f6c30876dfa 258
Kojto 107:4f6c30876dfa 259 /**
Kojto 107:4f6c30876dfa 260 * @brief Disable the specified FLASH interrupt.
Kojto 107:4f6c30876dfa 261 * @param __INTERRUPT__ : FLASH interrupt
Kojto 107:4f6c30876dfa 262 * This parameter can be any combination of the following values:
Kojto 107:4f6c30876dfa 263 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
Kojto 107:4f6c30876dfa 264 * @arg FLASH_IT_ERR: Error Interrupt
Kojto 107:4f6c30876dfa 265 * @retval none
Kojto 107:4f6c30876dfa 266 */
Kojto 107:4f6c30876dfa 267 #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) (FLASH->CR &= ~(uint32_t)(__INTERRUPT__))
Kojto 107:4f6c30876dfa 268
Kojto 107:4f6c30876dfa 269 /**
Kojto 107:4f6c30876dfa 270 * @brief Get the specified FLASH flag status.
Kojto 107:4f6c30876dfa 271 * @param __FLAG__: specifies the FLASH flag to check.
Kojto 107:4f6c30876dfa 272 * This parameter can be one 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 * @arg FLASH_FLAG_BSY : FLASH Busy flag
Kojto 107:4f6c30876dfa 280 * @retval The new state of __FLAG__ (SET or RESET).
Kojto 107:4f6c30876dfa 281 */
Kojto 107:4f6c30876dfa 282 #define __HAL_FLASH_GET_FLAG(__FLAG__) ((FLASH->SR & (__FLAG__)))
Kojto 107:4f6c30876dfa 283
Kojto 107:4f6c30876dfa 284 /**
Kojto 107:4f6c30876dfa 285 * @brief Clear the specified FLASH flag.
Kojto 107:4f6c30876dfa 286 * @param __FLAG__: specifies the FLASH flags to clear.
Kojto 107:4f6c30876dfa 287 * This parameter can be any combination of the following values:
Kojto 107:4f6c30876dfa 288 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
Kojto 107:4f6c30876dfa 289 * @arg FLASH_FLAG_OPERR : FLASH operation Error flag
Kojto 107:4f6c30876dfa 290 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
Kojto 107:4f6c30876dfa 291 * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
Kojto 107:4f6c30876dfa 292 * @arg FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag
Kojto 107:4f6c30876dfa 293 * @arg FLASH_FLAG_ERSERR : FLASH Erasing Sequence error flag
Kojto 107:4f6c30876dfa 294 * @retval none
Kojto 107:4f6c30876dfa 295 */
Kojto 107:4f6c30876dfa 296 #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) (FLASH->SR = (__FLAG__))
Kojto 107:4f6c30876dfa 297 /**
Kojto 107:4f6c30876dfa 298 * @}
Kojto 107:4f6c30876dfa 299 */
Kojto 107:4f6c30876dfa 300
Kojto 107:4f6c30876dfa 301 /* Include FLASH HAL Extension module */
Kojto 107:4f6c30876dfa 302 #include "stm32f7xx_hal_flash_ex.h"
Kojto 107:4f6c30876dfa 303
Kojto 107:4f6c30876dfa 304 /* Exported functions --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 305 /** @addtogroup FLASH_Exported_Functions
Kojto 107:4f6c30876dfa 306 * @{
Kojto 107:4f6c30876dfa 307 */
Kojto 107:4f6c30876dfa 308 /** @addtogroup FLASH_Exported_Functions_Group1
Kojto 107:4f6c30876dfa 309 * @{
Kojto 107:4f6c30876dfa 310 */
Kojto 107:4f6c30876dfa 311 /* Program operation functions ***********************************************/
Kojto 107:4f6c30876dfa 312 HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
Kojto 107:4f6c30876dfa 313 HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
Kojto 107:4f6c30876dfa 314 /* FLASH IRQ handler method */
Kojto 107:4f6c30876dfa 315 void HAL_FLASH_IRQHandler(void);
Kojto 107:4f6c30876dfa 316 /* Callbacks in non blocking modes */
Kojto 107:4f6c30876dfa 317 void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
Kojto 107:4f6c30876dfa 318 void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
Kojto 107:4f6c30876dfa 319 /**
Kojto 107:4f6c30876dfa 320 * @}
Kojto 107:4f6c30876dfa 321 */
Kojto 107:4f6c30876dfa 322
Kojto 107:4f6c30876dfa 323 /** @addtogroup FLASH_Exported_Functions_Group2
Kojto 107:4f6c30876dfa 324 * @{
Kojto 107:4f6c30876dfa 325 */
Kojto 107:4f6c30876dfa 326 /* Peripheral Control functions **********************************************/
Kojto 107:4f6c30876dfa 327 HAL_StatusTypeDef HAL_FLASH_Unlock(void);
Kojto 107:4f6c30876dfa 328 HAL_StatusTypeDef HAL_FLASH_Lock(void);
Kojto 107:4f6c30876dfa 329 HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
Kojto 107:4f6c30876dfa 330 HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
Kojto 107:4f6c30876dfa 331 /* Option bytes control */
Kojto 107:4f6c30876dfa 332 HAL_StatusTypeDef HAL_FLASH_OB_Launch(void);
Kojto 107:4f6c30876dfa 333 /**
Kojto 107:4f6c30876dfa 334 * @}
Kojto 107:4f6c30876dfa 335 */
Kojto 107:4f6c30876dfa 336
Kojto 107:4f6c30876dfa 337 /** @addtogroup FLASH_Exported_Functions_Group3
Kojto 107:4f6c30876dfa 338 * @{
Kojto 107:4f6c30876dfa 339 */
Kojto 107:4f6c30876dfa 340 /* Peripheral State functions ************************************************/
Kojto 107:4f6c30876dfa 341 uint32_t HAL_FLASH_GetError(void);
Kojto 107:4f6c30876dfa 342 HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
Kojto 107:4f6c30876dfa 343 /**
Kojto 107:4f6c30876dfa 344 * @}
Kojto 107:4f6c30876dfa 345 */
Kojto 107:4f6c30876dfa 346
Kojto 107:4f6c30876dfa 347 /**
Kojto 107:4f6c30876dfa 348 * @}
Kojto 107:4f6c30876dfa 349 */
Kojto 107:4f6c30876dfa 350 /* Private types -------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 351 /* Private variables ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 352 /** @defgroup FLASH_Private_Variables FLASH Private Variables
Kojto 107:4f6c30876dfa 353 * @{
Kojto 107:4f6c30876dfa 354 */
Kojto 107:4f6c30876dfa 355
Kojto 107:4f6c30876dfa 356 /**
Kojto 107:4f6c30876dfa 357 * @}
Kojto 107:4f6c30876dfa 358 */
Kojto 107:4f6c30876dfa 359 /* Private constants ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 360 /** @defgroup FLASH_Private_Constants FLASH Private Constants
Kojto 107:4f6c30876dfa 361 * @{
Kojto 107:4f6c30876dfa 362 */
Kojto 107:4f6c30876dfa 363
Kojto 116:c0f6e94411f5 364 /**
Kojto 116:c0f6e94411f5 365 * @brief OPTCR register byte 1 (Bits[15:8]) base address
Kojto 116:c0f6e94411f5 366 */
Kojto 116:c0f6e94411f5 367 #define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15)
Kojto 116:c0f6e94411f5 368
Kojto 107:4f6c30876dfa 369 /**
Kojto 107:4f6c30876dfa 370 * @}
Kojto 107:4f6c30876dfa 371 */
Kojto 107:4f6c30876dfa 372
Kojto 107:4f6c30876dfa 373 /* Private macros ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 374 /** @defgroup FLASH_Private_Macros FLASH Private Macros
Kojto 107:4f6c30876dfa 375 * @{
Kojto 107:4f6c30876dfa 376 */
Kojto 107:4f6c30876dfa 377
Kojto 107:4f6c30876dfa 378 /** @defgroup FLASH_IS_FLASH_Definitions FLASH Private macros to check input parameters
Kojto 107:4f6c30876dfa 379 * @{
Kojto 107:4f6c30876dfa 380 */
Kojto 107:4f6c30876dfa 381 #define IS_FLASH_TYPEPROGRAM(VALUE)(((VALUE) == FLASH_TYPEPROGRAM_BYTE) || \
Kojto 107:4f6c30876dfa 382 ((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \
Kojto 107:4f6c30876dfa 383 ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \
Kojto 107:4f6c30876dfa 384 ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD))
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 /* Private functions ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 394 /** @defgroup FLASH_Private_Functions FLASH Private Functions
Kojto 107:4f6c30876dfa 395 * @{
Kojto 107:4f6c30876dfa 396 */
Kojto 107:4f6c30876dfa 397
Kojto 107:4f6c30876dfa 398 /**
Kojto 107:4f6c30876dfa 399 * @}
Kojto 107:4f6c30876dfa 400 */
Kojto 107:4f6c30876dfa 401
Kojto 107:4f6c30876dfa 402 /**
Kojto 107:4f6c30876dfa 403 * @}
Kojto 107:4f6c30876dfa 404 */
Kojto 107:4f6c30876dfa 405
Kojto 107:4f6c30876dfa 406 /**
Kojto 107:4f6c30876dfa 407 * @}
Kojto 107:4f6c30876dfa 408 */
Kojto 107:4f6c30876dfa 409
Kojto 107:4f6c30876dfa 410 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 411 }
Kojto 107:4f6c30876dfa 412 #endif
Kojto 107:4f6c30876dfa 413
Kojto 107:4f6c30876dfa 414 #endif /* __STM32F7xx_HAL_FLASH_H */
Kojto 107:4f6c30876dfa 415
Kojto 107:4f6c30876dfa 416 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/