mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
yusuke_kyo
Date:
Wed Apr 08 08:04:18 2015 +0000
Revision:
98:01a414ca7d6d
Parent:
93:e188a91d3eaa
remove SerialHalfDuplex.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 93:e188a91d3eaa 1 /**
Kojto 93:e188a91d3eaa 2 ******************************************************************************
Kojto 93:e188a91d3eaa 3 * @file stm32f4xx_hal_flash.h
Kojto 93:e188a91d3eaa 4 * @author MCD Application Team
Kojto 93:e188a91d3eaa 5 * @version V1.1.0
Kojto 93:e188a91d3eaa 6 * @date 19-June-2014
Kojto 93:e188a91d3eaa 7 * @brief Header file of FLASH HAL module.
Kojto 93:e188a91d3eaa 8 ******************************************************************************
Kojto 93:e188a91d3eaa 9 * @attention
Kojto 93:e188a91d3eaa 10 *
Kojto 93:e188a91d3eaa 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 93:e188a91d3eaa 12 *
Kojto 93:e188a91d3eaa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 93:e188a91d3eaa 14 * are permitted provided that the following conditions are met:
Kojto 93:e188a91d3eaa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 93:e188a91d3eaa 16 * this list of conditions and the following disclaimer.
Kojto 93:e188a91d3eaa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 93:e188a91d3eaa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 93:e188a91d3eaa 19 * and/or other materials provided with the distribution.
Kojto 93:e188a91d3eaa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 93:e188a91d3eaa 21 * may be used to endorse or promote products derived from this software
Kojto 93:e188a91d3eaa 22 * without specific prior written permission.
Kojto 93:e188a91d3eaa 23 *
Kojto 93:e188a91d3eaa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 93:e188a91d3eaa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 93:e188a91d3eaa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 93:e188a91d3eaa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 93:e188a91d3eaa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 93:e188a91d3eaa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 93:e188a91d3eaa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 93:e188a91d3eaa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 93:e188a91d3eaa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 93:e188a91d3eaa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 93:e188a91d3eaa 34 *
Kojto 93:e188a91d3eaa 35 ******************************************************************************
Kojto 93:e188a91d3eaa 36 */
Kojto 93:e188a91d3eaa 37
Kojto 93:e188a91d3eaa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 93:e188a91d3eaa 39 #ifndef __STM32F4xx_HAL_FLASH_H
Kojto 93:e188a91d3eaa 40 #define __STM32F4xx_HAL_FLASH_H
Kojto 93:e188a91d3eaa 41
Kojto 93:e188a91d3eaa 42 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 43 extern "C" {
Kojto 93:e188a91d3eaa 44 #endif
Kojto 93:e188a91d3eaa 45
Kojto 93:e188a91d3eaa 46 /* Includes ------------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 47 #include "stm32f4xx_hal_def.h"
Kojto 93:e188a91d3eaa 48
Kojto 93:e188a91d3eaa 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 93:e188a91d3eaa 50 * @{
Kojto 93:e188a91d3eaa 51 */
Kojto 93:e188a91d3eaa 52
Kojto 93:e188a91d3eaa 53 /** @addtogroup FLASH
Kojto 93:e188a91d3eaa 54 * @{
Kojto 93:e188a91d3eaa 55 */
Kojto 93:e188a91d3eaa 56
Kojto 93:e188a91d3eaa 57 /* Exported types ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 58 /**
Kojto 93:e188a91d3eaa 59 * @brief FLASH Error structure definition
Kojto 93:e188a91d3eaa 60 */
Kojto 93:e188a91d3eaa 61 typedef enum
Kojto 93:e188a91d3eaa 62 {
Kojto 93:e188a91d3eaa 63 FLASH_ERROR_RD = 0x01,
Kojto 93:e188a91d3eaa 64 FLASH_ERROR_PGS = 0x02,
Kojto 93:e188a91d3eaa 65 FLASH_ERROR_PGP = 0x04,
Kojto 93:e188a91d3eaa 66 FLASH_ERROR_PGA = 0x08,
Kojto 93:e188a91d3eaa 67 FLASH_ERROR_WRP = 0x10,
Kojto 93:e188a91d3eaa 68 FLASH_ERROR_OPERATION = 0x20
Kojto 93:e188a91d3eaa 69 }FLASH_ErrorTypeDef;
Kojto 93:e188a91d3eaa 70
Kojto 93:e188a91d3eaa 71 /**
Kojto 93:e188a91d3eaa 72 * @brief FLASH Procedure structure definition
Kojto 93:e188a91d3eaa 73 */
Kojto 93:e188a91d3eaa 74 typedef enum
Kojto 93:e188a91d3eaa 75 {
Kojto 93:e188a91d3eaa 76 FLASH_PROC_NONE = 0,
Kojto 93:e188a91d3eaa 77 FLASH_PROC_SECTERASE,
Kojto 93:e188a91d3eaa 78 FLASH_PROC_MASSERASE,
Kojto 93:e188a91d3eaa 79 FLASH_PROC_PROGRAM
Kojto 93:e188a91d3eaa 80 } FLASH_ProcedureTypeDef;
Kojto 93:e188a91d3eaa 81
Kojto 93:e188a91d3eaa 82
Kojto 93:e188a91d3eaa 83 /**
Kojto 93:e188a91d3eaa 84 * @brief FLASH handle Structure definition
Kojto 93:e188a91d3eaa 85 */
Kojto 93:e188a91d3eaa 86 typedef struct
Kojto 93:e188a91d3eaa 87 {
Kojto 93:e188a91d3eaa 88 __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*Internal variable to indicate which procedure is ongoing or not in IT context*/
Kojto 93:e188a91d3eaa 89
Kojto 93:e188a91d3eaa 90 __IO uint32_t NbSectorsToErase; /*Internal variable to save the remaining sectors to erase in IT context*/
Kojto 93:e188a91d3eaa 91
Kojto 93:e188a91d3eaa 92 __IO uint8_t VoltageForErase; /*Internal variable to provide voltange range selected by user in IT context*/
Kojto 93:e188a91d3eaa 93
Kojto 93:e188a91d3eaa 94 __IO uint32_t Sector; /*Internal variable to define the current sector which is erasing*/
Kojto 93:e188a91d3eaa 95
Kojto 93:e188a91d3eaa 96 __IO uint32_t Bank; /*Internal variable to save current bank selected during mass erase*/
Kojto 93:e188a91d3eaa 97
Kojto 93:e188a91d3eaa 98 __IO uint32_t Address; /*Internal variable to save address selected for program*/
Kojto 93:e188a91d3eaa 99
Kojto 93:e188a91d3eaa 100 HAL_LockTypeDef Lock; /* FLASH locking object */
Kojto 93:e188a91d3eaa 101
Kojto 93:e188a91d3eaa 102 __IO FLASH_ErrorTypeDef ErrorCode; /* FLASH error code */
Kojto 93:e188a91d3eaa 103
Kojto 93:e188a91d3eaa 104 }FLASH_ProcessTypeDef;
Kojto 93:e188a91d3eaa 105
Kojto 93:e188a91d3eaa 106 /**
Kojto 93:e188a91d3eaa 107 * @brief FLASH Error source
Kojto 93:e188a91d3eaa 108 */
Kojto 93:e188a91d3eaa 109 /* Exported constants --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 110
Kojto 93:e188a91d3eaa 111 /** @defgroup FLASH_Exported_Constants FLASH Exported Constants
Kojto 93:e188a91d3eaa 112 * @{
Kojto 93:e188a91d3eaa 113 */
Kojto 93:e188a91d3eaa 114
Kojto 93:e188a91d3eaa 115
Kojto 93:e188a91d3eaa 116
Kojto 93:e188a91d3eaa 117 /** @defgroup FLASH_Type_Program FLASH Type Program
Kojto 93:e188a91d3eaa 118 * @{
Kojto 93:e188a91d3eaa 119 */
Kojto 93:e188a91d3eaa 120 #define TYPEPROGRAM_BYTE ((uint32_t)0x00) /*!< Program byte (8-bit) at a specified address */
Kojto 93:e188a91d3eaa 121 #define TYPEPROGRAM_HALFWORD ((uint32_t)0x01) /*!< Program a half-word (16-bit) at a specified address */
Kojto 93:e188a91d3eaa 122 #define TYPEPROGRAM_WORD ((uint32_t)0x02) /*!< Program a word (32-bit) at a specified address */
Kojto 93:e188a91d3eaa 123 #define TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03) /*!< Program a double word (64-bit) at a specified address */
Kojto 93:e188a91d3eaa 124
Kojto 93:e188a91d3eaa 125 #define IS_TYPEPROGRAM(VALUE)(((VALUE) == TYPEPROGRAM_BYTE) || \
Kojto 93:e188a91d3eaa 126 ((VALUE) == TYPEPROGRAM_HALFWORD) || \
Kojto 93:e188a91d3eaa 127 ((VALUE) == TYPEPROGRAM_WORD) || \
Kojto 93:e188a91d3eaa 128 ((VALUE) == TYPEPROGRAM_DOUBLEWORD))
Kojto 93:e188a91d3eaa 129
Kojto 93:e188a91d3eaa 130 /**
Kojto 93:e188a91d3eaa 131 * @}
Kojto 93:e188a91d3eaa 132 */
Kojto 93:e188a91d3eaa 133
Kojto 93:e188a91d3eaa 134 /** @defgroup FLASH_Flag_definition FLASH Flag definition
Kojto 93:e188a91d3eaa 135 * @brief Flag definition
Kojto 93:e188a91d3eaa 136 * @{
Kojto 93:e188a91d3eaa 137 */
Kojto 93:e188a91d3eaa 138 #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Operation flag */
Kojto 93:e188a91d3eaa 139 #define FLASH_FLAG_OPERR FLASH_SR_SOP /*!< FLASH operation Error flag */
Kojto 93:e188a91d3eaa 140 #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */
Kojto 93:e188a91d3eaa 141 #define FLASH_FLAG_PGAERR FLASH_SR_PGAERR /*!< FLASH Programming Alignment error flag */
Kojto 93:e188a91d3eaa 142 #define FLASH_FLAG_PGPERR FLASH_SR_PGPERR /*!< FLASH Programming Parallelism error flag */
Kojto 93:e188a91d3eaa 143 #define FLASH_FLAG_PGSERR FLASH_SR_PGSERR /*!< FLASH Programming Sequence error flag */
Kojto 93:e188a91d3eaa 144 #define FLASH_FLAG_RDERR ((uint32_t)0x00000100) /*!< Read Protection error flag (PCROP) */
Kojto 93:e188a91d3eaa 145 #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */
Kojto 93:e188a91d3eaa 146
Kojto 93:e188a91d3eaa 147 /**
Kojto 93:e188a91d3eaa 148 * @}
Kojto 93:e188a91d3eaa 149 */
Kojto 93:e188a91d3eaa 150
Kojto 93:e188a91d3eaa 151 /** @defgroup FLASH_Interrupt_definition FLASH Interrupt definition
Kojto 93:e188a91d3eaa 152 * @brief FLASH Interrupt definition
Kojto 93:e188a91d3eaa 153 * @{
Kojto 93:e188a91d3eaa 154 */
Kojto 93:e188a91d3eaa 155 #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */
Kojto 93:e188a91d3eaa 156 #define FLASH_IT_ERR ((uint32_t)0x02000000) /*!< Error Interrupt source */
Kojto 93:e188a91d3eaa 157
Kojto 93:e188a91d3eaa 158 /**
Kojto 93:e188a91d3eaa 159 * @}
Kojto 93:e188a91d3eaa 160 */
Kojto 93:e188a91d3eaa 161
Kojto 93:e188a91d3eaa 162 /** @defgroup FLASH_Program_Parallelism FLASH Program Parallelism
Kojto 93:e188a91d3eaa 163 * @{
Kojto 93:e188a91d3eaa 164 */
Kojto 93:e188a91d3eaa 165 #define FLASH_PSIZE_BYTE ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 166 #define FLASH_PSIZE_HALF_WORD ((uint32_t)0x00000100)
Kojto 93:e188a91d3eaa 167 #define FLASH_PSIZE_WORD ((uint32_t)0x00000200)
Kojto 93:e188a91d3eaa 168 #define FLASH_PSIZE_DOUBLE_WORD ((uint32_t)0x00000300)
Kojto 93:e188a91d3eaa 169 #define CR_PSIZE_MASK ((uint32_t)0xFFFFFCFF)
Kojto 93:e188a91d3eaa 170 /**
Kojto 93:e188a91d3eaa 171 * @}
Kojto 93:e188a91d3eaa 172 */
Kojto 93:e188a91d3eaa 173
Kojto 93:e188a91d3eaa 174 /** @defgroup FLASH_Keys FLASH Keys
Kojto 93:e188a91d3eaa 175 * @{
Kojto 93:e188a91d3eaa 176 */
Kojto 93:e188a91d3eaa 177 #define RDP_KEY ((uint16_t)0x00A5)
Kojto 93:e188a91d3eaa 178 #define FLASH_KEY1 ((uint32_t)0x45670123)
Kojto 93:e188a91d3eaa 179 #define FLASH_KEY2 ((uint32_t)0xCDEF89AB)
Kojto 93:e188a91d3eaa 180 #define FLASH_OPT_KEY1 ((uint32_t)0x08192A3B)
Kojto 93:e188a91d3eaa 181 #define FLASH_OPT_KEY2 ((uint32_t)0x4C5D6E7F)
Kojto 93:e188a91d3eaa 182 /**
Kojto 93:e188a91d3eaa 183 * @}
Kojto 93:e188a91d3eaa 184 */
Kojto 93:e188a91d3eaa 185
Kojto 93:e188a91d3eaa 186 /**
Kojto 93:e188a91d3eaa 187 * @brief ACR register byte 0 (Bits[7:0]) base address
Kojto 93:e188a91d3eaa 188 */
Kojto 93:e188a91d3eaa 189 #define ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00)
Kojto 93:e188a91d3eaa 190 /**
Kojto 93:e188a91d3eaa 191 * @brief OPTCR register byte 0 (Bits[7:0]) base address
Kojto 93:e188a91d3eaa 192 */
Kojto 93:e188a91d3eaa 193 #define OPTCR_BYTE0_ADDRESS ((uint32_t)0x40023C14)
Kojto 93:e188a91d3eaa 194 /**
Kojto 93:e188a91d3eaa 195 * @brief OPTCR register byte 1 (Bits[15:8]) base address
Kojto 93:e188a91d3eaa 196 */
Kojto 93:e188a91d3eaa 197 #define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15)
Kojto 93:e188a91d3eaa 198 /**
Kojto 93:e188a91d3eaa 199 * @brief OPTCR register byte 2 (Bits[23:16]) base address
Kojto 93:e188a91d3eaa 200 */
Kojto 93:e188a91d3eaa 201 #define OPTCR_BYTE2_ADDRESS ((uint32_t)0x40023C16)
Kojto 93:e188a91d3eaa 202 /**
Kojto 93:e188a91d3eaa 203 * @brief OPTCR register byte 3 (Bits[31:24]) base address
Kojto 93:e188a91d3eaa 204 */
Kojto 93:e188a91d3eaa 205 #define OPTCR_BYTE3_ADDRESS ((uint32_t)0x40023C17)
Kojto 93:e188a91d3eaa 206
Kojto 93:e188a91d3eaa 207 /**
Kojto 93:e188a91d3eaa 208 * @}
Kojto 93:e188a91d3eaa 209 */
Kojto 93:e188a91d3eaa 210
Kojto 93:e188a91d3eaa 211 /* Exported macro ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 212
Kojto 93:e188a91d3eaa 213 /**
Kojto 93:e188a91d3eaa 214 * @brief Set the FLASH Latency.
Kojto 93:e188a91d3eaa 215 * @param __LATENCY__: FLASH Latency
Kojto 93:e188a91d3eaa 216 * The value of this parameter depend on device used within the same series
Kojto 93:e188a91d3eaa 217 * @retval none
Kojto 93:e188a91d3eaa 218 */
Kojto 93:e188a91d3eaa 219 #define __HAL_FLASH_SET_LATENCY(__LATENCY__) (*(__IO uint8_t *)ACR_BYTE0_ADDRESS = (uint8_t)(__LATENCY__))
Kojto 93:e188a91d3eaa 220
Kojto 93:e188a91d3eaa 221 /**
Kojto 93:e188a91d3eaa 222 * @brief Enable the FLASH prefetch buffer.
Kojto 93:e188a91d3eaa 223 * @retval none
Kojto 93:e188a91d3eaa 224 */
Kojto 93:e188a91d3eaa 225 #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTEN)
Kojto 93:e188a91d3eaa 226
Kojto 93:e188a91d3eaa 227 /**
Kojto 93:e188a91d3eaa 228 * @brief Disable the FLASH prefetch buffer.
Kojto 93:e188a91d3eaa 229 * @retval none
Kojto 93:e188a91d3eaa 230 */
Kojto 93:e188a91d3eaa 231 #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTEN))
Kojto 93:e188a91d3eaa 232
Kojto 93:e188a91d3eaa 233 /**
Kojto 93:e188a91d3eaa 234 * @brief Enable the FLASH instruction cache.
Kojto 93:e188a91d3eaa 235 * @retval none
Kojto 93:e188a91d3eaa 236 */
Kojto 93:e188a91d3eaa 237 #define __HAL_FLASH_INSTRUCTION_CACHE_ENABLE() (FLASH->ACR |= FLASH_ACR_ICEN)
Kojto 93:e188a91d3eaa 238
Kojto 93:e188a91d3eaa 239 /**
Kojto 93:e188a91d3eaa 240 * @brief Disable the FLASH instruction cache.
Kojto 93:e188a91d3eaa 241 * @retval none
Kojto 93:e188a91d3eaa 242 */
Kojto 93:e188a91d3eaa 243 #define __HAL_FLASH_INSTRUCTION_CACHE_DISABLE() (FLASH->ACR &= (~FLASH_ACR_ICEN))
Kojto 93:e188a91d3eaa 244
Kojto 93:e188a91d3eaa 245 /**
Kojto 93:e188a91d3eaa 246 * @brief Enable the FLASH data cache.
Kojto 93:e188a91d3eaa 247 * @retval none
Kojto 93:e188a91d3eaa 248 */
Kojto 93:e188a91d3eaa 249 #define __HAL_FLASH_DATA_CACHE_ENABLE() (FLASH->ACR |= FLASH_ACR_DCEN)
Kojto 93:e188a91d3eaa 250
Kojto 93:e188a91d3eaa 251 /**
Kojto 93:e188a91d3eaa 252 * @brief Disable the FLASH data cache.
Kojto 93:e188a91d3eaa 253 * @retval none
Kojto 93:e188a91d3eaa 254 */
Kojto 93:e188a91d3eaa 255 #define __HAL_FLASH_DATA_CACHE_DISABLE() (FLASH->ACR &= (~FLASH_ACR_DCEN))
Kojto 93:e188a91d3eaa 256
Kojto 93:e188a91d3eaa 257 /**
Kojto 93:e188a91d3eaa 258 * @brief Resets the FLASH instruction Cache.
Kojto 93:e188a91d3eaa 259 * @note This function must be used only when the Instruction Cache is disabled.
Kojto 93:e188a91d3eaa 260 * @retval None
Kojto 93:e188a91d3eaa 261 */
Kojto 93:e188a91d3eaa 262 #define __HAL_FLASH_INSTRUCTION_CACHE_RESET() (FLASH->ACR |= FLASH_ACR_ICRST)
Kojto 93:e188a91d3eaa 263
Kojto 93:e188a91d3eaa 264 /**
Kojto 93:e188a91d3eaa 265 * @brief Resets the FLASH data Cache.
Kojto 93:e188a91d3eaa 266 * @note This function must be used only when the data Cache is disabled.
Kojto 93:e188a91d3eaa 267 * @retval None
Kojto 93:e188a91d3eaa 268 */
Kojto 93:e188a91d3eaa 269 #define __HAL_FLASH_DATA_CACHE_RESET() (FLASH->ACR |= FLASH_ACR_DCRST)
Kojto 93:e188a91d3eaa 270
Kojto 93:e188a91d3eaa 271 /**
Kojto 93:e188a91d3eaa 272 * @brief Enable the specified FLASH interrupt.
Kojto 93:e188a91d3eaa 273 * @param __INTERRUPT__ : FLASH interrupt
Kojto 93:e188a91d3eaa 274 * This parameter can be any combination of the following values:
Kojto 93:e188a91d3eaa 275 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
Kojto 93:e188a91d3eaa 276 * @arg FLASH_IT_ERR: Error Interrupt
Kojto 93:e188a91d3eaa 277 * @retval none
Kojto 93:e188a91d3eaa 278 */
Kojto 93:e188a91d3eaa 279 #define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) (FLASH->CR |= (__INTERRUPT__))
Kojto 93:e188a91d3eaa 280
Kojto 93:e188a91d3eaa 281 /**
Kojto 93:e188a91d3eaa 282 * @brief Disable the specified FLASH interrupt.
Kojto 93:e188a91d3eaa 283 * @param __INTERRUPT__ : FLASH interrupt
Kojto 93:e188a91d3eaa 284 * This parameter can be any combination of the following values:
Kojto 93:e188a91d3eaa 285 * @arg FLASH_IT_EOP: End of FLASH Operation Interrupt
Kojto 93:e188a91d3eaa 286 * @arg FLASH_IT_ERR: Error Interrupt
Kojto 93:e188a91d3eaa 287 * @retval none
Kojto 93:e188a91d3eaa 288 */
Kojto 93:e188a91d3eaa 289 #define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) (FLASH->CR &= ~(uint32_t)(__INTERRUPT__))
Kojto 93:e188a91d3eaa 290
Kojto 93:e188a91d3eaa 291 /**
Kojto 93:e188a91d3eaa 292 * @brief Get the specified FLASH flag status.
Kojto 93:e188a91d3eaa 293 * @param __FLAG__: specifies the FLASH flag to check.
Kojto 93:e188a91d3eaa 294 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 295 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
Kojto 93:e188a91d3eaa 296 * @arg FLASH_FLAG_OPERR : FLASH operation Error flag
Kojto 93:e188a91d3eaa 297 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
Kojto 93:e188a91d3eaa 298 * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
Kojto 93:e188a91d3eaa 299 * @arg FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag
Kojto 93:e188a91d3eaa 300 * @arg FLASH_FLAG_PGSERR: FLASH Programming Sequence error flag
Kojto 93:e188a91d3eaa 301 * @arg FLASH_FLAG_RDERR : FLASH Read Protection error flag (PCROP)
Kojto 93:e188a91d3eaa 302 * @arg FLASH_FLAG_BSY : FLASH Busy flag
Kojto 93:e188a91d3eaa 303 * @retval The new state of __FLAG__ (SET or RESET).
Kojto 93:e188a91d3eaa 304 */
Kojto 93:e188a91d3eaa 305 #define __HAL_FLASH_GET_FLAG(__FLAG__) ((FLASH->SR & (__FLAG__)))
Kojto 93:e188a91d3eaa 306
Kojto 93:e188a91d3eaa 307 /**
Kojto 93:e188a91d3eaa 308 * @brief Clear the specified FLASH flag.
Kojto 93:e188a91d3eaa 309 * @param __FLAG__: specifies the FLASH flags to clear.
Kojto 93:e188a91d3eaa 310 * This parameter can be any combination of the following values:
Kojto 93:e188a91d3eaa 311 * @arg FLASH_FLAG_EOP : FLASH End of Operation flag
Kojto 93:e188a91d3eaa 312 * @arg FLASH_FLAG_OPERR : FLASH operation Error flag
Kojto 93:e188a91d3eaa 313 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
Kojto 93:e188a91d3eaa 314 * @arg FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
Kojto 93:e188a91d3eaa 315 * @arg FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag
Kojto 93:e188a91d3eaa 316 * @arg FLASH_FLAG_PGSERR: FLASH Programming Sequence error flag
Kojto 93:e188a91d3eaa 317 * @arg FLASH_FLAG_RDERR : FLASH Read Protection error flag (PCROP)
Kojto 93:e188a91d3eaa 318 * @retval none
Kojto 93:e188a91d3eaa 319 */
Kojto 93:e188a91d3eaa 320 #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) (FLASH->SR = (__FLAG__))
Kojto 93:e188a91d3eaa 321
Kojto 93:e188a91d3eaa 322 /* Include FLASH HAL Extension module */
Kojto 93:e188a91d3eaa 323 #include "stm32f4xx_hal_flash_ex.h"
Kojto 93:e188a91d3eaa 324 #include "stm32f4xx_hal_flash_ramfunc.h"
Kojto 93:e188a91d3eaa 325
Kojto 93:e188a91d3eaa 326 /* Exported functions --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 327 /* Program operation functions ***********************************************/
Kojto 93:e188a91d3eaa 328 HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
Kojto 93:e188a91d3eaa 329 HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
Kojto 93:e188a91d3eaa 330 /* FLASH IRQ handler method */
Kojto 93:e188a91d3eaa 331 void HAL_FLASH_IRQHandler(void);
Kojto 93:e188a91d3eaa 332 /* Callbacks in non blocking modes */
Kojto 93:e188a91d3eaa 333 void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
Kojto 93:e188a91d3eaa 334 void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
Kojto 93:e188a91d3eaa 335
Kojto 93:e188a91d3eaa 336 /* Peripheral Control functions **********************************************/
Kojto 93:e188a91d3eaa 337 HAL_StatusTypeDef HAL_FLASH_Unlock(void);
Kojto 93:e188a91d3eaa 338 HAL_StatusTypeDef HAL_FLASH_Lock(void);
Kojto 93:e188a91d3eaa 339 HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
Kojto 93:e188a91d3eaa 340 HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
Kojto 93:e188a91d3eaa 341 /* Option bytes control */
Kojto 93:e188a91d3eaa 342 HAL_StatusTypeDef HAL_FLASH_OB_Launch(void);
Kojto 93:e188a91d3eaa 343
Kojto 93:e188a91d3eaa 344 /* Peripheral State functions ************************************************/
Kojto 93:e188a91d3eaa 345 FLASH_ErrorTypeDef HAL_FLASH_GetError(void);
Kojto 93:e188a91d3eaa 346
Kojto 93:e188a91d3eaa 347 HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
Kojto 93:e188a91d3eaa 348
Kojto 93:e188a91d3eaa 349 /**
Kojto 93:e188a91d3eaa 350 * @}
Kojto 93:e188a91d3eaa 351 */
Kojto 93:e188a91d3eaa 352
Kojto 93:e188a91d3eaa 353 /**
Kojto 93:e188a91d3eaa 354 * @}
Kojto 93:e188a91d3eaa 355 */
Kojto 93:e188a91d3eaa 356
Kojto 93:e188a91d3eaa 357 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 358 }
Kojto 93:e188a91d3eaa 359 #endif
Kojto 93:e188a91d3eaa 360
Kojto 93:e188a91d3eaa 361 #endif /* __STM32F4xx_HAL_FLASH_H */
Kojto 93:e188a91d3eaa 362
Kojto 93:e188a91d3eaa 363 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/