my fork
Fork of mbed by
TARGET_NUCLEO_F072RB/stm32f0xx_hal_flash_ex.h@85:024bf7f99721, 2014-06-11 (annotated)
- Committer:
- bogdanm
- Date:
- Wed Jun 11 15:14:05 2014 +0100
- Revision:
- 85:024bf7f99721
- Child:
- 92:4fc01daae5a5
Release 85 of the mbed library
Main changes:
- K64F Ethernet fixes
- Updated tests
- Fixes for various mbed targets
- Code cleanup: fixed warnings, more consistent code style
- GCC support for K64F
There is a known issue with the I2C interface on some ST targets. If you
find the I2C interface problematic on your ST board, please log a bug
against this on mbed.org.
Who changed what in which revision?
User | Revision | Line number | New 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 | 85:024bf7f99721 | 5 | * @version V1.0.0 |
bogdanm | 85:024bf7f99721 | 6 | * @date 28-May-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>© 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 | 85:024bf7f99721 | 58 | /** @defgroup FLASHEx_Exported_Types |
bogdanm | 85:024bf7f99721 | 59 | * @{ |
bogdanm | 85:024bf7f99721 | 60 | */ |
bogdanm | 85:024bf7f99721 | 61 | /** |
bogdanm | 85:024bf7f99721 | 62 | * @} |
bogdanm | 85:024bf7f99721 | 63 | */ |
bogdanm | 85:024bf7f99721 | 64 | |
bogdanm | 85:024bf7f99721 | 65 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 66 | /** @defgroup FLASHEx_Exported_Constants |
bogdanm | 85:024bf7f99721 | 67 | * @{ |
bogdanm | 85:024bf7f99721 | 68 | */ |
bogdanm | 85:024bf7f99721 | 69 | /** @defgroup FLASHEx_Address |
bogdanm | 85:024bf7f99721 | 70 | * @{ |
bogdanm | 85:024bf7f99721 | 71 | */ |
bogdanm | 85:024bf7f99721 | 72 | #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx) |
bogdanm | 85:024bf7f99721 | 73 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x08007FFF)) |
bogdanm | 85:024bf7f99721 | 74 | #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */ |
bogdanm | 85:024bf7f99721 | 75 | |
bogdanm | 85:024bf7f99721 | 76 | #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 77 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0800FFFF)) |
bogdanm | 85:024bf7f99721 | 78 | #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 79 | |
bogdanm | 85:024bf7f99721 | 80 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 81 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0801FFFF)) |
bogdanm | 85:024bf7f99721 | 82 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 83 | /** |
bogdanm | 85:024bf7f99721 | 84 | * @} |
bogdanm | 85:024bf7f99721 | 85 | */ |
bogdanm | 85:024bf7f99721 | 86 | |
bogdanm | 85:024bf7f99721 | 87 | /** @defgroup FLASHEx_Page_Size |
bogdanm | 85:024bf7f99721 | 88 | * @{ |
bogdanm | 85:024bf7f99721 | 89 | */ |
bogdanm | 85:024bf7f99721 | 90 | #if defined(STM32F030x6) || defined(STM32F030x8) || defined(STM32F031x6) || defined(STM32F038xx) || \ |
bogdanm | 85:024bf7f99721 | 91 | defined(STM32F051x8) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 92 | #define FLASH_PAGE_SIZE 0x400 |
bogdanm | 85:024bf7f99721 | 93 | #endif /* STM32F030x6 || STM32F030x8 || STM32F031x6 || STM32F051x8 || STM32F042x6 || STM32F048xx || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 94 | |
bogdanm | 85:024bf7f99721 | 95 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 96 | #define FLASH_PAGE_SIZE 0x800 |
bogdanm | 85:024bf7f99721 | 97 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 98 | |
bogdanm | 85:024bf7f99721 | 99 | /** |
bogdanm | 85:024bf7f99721 | 100 | * @} |
bogdanm | 85:024bf7f99721 | 101 | */ |
bogdanm | 85:024bf7f99721 | 102 | |
bogdanm | 85:024bf7f99721 | 103 | /** @defgroup FLASHEx_Nb_Pages |
bogdanm | 85:024bf7f99721 | 104 | * @{ |
bogdanm | 85:024bf7f99721 | 105 | */ |
bogdanm | 85:024bf7f99721 | 106 | #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx) |
bogdanm | 85:024bf7f99721 | 107 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x08007FFF) |
bogdanm | 85:024bf7f99721 | 108 | #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */ |
bogdanm | 85:024bf7f99721 | 109 | |
bogdanm | 85:024bf7f99721 | 110 | #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 111 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0800FFFF) |
bogdanm | 85:024bf7f99721 | 112 | #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 113 | |
bogdanm | 85:024bf7f99721 | 114 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 115 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0801FFFF) |
bogdanm | 85:024bf7f99721 | 116 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 117 | /** |
bogdanm | 85:024bf7f99721 | 118 | * @} |
bogdanm | 85:024bf7f99721 | 119 | */ |
bogdanm | 85:024bf7f99721 | 120 | |
bogdanm | 85:024bf7f99721 | 121 | /** @defgroup FLASHEx_OB_Write_Protection |
bogdanm | 85:024bf7f99721 | 122 | * @{ |
bogdanm | 85:024bf7f99721 | 123 | */ |
bogdanm | 85:024bf7f99721 | 124 | #if defined(STM32F030x6) || defined(STM32F030x8) || defined(STM32F031x6) || defined(STM32F038xx) || \ |
bogdanm | 85:024bf7f99721 | 125 | defined(STM32F051x8) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 126 | #define OB_WRP_PAGES0TO3 ((uint32_t)0x00000001) /* Write protection of page 0 to 3 */ |
bogdanm | 85:024bf7f99721 | 127 | #define OB_WRP_PAGES4TO7 ((uint32_t)0x00000002) /* Write protection of page 4 to 7 */ |
bogdanm | 85:024bf7f99721 | 128 | #define OB_WRP_PAGES8TO11 ((uint32_t)0x00000004) /* Write protection of page 8 to 11 */ |
bogdanm | 85:024bf7f99721 | 129 | #define OB_WRP_PAGES12TO15 ((uint32_t)0x00000008) /* Write protection of page 12 to 15 */ |
bogdanm | 85:024bf7f99721 | 130 | #define OB_WRP_PAGES16TO19 ((uint32_t)0x00000010) /* Write protection of page 16 to 19 */ |
bogdanm | 85:024bf7f99721 | 131 | #define OB_WRP_PAGES20TO23 ((uint32_t)0x00000020) /* Write protection of page 20 to 23 */ |
bogdanm | 85:024bf7f99721 | 132 | #define OB_WRP_PAGES24TO27 ((uint32_t)0x00000040) /* Write protection of page 24 to 27 */ |
bogdanm | 85:024bf7f99721 | 133 | #define OB_WRP_PAGES28TO31 ((uint32_t)0x00000080) /* Write protection of page 28 to 31 */ |
bogdanm | 85:024bf7f99721 | 134 | #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 135 | #define OB_WRP_PAGES32TO35 ((uint32_t)0x00000100) /* Write protection of page 32 to 35 */ |
bogdanm | 85:024bf7f99721 | 136 | #define OB_WRP_PAGES36TO39 ((uint32_t)0x00000200) /* Write protection of page 36 to 39 */ |
bogdanm | 85:024bf7f99721 | 137 | #define OB_WRP_PAGES40TO43 ((uint32_t)0x00000400) /* Write protection of page 40 to 43 */ |
bogdanm | 85:024bf7f99721 | 138 | #define OB_WRP_PAGES44TO47 ((uint32_t)0x00000800) /* Write protection of page 44 to 47 */ |
bogdanm | 85:024bf7f99721 | 139 | #define OB_WRP_PAGES48TO51 ((uint32_t)0x00001000) /* Write protection of page 48 to 51 */ |
bogdanm | 85:024bf7f99721 | 140 | #define OB_WRP_PAGES52TO57 ((uint32_t)0x00002000) /* Write protection of page 52 to 57 */ |
bogdanm | 85:024bf7f99721 | 141 | #define OB_WRP_PAGES56TO59 ((uint32_t)0x00004000) /* Write protection of page 56 to 59 */ |
bogdanm | 85:024bf7f99721 | 142 | #define OB_WRP_PAGES60TO63 ((uint32_t)0x00008000) /* Write protection of page 60 to 63 */ |
bogdanm | 85:024bf7f99721 | 143 | #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 144 | |
bogdanm | 85:024bf7f99721 | 145 | #define OB_WRP_PAGES0TO31MASK ((uint32_t)0x000000FF) |
bogdanm | 85:024bf7f99721 | 146 | #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 147 | #define OB_WRP_PAGES32TO63MASK ((uint32_t)0x0000FF00) |
bogdanm | 85:024bf7f99721 | 148 | #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 149 | |
bogdanm | 85:024bf7f99721 | 150 | #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F038xx) |
bogdanm | 85:024bf7f99721 | 151 | #define OB_WRP_ALLPAGES ((uint32_t)0x000000FF) /*!< Write protection of all pages */ |
bogdanm | 85:024bf7f99721 | 152 | #endif /* STM32F030x6 || STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F038xx */ |
bogdanm | 85:024bf7f99721 | 153 | |
bogdanm | 85:024bf7f99721 | 154 | #if defined(STM32F030x8) || defined(STM32F051x8) || defined(STM32F058xx) |
bogdanm | 85:024bf7f99721 | 155 | #define OB_WRP_ALLPAGES ((uint32_t)0x0000FFFF) /*!< Write protection of all pages */ |
bogdanm | 85:024bf7f99721 | 156 | #endif /* STM32F030x8 || STM32F051x8 || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 157 | #endif /* STM32F030x6 || STM32F030x8 || STM32F031x6 || STM32F051x8 || STM32F042x6 || STM32F048xx || STM32F038xx || STM32F058xx */ |
bogdanm | 85:024bf7f99721 | 158 | |
bogdanm | 85:024bf7f99721 | 159 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 160 | #define OB_WRP_PAGES0TO1 ((uint32_t)0x00000001) /* Write protection of page 0 to 1 */ |
bogdanm | 85:024bf7f99721 | 161 | #define OB_WRP_PAGES2TO3 ((uint32_t)0x00000002) /* Write protection of page 2 to 3 */ |
bogdanm | 85:024bf7f99721 | 162 | #define OB_WRP_PAGES4TO5 ((uint32_t)0x00000004) /* Write protection of page 4 to 5 */ |
bogdanm | 85:024bf7f99721 | 163 | #define OB_WRP_PAGES6TO7 ((uint32_t)0x00000008) /* Write protection of page 6 to 7 */ |
bogdanm | 85:024bf7f99721 | 164 | #define OB_WRP_PAGES8TO9 ((uint32_t)0x00000010) /* Write protection of page 8 to 9 */ |
bogdanm | 85:024bf7f99721 | 165 | #define OB_WRP_PAGES10TO11 ((uint32_t)0x00000020) /* Write protection of page 10 to 11 */ |
bogdanm | 85:024bf7f99721 | 166 | #define OB_WRP_PAGES12TO13 ((uint32_t)0x00000040) /* Write protection of page 12 to 13 */ |
bogdanm | 85:024bf7f99721 | 167 | #define OB_WRP_PAGES14TO15 ((uint32_t)0x00000080) /* Write protection of page 14 to 15 */ |
bogdanm | 85:024bf7f99721 | 168 | #define OB_WRP_PAGES16TO17 ((uint32_t)0x00000100) /* Write protection of page 16 to 17 */ |
bogdanm | 85:024bf7f99721 | 169 | #define OB_WRP_PAGES18TO19 ((uint32_t)0x00000200) /* Write protection of page 18 to 19 */ |
bogdanm | 85:024bf7f99721 | 170 | #define OB_WRP_PAGES20TO21 ((uint32_t)0x00000400) /* Write protection of page 20 to 21 */ |
bogdanm | 85:024bf7f99721 | 171 | #define OB_WRP_PAGES22TO23 ((uint32_t)0x00000800) /* Write protection of page 22 to 23 */ |
bogdanm | 85:024bf7f99721 | 172 | #define OB_WRP_PAGES24TO25 ((uint32_t)0x00001000) /* Write protection of page 24 to 25 */ |
bogdanm | 85:024bf7f99721 | 173 | #define OB_WRP_PAGES26TO27 ((uint32_t)0x00002000) /* Write protection of page 26 to 27 */ |
bogdanm | 85:024bf7f99721 | 174 | #define OB_WRP_PAGES28TO29 ((uint32_t)0x00004000) /* Write protection of page 28 to 29 */ |
bogdanm | 85:024bf7f99721 | 175 | #define OB_WRP_PAGES30TO31 ((uint32_t)0x00008000) /* Write protection of page 30 to 31 */ |
bogdanm | 85:024bf7f99721 | 176 | #define OB_WRP_PAGES32TO33 ((uint32_t)0x00010000) /* Write protection of page 32 to 33 */ |
bogdanm | 85:024bf7f99721 | 177 | #define OB_WRP_PAGES34TO35 ((uint32_t)0x00020000) /* Write protection of page 34 to 35 */ |
bogdanm | 85:024bf7f99721 | 178 | #define OB_WRP_PAGES36TO37 ((uint32_t)0x00040000) /* Write protection of page 36 to 37 */ |
bogdanm | 85:024bf7f99721 | 179 | #define OB_WRP_PAGES38TO39 ((uint32_t)0x00080000) /* Write protection of page 38 to 39 */ |
bogdanm | 85:024bf7f99721 | 180 | #define OB_WRP_PAGES40TO41 ((uint32_t)0x00100000) /* Write protection of page 40 to 41 */ |
bogdanm | 85:024bf7f99721 | 181 | #define OB_WRP_PAGES42TO43 ((uint32_t)0x00200000) /* Write protection of page 42 to 43 */ |
bogdanm | 85:024bf7f99721 | 182 | #define OB_WRP_PAGES44TO45 ((uint32_t)0x00400000) /* Write protection of page 44 to 45 */ |
bogdanm | 85:024bf7f99721 | 183 | #define OB_WRP_PAGES46TO47 ((uint32_t)0x00800000) /* Write protection of page 46 to 47 */ |
bogdanm | 85:024bf7f99721 | 184 | #define OB_WRP_PAGES48TO49 ((uint32_t)0x01000000) /* Write protection of page 48 to 49 */ |
bogdanm | 85:024bf7f99721 | 185 | #define OB_WRP_PAGES50TO51 ((uint32_t)0x02000000) /* Write protection of page 50 to 51 */ |
bogdanm | 85:024bf7f99721 | 186 | #define OB_WRP_PAGES52TO53 ((uint32_t)0x04000000) /* Write protection of page 52 to 53 */ |
bogdanm | 85:024bf7f99721 | 187 | #define OB_WRP_PAGES54TO55 ((uint32_t)0x08000000) /* Write protection of page 54 to 55 */ |
bogdanm | 85:024bf7f99721 | 188 | #define OB_WRP_PAGES56TO57 ((uint32_t)0x10000000) /* Write protection of page 56 to 57 */ |
bogdanm | 85:024bf7f99721 | 189 | #define OB_WRP_PAGES58TO59 ((uint32_t)0x20000000) /* Write protection of page 58 to 59 */ |
bogdanm | 85:024bf7f99721 | 190 | #define OB_WRP_PAGES60TO61 ((uint32_t)0x40000000) /* Write protection of page 60 to 61 */ |
bogdanm | 85:024bf7f99721 | 191 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 192 | #define OB_WRP_PAGES62TO63 ((uint32_t)0x80000000) /* Write protection of page 62 to 63 */ |
bogdanm | 85:024bf7f99721 | 193 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 194 | |
bogdanm | 85:024bf7f99721 | 195 | #define OB_WRP_PAGES0TO15MASK ((uint32_t)0x000000FF) |
bogdanm | 85:024bf7f99721 | 196 | #define OB_WRP_PAGES16TO31MASK ((uint32_t)0x0000FF00) |
bogdanm | 85:024bf7f99721 | 197 | #define OB_WRP_PAGES32TO47MASK ((uint32_t)0x00FF0000) |
bogdanm | 85:024bf7f99721 | 198 | #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
bogdanm | 85:024bf7f99721 | 199 | #define OB_WRP_PAGES48TO63MASK ((uint32_t)0xFF000000) |
bogdanm | 85:024bf7f99721 | 200 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 201 | |
bogdanm | 85:024bf7f99721 | 202 | #define OB_WRP_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all pages */ |
bogdanm | 85:024bf7f99721 | 203 | #endif /* STM32F071xB || STM32F072xB || STM32F078xx */ |
bogdanm | 85:024bf7f99721 | 204 | |
bogdanm | 85:024bf7f99721 | 205 | #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000)) |
bogdanm | 85:024bf7f99721 | 206 | /** |
bogdanm | 85:024bf7f99721 | 207 | * @} |
bogdanm | 85:024bf7f99721 | 208 | */ |
bogdanm | 85:024bf7f99721 | 209 | |
bogdanm | 85:024bf7f99721 | 210 | #if defined(STM32F042x6) || defined(STM32F048xx) |
bogdanm | 85:024bf7f99721 | 211 | /** @defgroup FLASHEx_OB_BOOT_SEL |
bogdanm | 85:024bf7f99721 | 212 | * @{ |
bogdanm | 85:024bf7f99721 | 213 | */ |
bogdanm | 85:024bf7f99721 | 214 | #define OB_BOOT_SEL_RESET ((uint8_t)0x00) /*!< BOOT_SEL Reset */ |
bogdanm | 85:024bf7f99721 | 215 | #define OB_BOOT_SEL_SET ((uint8_t)0x80) /*!< BOOT_SEL Set */ |
bogdanm | 85:024bf7f99721 | 216 | #define IS_OB_BOOT_SEL(BOOT_SEL) (((BOOT_SEL) == OB_BOOT_SEL_RESET) || ((BOOT_SEL) == OB_BOOT_SEL_SET)) |
bogdanm | 85:024bf7f99721 | 217 | /** |
bogdanm | 85:024bf7f99721 | 218 | * @} |
bogdanm | 85:024bf7f99721 | 219 | */ |
bogdanm | 85:024bf7f99721 | 220 | |
bogdanm | 85:024bf7f99721 | 221 | /** @defgroup FLASHEx_OB_BOOT0 |
bogdanm | 85:024bf7f99721 | 222 | * @{ |
bogdanm | 85:024bf7f99721 | 223 | */ |
bogdanm | 85:024bf7f99721 | 224 | #define OB_BOOT0_RESET ((uint8_t)0x00) /*!< BOOT0 Reset */ |
bogdanm | 85:024bf7f99721 | 225 | #define OB_BOOT0_SET ((uint8_t)0x08) /*!< BOOT0 Set */ |
bogdanm | 85:024bf7f99721 | 226 | #define IS_OB_BOOT0(BOOT0) (((BOOT0) == OB_BOOT0_RESET) || ((BOOT0) == OB_BOOT0_SET)) |
bogdanm | 85:024bf7f99721 | 227 | /** |
bogdanm | 85:024bf7f99721 | 228 | * @} |
bogdanm | 85:024bf7f99721 | 229 | */ |
bogdanm | 85:024bf7f99721 | 230 | #endif /* STM32F042x6 || STM32F048xx */ |
bogdanm | 85:024bf7f99721 | 231 | |
bogdanm | 85:024bf7f99721 | 232 | /** |
bogdanm | 85:024bf7f99721 | 233 | * @} |
bogdanm | 85:024bf7f99721 | 234 | */ |
bogdanm | 85:024bf7f99721 | 235 | |
bogdanm | 85:024bf7f99721 | 236 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 237 | |
bogdanm | 85:024bf7f99721 | 238 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 239 | |
bogdanm | 85:024bf7f99721 | 240 | /* IO operation functions *****************************************************/ |
bogdanm | 85:024bf7f99721 | 241 | HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); |
bogdanm | 85:024bf7f99721 | 242 | HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); |
bogdanm | 85:024bf7f99721 | 243 | |
bogdanm | 85:024bf7f99721 | 244 | /* Peripheral Control functions ***********************************************/ |
bogdanm | 85:024bf7f99721 | 245 | HAL_StatusTypeDef HAL_FLASHEx_OBErase(void); |
bogdanm | 85:024bf7f99721 | 246 | HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 85:024bf7f99721 | 247 | void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 85:024bf7f99721 | 248 | |
bogdanm | 85:024bf7f99721 | 249 | /** |
bogdanm | 85:024bf7f99721 | 250 | * @} |
bogdanm | 85:024bf7f99721 | 251 | */ |
bogdanm | 85:024bf7f99721 | 252 | |
bogdanm | 85:024bf7f99721 | 253 | /** |
bogdanm | 85:024bf7f99721 | 254 | * @} |
bogdanm | 85:024bf7f99721 | 255 | */ |
bogdanm | 85:024bf7f99721 | 256 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 257 | } |
bogdanm | 85:024bf7f99721 | 258 | #endif |
bogdanm | 85:024bf7f99721 | 259 | |
bogdanm | 85:024bf7f99721 | 260 | #endif /* __STM32F0xx_HAL_FLASH_EX_H */ |
bogdanm | 85:024bf7f99721 | 261 | |
bogdanm | 85:024bf7f99721 | 262 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |