meh

Fork of mbed by mbed official

Committer:
ricardobtez
Date:
Tue Apr 05 23:51:21 2016 +0000
Revision:
118:16969dd821af
Parent:
92:4fc01daae5a5
Child:
93:e188a91d3eaa
dgdgr

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 85:024bf7f99721 3 * @file stm32f0xx_hal_flash_ex.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
bogdanm 92:4fc01daae5a5 5 * @version V1.1.0
bogdanm 92:4fc01daae5a5 6 * @date 03-Oct-2014
bogdanm 85:024bf7f99721 7 * @brief Header file of FLASH HAL Extension module.
bogdanm 85:024bf7f99721 8 ******************************************************************************
bogdanm 85:024bf7f99721 9 * @attention
bogdanm 85:024bf7f99721 10 *
bogdanm 85:024bf7f99721 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 12 *
bogdanm 85:024bf7f99721 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 14 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 16 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 19 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 21 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 22 * without specific prior written permission.
bogdanm 85:024bf7f99721 23 *
bogdanm 85:024bf7f99721 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 34 *
bogdanm 85:024bf7f99721 35 ******************************************************************************
bogdanm 85:024bf7f99721 36 */
bogdanm 85:024bf7f99721 37
bogdanm 85:024bf7f99721 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 85:024bf7f99721 39 #ifndef __STM32F0xx_HAL_FLASH_EX_H
bogdanm 85:024bf7f99721 40 #define __STM32F0xx_HAL_FLASH_EX_H
bogdanm 85:024bf7f99721 41
bogdanm 85:024bf7f99721 42 #ifdef __cplusplus
bogdanm 85:024bf7f99721 43 extern "C" {
bogdanm 85:024bf7f99721 44 #endif
bogdanm 85:024bf7f99721 45
bogdanm 85:024bf7f99721 46 /* Includes ------------------------------------------------------------------*/
bogdanm 85:024bf7f99721 47 #include "stm32f0xx_hal_def.h"
bogdanm 85:024bf7f99721 48
bogdanm 85:024bf7f99721 49 /** @addtogroup STM32F0xx_HAL_Driver
bogdanm 85:024bf7f99721 50 * @{
bogdanm 85:024bf7f99721 51 */
bogdanm 85:024bf7f99721 52
bogdanm 85:024bf7f99721 53 /** @addtogroup FLASHEx
bogdanm 85:024bf7f99721 54 * @{
bogdanm 85:024bf7f99721 55 */
bogdanm 85:024bf7f99721 56
bogdanm 85:024bf7f99721 57 /* Exported types ------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 58 /* Exported constants --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 59 /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
bogdanm 85:024bf7f99721 60 * @{
bogdanm 85:024bf7f99721 61 */
bogdanm 92:4fc01daae5a5 62 /** @defgroup FLASHEx_Address FLASHEx Address
bogdanm 85:024bf7f99721 63 * @{
bogdanm 85:024bf7f99721 64 */
bogdanm 85:024bf7f99721 65 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx)
bogdanm 85:024bf7f99721 66 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x08007FFF))
bogdanm 85:024bf7f99721 67 #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */
bogdanm 85:024bf7f99721 68
bogdanm 85:024bf7f99721 69 #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 70 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0800FFFF))
bogdanm 85:024bf7f99721 71 #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */
bogdanm 85:024bf7f99721 72
bogdanm 85:024bf7f99721 73 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
bogdanm 85:024bf7f99721 74 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0801FFFF))
bogdanm 85:024bf7f99721 75 #endif /* STM32F071xB || STM32F072xB || STM32F078xx */
bogdanm 92:4fc01daae5a5 76
bogdanm 92:4fc01daae5a5 77 #if defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 78 #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0803FFFF))
bogdanm 92:4fc01daae5a5 79 #endif /* STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 80 /**
bogdanm 85:024bf7f99721 81 * @}
bogdanm 85:024bf7f99721 82 */
bogdanm 85:024bf7f99721 83
bogdanm 92:4fc01daae5a5 84 /** @defgroup FLASHEx_Page_Size FLASHEx Page Size
bogdanm 85:024bf7f99721 85 * @{
bogdanm 85:024bf7f99721 86 */
bogdanm 85:024bf7f99721 87 #if defined(STM32F030x6) || defined(STM32F030x8) || defined(STM32F031x6) || defined(STM32F038xx) || \
bogdanm 85:024bf7f99721 88 defined(STM32F051x8) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 89 #define FLASH_PAGE_SIZE 0x400
bogdanm 85:024bf7f99721 90 #endif /* STM32F030x6 || STM32F030x8 || STM32F031x6 || STM32F051x8 || STM32F042x6 || STM32F048xx || STM32F058xx */
bogdanm 85:024bf7f99721 91
bogdanm 92:4fc01daae5a5 92 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
bogdanm 92:4fc01daae5a5 93 defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 85:024bf7f99721 94 #define FLASH_PAGE_SIZE 0x800
bogdanm 92:4fc01daae5a5 95 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 96
bogdanm 85:024bf7f99721 97 /**
bogdanm 85:024bf7f99721 98 * @}
bogdanm 85:024bf7f99721 99 */
bogdanm 85:024bf7f99721 100
bogdanm 92:4fc01daae5a5 101 /** @defgroup FLASHEx_Nb_Pages FLASHEx Nb Pages
bogdanm 85:024bf7f99721 102 * @{
bogdanm 85:024bf7f99721 103 */
bogdanm 85:024bf7f99721 104 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx)
bogdanm 85:024bf7f99721 105 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x08007FFF)
bogdanm 85:024bf7f99721 106 #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */
bogdanm 85:024bf7f99721 107
bogdanm 85:024bf7f99721 108 #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 109 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0800FFFF)
bogdanm 85:024bf7f99721 110 #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */
bogdanm 85:024bf7f99721 111
bogdanm 85:024bf7f99721 112 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
bogdanm 85:024bf7f99721 113 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0801FFFF)
bogdanm 85:024bf7f99721 114 #endif /* STM32F071xB || STM32F072xB || STM32F078xx */
bogdanm 92:4fc01daae5a5 115
bogdanm 92:4fc01daae5a5 116 #if defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 117 #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0803FFFF)
bogdanm 92:4fc01daae5a5 118 #endif /* STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 119 /**
bogdanm 85:024bf7f99721 120 * @}
bogdanm 85:024bf7f99721 121 */
bogdanm 85:024bf7f99721 122
bogdanm 92:4fc01daae5a5 123 /** @defgroup FLASHEx_OB_Write_Protection FLASHEx OB Write Protection
bogdanm 85:024bf7f99721 124 * @{
bogdanm 85:024bf7f99721 125 */
bogdanm 85:024bf7f99721 126 #if defined(STM32F030x6) || defined(STM32F030x8) || defined(STM32F031x6) || defined(STM32F038xx) || \
bogdanm 85:024bf7f99721 127 defined(STM32F051x8) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 128 #define OB_WRP_PAGES0TO3 ((uint32_t)0x00000001) /* Write protection of page 0 to 3 */
bogdanm 85:024bf7f99721 129 #define OB_WRP_PAGES4TO7 ((uint32_t)0x00000002) /* Write protection of page 4 to 7 */
bogdanm 85:024bf7f99721 130 #define OB_WRP_PAGES8TO11 ((uint32_t)0x00000004) /* Write protection of page 8 to 11 */
bogdanm 85:024bf7f99721 131 #define OB_WRP_PAGES12TO15 ((uint32_t)0x00000008) /* Write protection of page 12 to 15 */
bogdanm 85:024bf7f99721 132 #define OB_WRP_PAGES16TO19 ((uint32_t)0x00000010) /* Write protection of page 16 to 19 */
bogdanm 85:024bf7f99721 133 #define OB_WRP_PAGES20TO23 ((uint32_t)0x00000020) /* Write protection of page 20 to 23 */
bogdanm 85:024bf7f99721 134 #define OB_WRP_PAGES24TO27 ((uint32_t)0x00000040) /* Write protection of page 24 to 27 */
bogdanm 85:024bf7f99721 135 #define OB_WRP_PAGES28TO31 ((uint32_t)0x00000080) /* Write protection of page 28 to 31 */
bogdanm 85:024bf7f99721 136 #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 137 #define OB_WRP_PAGES32TO35 ((uint32_t)0x00000100) /* Write protection of page 32 to 35 */
bogdanm 85:024bf7f99721 138 #define OB_WRP_PAGES36TO39 ((uint32_t)0x00000200) /* Write protection of page 36 to 39 */
bogdanm 85:024bf7f99721 139 #define OB_WRP_PAGES40TO43 ((uint32_t)0x00000400) /* Write protection of page 40 to 43 */
bogdanm 85:024bf7f99721 140 #define OB_WRP_PAGES44TO47 ((uint32_t)0x00000800) /* Write protection of page 44 to 47 */
bogdanm 85:024bf7f99721 141 #define OB_WRP_PAGES48TO51 ((uint32_t)0x00001000) /* Write protection of page 48 to 51 */
bogdanm 85:024bf7f99721 142 #define OB_WRP_PAGES52TO57 ((uint32_t)0x00002000) /* Write protection of page 52 to 57 */
bogdanm 85:024bf7f99721 143 #define OB_WRP_PAGES56TO59 ((uint32_t)0x00004000) /* Write protection of page 56 to 59 */
bogdanm 85:024bf7f99721 144 #define OB_WRP_PAGES60TO63 ((uint32_t)0x00008000) /* Write protection of page 60 to 63 */
bogdanm 85:024bf7f99721 145 #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */
bogdanm 85:024bf7f99721 146
bogdanm 85:024bf7f99721 147 #define OB_WRP_PAGES0TO31MASK ((uint32_t)0x000000FF)
bogdanm 85:024bf7f99721 148 #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 149 #define OB_WRP_PAGES32TO63MASK ((uint32_t)0x0000FF00)
bogdanm 85:024bf7f99721 150 #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */
bogdanm 85:024bf7f99721 151
bogdanm 85:024bf7f99721 152 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx)
bogdanm 85:024bf7f99721 153 #define OB_WRP_ALLPAGES ((uint32_t)0x000000FF) /*!< Write protection of all pages */
bogdanm 85:024bf7f99721 154 #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */
bogdanm 85:024bf7f99721 155
bogdanm 85:024bf7f99721 156 #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx)
bogdanm 85:024bf7f99721 157 #define OB_WRP_ALLPAGES ((uint32_t)0x0000FFFF) /*!< Write protection of all pages */
bogdanm 85:024bf7f99721 158 #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */
bogdanm 85:024bf7f99721 159 #endif /* STM32F030x6 || STM32F030x8 || STM32F031x6 || STM32F051x8 || STM32F042x6 || STM32F048xx || STM32F038xx || STM32F058xx */
bogdanm 85:024bf7f99721 160
bogdanm 92:4fc01daae5a5 161 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
bogdanm 92:4fc01daae5a5 162 defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 85:024bf7f99721 163 #define OB_WRP_PAGES0TO1 ((uint32_t)0x00000001) /* Write protection of page 0 to 1 */
bogdanm 85:024bf7f99721 164 #define OB_WRP_PAGES2TO3 ((uint32_t)0x00000002) /* Write protection of page 2 to 3 */
bogdanm 85:024bf7f99721 165 #define OB_WRP_PAGES4TO5 ((uint32_t)0x00000004) /* Write protection of page 4 to 5 */
bogdanm 85:024bf7f99721 166 #define OB_WRP_PAGES6TO7 ((uint32_t)0x00000008) /* Write protection of page 6 to 7 */
bogdanm 85:024bf7f99721 167 #define OB_WRP_PAGES8TO9 ((uint32_t)0x00000010) /* Write protection of page 8 to 9 */
bogdanm 85:024bf7f99721 168 #define OB_WRP_PAGES10TO11 ((uint32_t)0x00000020) /* Write protection of page 10 to 11 */
bogdanm 85:024bf7f99721 169 #define OB_WRP_PAGES12TO13 ((uint32_t)0x00000040) /* Write protection of page 12 to 13 */
bogdanm 85:024bf7f99721 170 #define OB_WRP_PAGES14TO15 ((uint32_t)0x00000080) /* Write protection of page 14 to 15 */
bogdanm 85:024bf7f99721 171 #define OB_WRP_PAGES16TO17 ((uint32_t)0x00000100) /* Write protection of page 16 to 17 */
bogdanm 85:024bf7f99721 172 #define OB_WRP_PAGES18TO19 ((uint32_t)0x00000200) /* Write protection of page 18 to 19 */
bogdanm 85:024bf7f99721 173 #define OB_WRP_PAGES20TO21 ((uint32_t)0x00000400) /* Write protection of page 20 to 21 */
bogdanm 85:024bf7f99721 174 #define OB_WRP_PAGES22TO23 ((uint32_t)0x00000800) /* Write protection of page 22 to 23 */
bogdanm 85:024bf7f99721 175 #define OB_WRP_PAGES24TO25 ((uint32_t)0x00001000) /* Write protection of page 24 to 25 */
bogdanm 85:024bf7f99721 176 #define OB_WRP_PAGES26TO27 ((uint32_t)0x00002000) /* Write protection of page 26 to 27 */
bogdanm 85:024bf7f99721 177 #define OB_WRP_PAGES28TO29 ((uint32_t)0x00004000) /* Write protection of page 28 to 29 */
bogdanm 85:024bf7f99721 178 #define OB_WRP_PAGES30TO31 ((uint32_t)0x00008000) /* Write protection of page 30 to 31 */
bogdanm 85:024bf7f99721 179 #define OB_WRP_PAGES32TO33 ((uint32_t)0x00010000) /* Write protection of page 32 to 33 */
bogdanm 85:024bf7f99721 180 #define OB_WRP_PAGES34TO35 ((uint32_t)0x00020000) /* Write protection of page 34 to 35 */
bogdanm 85:024bf7f99721 181 #define OB_WRP_PAGES36TO37 ((uint32_t)0x00040000) /* Write protection of page 36 to 37 */
bogdanm 85:024bf7f99721 182 #define OB_WRP_PAGES38TO39 ((uint32_t)0x00080000) /* Write protection of page 38 to 39 */
bogdanm 85:024bf7f99721 183 #define OB_WRP_PAGES40TO41 ((uint32_t)0x00100000) /* Write protection of page 40 to 41 */
bogdanm 85:024bf7f99721 184 #define OB_WRP_PAGES42TO43 ((uint32_t)0x00200000) /* Write protection of page 42 to 43 */
bogdanm 85:024bf7f99721 185 #define OB_WRP_PAGES44TO45 ((uint32_t)0x00400000) /* Write protection of page 44 to 45 */
bogdanm 85:024bf7f99721 186 #define OB_WRP_PAGES46TO47 ((uint32_t)0x00800000) /* Write protection of page 46 to 47 */
bogdanm 85:024bf7f99721 187 #define OB_WRP_PAGES48TO49 ((uint32_t)0x01000000) /* Write protection of page 48 to 49 */
bogdanm 85:024bf7f99721 188 #define OB_WRP_PAGES50TO51 ((uint32_t)0x02000000) /* Write protection of page 50 to 51 */
bogdanm 85:024bf7f99721 189 #define OB_WRP_PAGES52TO53 ((uint32_t)0x04000000) /* Write protection of page 52 to 53 */
bogdanm 85:024bf7f99721 190 #define OB_WRP_PAGES54TO55 ((uint32_t)0x08000000) /* Write protection of page 54 to 55 */
bogdanm 85:024bf7f99721 191 #define OB_WRP_PAGES56TO57 ((uint32_t)0x10000000) /* Write protection of page 56 to 57 */
bogdanm 85:024bf7f99721 192 #define OB_WRP_PAGES58TO59 ((uint32_t)0x20000000) /* Write protection of page 58 to 59 */
bogdanm 85:024bf7f99721 193 #define OB_WRP_PAGES60TO61 ((uint32_t)0x40000000) /* Write protection of page 60 to 61 */
bogdanm 85:024bf7f99721 194 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
bogdanm 85:024bf7f99721 195 #define OB_WRP_PAGES62TO63 ((uint32_t)0x80000000) /* Write protection of page 62 to 63 */
bogdanm 85:024bf7f99721 196 #endif /* STM32F071xB || STM32F072xB || STM32F078xx */
bogdanm 92:4fc01daae5a5 197 #if defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 198 #define OB_WRP_PAGES62TO127 ((uint32_t)0x80000000) /* Write protection of page 62 to 127 */
bogdanm 92:4fc01daae5a5 199 #endif /* STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 200
bogdanm 85:024bf7f99721 201 #define OB_WRP_PAGES0TO15MASK ((uint32_t)0x000000FF)
bogdanm 85:024bf7f99721 202 #define OB_WRP_PAGES16TO31MASK ((uint32_t)0x0000FF00)
bogdanm 85:024bf7f99721 203 #define OB_WRP_PAGES32TO47MASK ((uint32_t)0x00FF0000)
bogdanm 85:024bf7f99721 204 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
bogdanm 85:024bf7f99721 205 #define OB_WRP_PAGES48TO63MASK ((uint32_t)0xFF000000)
bogdanm 85:024bf7f99721 206 #endif /* STM32F071xB || STM32F072xB || STM32F078xx */
bogdanm 92:4fc01daae5a5 207 #if defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 208 #define OB_WRP_PAGES48TO127MASK ((uint32_t)0xFF000000)
bogdanm 92:4fc01daae5a5 209 #endif /* STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 210
bogdanm 85:024bf7f99721 211 #define OB_WRP_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all pages */
bogdanm 92:4fc01daae5a5 212 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 213
bogdanm 85:024bf7f99721 214 #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000))
bogdanm 85:024bf7f99721 215 /**
bogdanm 85:024bf7f99721 216 * @}
bogdanm 85:024bf7f99721 217 */
bogdanm 85:024bf7f99721 218
bogdanm 92:4fc01daae5a5 219 #if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 220 /** @defgroup FLASHEx_OB_BOOT_SEL FLASHEx OB BOOT SEL
bogdanm 85:024bf7f99721 221 * @{
bogdanm 85:024bf7f99721 222 */
bogdanm 85:024bf7f99721 223 #define OB_BOOT_SEL_RESET ((uint8_t)0x00) /*!< BOOT_SEL Reset */
bogdanm 85:024bf7f99721 224 #define OB_BOOT_SEL_SET ((uint8_t)0x80) /*!< BOOT_SEL Set */
bogdanm 85:024bf7f99721 225 #define IS_OB_BOOT_SEL(BOOT_SEL) (((BOOT_SEL) == OB_BOOT_SEL_RESET) || ((BOOT_SEL) == OB_BOOT_SEL_SET))
bogdanm 85:024bf7f99721 226 /**
bogdanm 85:024bf7f99721 227 * @}
bogdanm 85:024bf7f99721 228 */
bogdanm 85:024bf7f99721 229
bogdanm 92:4fc01daae5a5 230 /** @defgroup FLASHEx_OB_BOOT0 FLASHEx OB BOOT0
bogdanm 85:024bf7f99721 231 * @{
bogdanm 85:024bf7f99721 232 */
bogdanm 85:024bf7f99721 233 #define OB_BOOT0_RESET ((uint8_t)0x00) /*!< BOOT0 Reset */
bogdanm 85:024bf7f99721 234 #define OB_BOOT0_SET ((uint8_t)0x08) /*!< BOOT0 Set */
bogdanm 85:024bf7f99721 235 #define IS_OB_BOOT0(BOOT0) (((BOOT0) == OB_BOOT0_RESET) || ((BOOT0) == OB_BOOT0_SET))
bogdanm 85:024bf7f99721 236 /**
bogdanm 85:024bf7f99721 237 * @}
bogdanm 85:024bf7f99721 238 */
bogdanm 92:4fc01daae5a5 239 #endif /* STM32F042x6 || STM32F048xx || STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 240
bogdanm 85:024bf7f99721 241 /**
bogdanm 85:024bf7f99721 242 * @}
bogdanm 85:024bf7f99721 243 */
bogdanm 85:024bf7f99721 244
bogdanm 85:024bf7f99721 245 /* Exported macro ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 246
bogdanm 85:024bf7f99721 247 /* Exported functions --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 248 /** @addtogroup FLASHEx_Exported_Functions FLASHEx Exported Functions
bogdanm 92:4fc01daae5a5 249 * @{
bogdanm 92:4fc01daae5a5 250 */
bogdanm 92:4fc01daae5a5 251
bogdanm 92:4fc01daae5a5 252 /** @addtogroup FLASHEx_Exported_Functions_Group2 Extended I/O operation functions
bogdanm 92:4fc01daae5a5 253 * @brief Extended I/O operation functions
bogdanm 92:4fc01daae5a5 254 * @{
bogdanm 92:4fc01daae5a5 255 */
bogdanm 85:024bf7f99721 256 /* IO operation functions *****************************************************/
bogdanm 85:024bf7f99721 257 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
bogdanm 85:024bf7f99721 258 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
bogdanm 85:024bf7f99721 259
bogdanm 92:4fc01daae5a5 260 /**
bogdanm 92:4fc01daae5a5 261 * @}
bogdanm 92:4fc01daae5a5 262 */
bogdanm 92:4fc01daae5a5 263
bogdanm 92:4fc01daae5a5 264 /** @addtogroup FLASHEx_Exported_Functions_Group3 Extended Peripheral Control functions
bogdanm 92:4fc01daae5a5 265 * @brief Extended Peripheral Control functions
bogdanm 92:4fc01daae5a5 266 * @{
bogdanm 92:4fc01daae5a5 267 */
bogdanm 85:024bf7f99721 268 /* Peripheral Control functions ***********************************************/
bogdanm 85:024bf7f99721 269 HAL_StatusTypeDef HAL_FLASHEx_OBErase(void);
bogdanm 85:024bf7f99721 270 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
bogdanm 85:024bf7f99721 271 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
bogdanm 85:024bf7f99721 272
bogdanm 85:024bf7f99721 273 /**
bogdanm 85:024bf7f99721 274 * @}
bogdanm 85:024bf7f99721 275 */
bogdanm 85:024bf7f99721 276
bogdanm 85:024bf7f99721 277 /**
bogdanm 85:024bf7f99721 278 * @}
bogdanm 85:024bf7f99721 279 */
bogdanm 92:4fc01daae5a5 280
bogdanm 92:4fc01daae5a5 281 /**
bogdanm 92:4fc01daae5a5 282 * @}
bogdanm 92:4fc01daae5a5 283 */
bogdanm 92:4fc01daae5a5 284
bogdanm 92:4fc01daae5a5 285 /**
bogdanm 92:4fc01daae5a5 286 * @}
bogdanm 92:4fc01daae5a5 287 */
bogdanm 92:4fc01daae5a5 288
bogdanm 85:024bf7f99721 289 #ifdef __cplusplus
bogdanm 85:024bf7f99721 290 }
bogdanm 85:024bf7f99721 291 #endif
bogdanm 85:024bf7f99721 292
bogdanm 85:024bf7f99721 293 #endif /* __STM32F0xx_HAL_FLASH_EX_H */
bogdanm 85:024bf7f99721 294
bogdanm 85:024bf7f99721 295 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
bogdanm 92:4fc01daae5a5 296