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