I2C_EEPROM

Committer:
jhon309
Date:
Thu Aug 13 00:23:16 2015 +0000
Revision:
0:ac8863619623
I2C

Who changed what in which revision?

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