my fork
Fork of mbed by
TARGET_NUCLEO_F334R8/stm32f3xx_hal_flash_ex.h@97:4298809c7c9e, 2015-04-08 (annotated)
- Committer:
- filartrix
- Date:
- Wed Apr 08 14:12:53 2015 +0000
- Revision:
- 97:4298809c7c9e
- Parent:
- 92:4fc01daae5a5
First reale BlueNRG module for nucleo 401 board
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 86:04dd9b1680ae | 1 | /** |
bogdanm | 86:04dd9b1680ae | 2 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 3 | * @file stm32f3xx_hal_flash_ex.h |
bogdanm | 86:04dd9b1680ae | 4 | * @author MCD Application Team |
bogdanm | 92:4fc01daae5a5 | 5 | * @version V1.1.0 |
bogdanm | 92:4fc01daae5a5 | 6 | * @date 12-Sept-2014 |
bogdanm | 92:4fc01daae5a5 | 7 | * @brief Header file of Flash HAL Extended module. |
bogdanm | 86:04dd9b1680ae | 8 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 9 | * @attention |
bogdanm | 86:04dd9b1680ae | 10 | * |
bogdanm | 86:04dd9b1680ae | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
bogdanm | 86:04dd9b1680ae | 12 | * |
bogdanm | 86:04dd9b1680ae | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 86:04dd9b1680ae | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 86:04dd9b1680ae | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 86:04dd9b1680ae | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 86:04dd9b1680ae | 19 | * and/or other materials provided with the distribution. |
bogdanm | 86:04dd9b1680ae | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 86:04dd9b1680ae | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 86:04dd9b1680ae | 22 | * without specific prior written permission. |
bogdanm | 86:04dd9b1680ae | 23 | * |
bogdanm | 86:04dd9b1680ae | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 86:04dd9b1680ae | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 86:04dd9b1680ae | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 86:04dd9b1680ae | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 86:04dd9b1680ae | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 86:04dd9b1680ae | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 86:04dd9b1680ae | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 86:04dd9b1680ae | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 86:04dd9b1680ae | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 86:04dd9b1680ae | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 86:04dd9b1680ae | 34 | * |
bogdanm | 86:04dd9b1680ae | 35 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 36 | */ |
bogdanm | 86:04dd9b1680ae | 37 | |
bogdanm | 86:04dd9b1680ae | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 39 | #ifndef __STM32F3xx_HAL_FLASH_EX_H |
bogdanm | 86:04dd9b1680ae | 40 | #define __STM32F3xx_HAL_FLASH_EX_H |
bogdanm | 86:04dd9b1680ae | 41 | |
bogdanm | 86:04dd9b1680ae | 42 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 43 | extern "C" { |
bogdanm | 86:04dd9b1680ae | 44 | #endif |
bogdanm | 86:04dd9b1680ae | 45 | |
bogdanm | 86:04dd9b1680ae | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 47 | #include "stm32f3xx_hal_def.h" |
bogdanm | 86:04dd9b1680ae | 48 | |
bogdanm | 86:04dd9b1680ae | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
bogdanm | 86:04dd9b1680ae | 50 | * @{ |
bogdanm | 86:04dd9b1680ae | 51 | */ |
bogdanm | 86:04dd9b1680ae | 52 | |
bogdanm | 92:4fc01daae5a5 | 53 | /** @addtogroup FLASHEx FLASH Extended HAL module driver |
bogdanm | 86:04dd9b1680ae | 54 | * @{ |
bogdanm | 86:04dd9b1680ae | 55 | */ |
bogdanm | 86:04dd9b1680ae | 56 | |
bogdanm | 86:04dd9b1680ae | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 58 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 59 | /** @defgroup FLASHEx_Exported_Constants FLASH Extended Exported Constants |
bogdanm | 86:04dd9b1680ae | 60 | * @{ |
bogdanm | 86:04dd9b1680ae | 61 | */ |
bogdanm | 86:04dd9b1680ae | 62 | #define FLASH_SIZE_DATA_REGISTER ((uint32_t)0x1FFFF7CC) |
bogdanm | 86:04dd9b1680ae | 63 | #define FLASH_PAGE_SIZE 0x800 |
bogdanm | 86:04dd9b1680ae | 64 | /** |
bogdanm | 86:04dd9b1680ae | 65 | * @} |
bogdanm | 86:04dd9b1680ae | 66 | */ |
bogdanm | 86:04dd9b1680ae | 67 | |
bogdanm | 92:4fc01daae5a5 | 68 | /** @defgroup FLASHEx_Address FLASH Extended Address |
bogdanm | 86:04dd9b1680ae | 69 | * @{ |
bogdanm | 86:04dd9b1680ae | 70 | */ |
bogdanm | 86:04dd9b1680ae | 71 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 86:04dd9b1680ae | 72 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 73 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100) ? \ |
bogdanm | 86:04dd9b1680ae | 74 | ((ADDRESS) <= 0x0803FFFF) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80) ? \ |
bogdanm | 86:04dd9b1680ae | 75 | ((ADDRESS) <= 0x0801FFFF) : ((ADDRESS) <= 0x0800FFFF)))) |
bogdanm | 86:04dd9b1680ae | 76 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 86:04dd9b1680ae | 77 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 78 | |
bogdanm | 92:4fc01daae5a5 | 79 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) |
bogdanm | 92:4fc01daae5a5 | 80 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0807FFFF)) |
bogdanm | 92:4fc01daae5a5 | 81 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx */ |
bogdanm | 92:4fc01daae5a5 | 82 | |
bogdanm | 86:04dd9b1680ae | 83 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
bogdanm | 86:04dd9b1680ae | 84 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
bogdanm | 86:04dd9b1680ae | 85 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40) ? \ |
bogdanm | 86:04dd9b1680ae | 86 | ((ADDRESS) <= 0x0800FFFF) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20) ? \ |
bogdanm | 86:04dd9b1680ae | 87 | ((ADDRESS) <= 0x08007FFF) : ((ADDRESS) <= 0x08003FFF)))) |
bogdanm | 86:04dd9b1680ae | 88 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
bogdanm | 86:04dd9b1680ae | 89 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
bogdanm | 86:04dd9b1680ae | 90 | /** |
bogdanm | 86:04dd9b1680ae | 91 | * @} |
bogdanm | 86:04dd9b1680ae | 92 | */ |
bogdanm | 86:04dd9b1680ae | 93 | |
bogdanm | 92:4fc01daae5a5 | 94 | /** @defgroup FLASHEx_Nb_Pages FLASH Extended Nb Pages |
bogdanm | 86:04dd9b1680ae | 95 | * @{ |
bogdanm | 86:04dd9b1680ae | 96 | */ |
bogdanm | 86:04dd9b1680ae | 97 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 86:04dd9b1680ae | 98 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 99 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0803FFFF) : \ |
bogdanm | 86:04dd9b1680ae | 100 | (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0801FFFF) : \ |
bogdanm | 86:04dd9b1680ae | 101 | ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0800FFFF))) |
bogdanm | 86:04dd9b1680ae | 102 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 86:04dd9b1680ae | 103 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 104 | |
bogdanm | 92:4fc01daae5a5 | 105 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) |
bogdanm | 92:4fc01daae5a5 | 106 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0807FFFF) |
bogdanm | 92:4fc01daae5a5 | 107 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx */ |
bogdanm | 92:4fc01daae5a5 | 108 | |
bogdanm | 86:04dd9b1680ae | 109 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
bogdanm | 86:04dd9b1680ae | 110 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
bogdanm | 86:04dd9b1680ae | 111 | #define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x0800FFFF) : \ |
bogdanm | 86:04dd9b1680ae | 112 | (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x08007FFF) : \ |
bogdanm | 86:04dd9b1680ae | 113 | ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1 <= 0x08003FFF))) |
bogdanm | 86:04dd9b1680ae | 114 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
bogdanm | 86:04dd9b1680ae | 115 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
bogdanm | 86:04dd9b1680ae | 116 | /** |
bogdanm | 86:04dd9b1680ae | 117 | * @} |
bogdanm | 86:04dd9b1680ae | 118 | */ |
bogdanm | 86:04dd9b1680ae | 119 | |
bogdanm | 92:4fc01daae5a5 | 120 | /** @defgroup FLASHEx_OB_Write_Protection FLASH Extended Option Bytes Write Protection |
bogdanm | 86:04dd9b1680ae | 121 | * @{ |
bogdanm | 86:04dd9b1680ae | 122 | */ |
bogdanm | 86:04dd9b1680ae | 123 | #define OB_WRP_PAGES0TO1 ((uint32_t)0x00000001) /* Write protection of page 0 to 1 */ |
bogdanm | 86:04dd9b1680ae | 124 | #define OB_WRP_PAGES2TO3 ((uint32_t)0x00000002) /* Write protection of page 2 to 3 */ |
bogdanm | 86:04dd9b1680ae | 125 | #define OB_WRP_PAGES4TO5 ((uint32_t)0x00000004) /* Write protection of page 4 to 5 */ |
bogdanm | 86:04dd9b1680ae | 126 | #define OB_WRP_PAGES6TO7 ((uint32_t)0x00000008) /* Write protection of page 6 to 7 */ |
bogdanm | 86:04dd9b1680ae | 127 | #define OB_WRP_PAGES8TO9 ((uint32_t)0x00000010) /* Write protection of page 8 to 9 */ |
bogdanm | 86:04dd9b1680ae | 128 | #define OB_WRP_PAGES10TO11 ((uint32_t)0x00000020) /* Write protection of page 10 to 11 */ |
bogdanm | 86:04dd9b1680ae | 129 | #define OB_WRP_PAGES12TO13 ((uint32_t)0x00000040) /* Write protection of page 12 to 13 */ |
bogdanm | 86:04dd9b1680ae | 130 | #define OB_WRP_PAGES14TO15 ((uint32_t)0x00000080) /* Write protection of page 14 to 15 */ |
bogdanm | 86:04dd9b1680ae | 131 | #define OB_WRP_PAGES16TO17 ((uint32_t)0x00000100) /* Write protection of page 16 to 17 */ |
bogdanm | 86:04dd9b1680ae | 132 | #define OB_WRP_PAGES18TO19 ((uint32_t)0x00000200) /* Write protection of page 18 to 19 */ |
bogdanm | 86:04dd9b1680ae | 133 | #define OB_WRP_PAGES20TO21 ((uint32_t)0x00000400) /* Write protection of page 20 to 21 */ |
bogdanm | 86:04dd9b1680ae | 134 | #define OB_WRP_PAGES22TO23 ((uint32_t)0x00000800) /* Write protection of page 22 to 23 */ |
bogdanm | 86:04dd9b1680ae | 135 | #define OB_WRP_PAGES24TO25 ((uint32_t)0x00001000) /* Write protection of page 24 to 25 */ |
bogdanm | 86:04dd9b1680ae | 136 | #define OB_WRP_PAGES26TO27 ((uint32_t)0x00002000) /* Write protection of page 26 to 27 */ |
bogdanm | 86:04dd9b1680ae | 137 | #define OB_WRP_PAGES28TO29 ((uint32_t)0x00004000) /* Write protection of page 28 to 29 */ |
bogdanm | 86:04dd9b1680ae | 138 | #define OB_WRP_PAGES30TO31 ((uint32_t)0x00008000) /* Write protection of page 30 to 31 */ |
bogdanm | 92:4fc01daae5a5 | 139 | |
bogdanm | 92:4fc01daae5a5 | 140 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 92:4fc01daae5a5 | 141 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 142 | #define OB_WRP_PAGES32TO33 ((uint32_t)0x00010000) /* Write protection of page 32 to 33 */ |
bogdanm | 86:04dd9b1680ae | 143 | #define OB_WRP_PAGES34TO35 ((uint32_t)0x00020000) /* Write protection of page 34 to 35 */ |
bogdanm | 86:04dd9b1680ae | 144 | #define OB_WRP_PAGES36TO37 ((uint32_t)0x00040000) /* Write protection of page 36 to 37 */ |
bogdanm | 86:04dd9b1680ae | 145 | #define OB_WRP_PAGES38TO39 ((uint32_t)0x00080000) /* Write protection of page 38 to 39 */ |
bogdanm | 86:04dd9b1680ae | 146 | #define OB_WRP_PAGES40TO41 ((uint32_t)0x00100000) /* Write protection of page 40 to 41 */ |
bogdanm | 86:04dd9b1680ae | 147 | #define OB_WRP_PAGES42TO43 ((uint32_t)0x00200000) /* Write protection of page 42 to 43 */ |
bogdanm | 86:04dd9b1680ae | 148 | #define OB_WRP_PAGES44TO45 ((uint32_t)0x00400000) /* Write protection of page 44 to 45 */ |
bogdanm | 86:04dd9b1680ae | 149 | #define OB_WRP_PAGES46TO47 ((uint32_t)0x00800000) /* Write protection of page 46 to 47 */ |
bogdanm | 86:04dd9b1680ae | 150 | #define OB_WRP_PAGES48TO49 ((uint32_t)0x01000000) /* Write protection of page 48 to 49 */ |
bogdanm | 86:04dd9b1680ae | 151 | #define OB_WRP_PAGES50TO51 ((uint32_t)0x02000000) /* Write protection of page 50 to 51 */ |
bogdanm | 86:04dd9b1680ae | 152 | #define OB_WRP_PAGES52TO53 ((uint32_t)0x04000000) /* Write protection of page 52 to 53 */ |
bogdanm | 86:04dd9b1680ae | 153 | #define OB_WRP_PAGES54TO55 ((uint32_t)0x08000000) /* Write protection of page 54 to 55 */ |
bogdanm | 86:04dd9b1680ae | 154 | #define OB_WRP_PAGES56TO57 ((uint32_t)0x10000000) /* Write protection of page 56 to 57 */ |
bogdanm | 86:04dd9b1680ae | 155 | #define OB_WRP_PAGES58TO59 ((uint32_t)0x20000000) /* Write protection of page 58 to 59 */ |
bogdanm | 86:04dd9b1680ae | 156 | #define OB_WRP_PAGES60TO61 ((uint32_t)0x40000000) /* Write protection of page 60 to 61 */ |
bogdanm | 86:04dd9b1680ae | 157 | #define OB_WRP_PAGES62TO127 ((uint32_t)0x80000000) /* Write protection of page 62 to 127 */ |
bogdanm | 92:4fc01daae5a5 | 158 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 92:4fc01daae5a5 | 159 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 92:4fc01daae5a5 | 160 | |
bogdanm | 92:4fc01daae5a5 | 161 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) |
bogdanm | 92:4fc01daae5a5 | 162 | #define OB_WRP_PAGES32TO33 ((uint32_t)0x00010000) /* Write protection of page 32 to 33 */ |
bogdanm | 92:4fc01daae5a5 | 163 | #define OB_WRP_PAGES34TO35 ((uint32_t)0x00020000) /* Write protection of page 34 to 35 */ |
bogdanm | 92:4fc01daae5a5 | 164 | #define OB_WRP_PAGES36TO37 ((uint32_t)0x00040000) /* Write protection of page 36 to 37 */ |
bogdanm | 92:4fc01daae5a5 | 165 | #define OB_WRP_PAGES38TO39 ((uint32_t)0x00080000) /* Write protection of page 38 to 39 */ |
bogdanm | 92:4fc01daae5a5 | 166 | #define OB_WRP_PAGES40TO41 ((uint32_t)0x00100000) /* Write protection of page 40 to 41 */ |
bogdanm | 92:4fc01daae5a5 | 167 | #define OB_WRP_PAGES42TO43 ((uint32_t)0x00200000) /* Write protection of page 42 to 43 */ |
bogdanm | 92:4fc01daae5a5 | 168 | #define OB_WRP_PAGES44TO45 ((uint32_t)0x00400000) /* Write protection of page 44 to 45 */ |
bogdanm | 92:4fc01daae5a5 | 169 | #define OB_WRP_PAGES46TO47 ((uint32_t)0x00800000) /* Write protection of page 46 to 47 */ |
bogdanm | 92:4fc01daae5a5 | 170 | #define OB_WRP_PAGES48TO49 ((uint32_t)0x01000000) /* Write protection of page 48 to 49 */ |
bogdanm | 92:4fc01daae5a5 | 171 | #define OB_WRP_PAGES50TO51 ((uint32_t)0x02000000) /* Write protection of page 50 to 51 */ |
bogdanm | 92:4fc01daae5a5 | 172 | #define OB_WRP_PAGES52TO53 ((uint32_t)0x04000000) /* Write protection of page 52 to 53 */ |
bogdanm | 92:4fc01daae5a5 | 173 | #define OB_WRP_PAGES54TO55 ((uint32_t)0x08000000) /* Write protection of page 54 to 55 */ |
bogdanm | 92:4fc01daae5a5 | 174 | #define OB_WRP_PAGES56TO57 ((uint32_t)0x10000000) /* Write protection of page 56 to 57 */ |
bogdanm | 92:4fc01daae5a5 | 175 | #define OB_WRP_PAGES58TO59 ((uint32_t)0x20000000) /* Write protection of page 58 to 59 */ |
bogdanm | 92:4fc01daae5a5 | 176 | #define OB_WRP_PAGES60TO61 ((uint32_t)0x40000000) /* Write protection of page 60 to 61 */ |
bogdanm | 92:4fc01daae5a5 | 177 | #define OB_WRP_PAGES62TO255 ((uint32_t)0x80000000) /* Write protection of page 62 to 255 */ |
bogdanm | 92:4fc01daae5a5 | 178 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx */ |
bogdanm | 86:04dd9b1680ae | 179 | |
bogdanm | 86:04dd9b1680ae | 180 | #define OB_WRP_PAGES0TO15MASK ((uint32_t)0x000000FF) |
bogdanm | 86:04dd9b1680ae | 181 | #define OB_WRP_PAGES16TO31MASK ((uint32_t)0x0000FF00) |
bogdanm | 92:4fc01daae5a5 | 182 | |
bogdanm | 92:4fc01daae5a5 | 183 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 92:4fc01daae5a5 | 184 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 185 | #define OB_WRP_PAGES32TO47MASK ((uint32_t)0x00FF0000) |
bogdanm | 86:04dd9b1680ae | 186 | #define OB_WRP_PAGES48TO127MASK ((uint32_t)0xFF000000) |
bogdanm | 92:4fc01daae5a5 | 187 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 92:4fc01daae5a5 | 188 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 189 | |
bogdanm | 92:4fc01daae5a5 | 190 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) |
bogdanm | 92:4fc01daae5a5 | 191 | #define OB_WRP_PAGES32TO47MASK ((uint32_t)0x00FF0000) |
bogdanm | 92:4fc01daae5a5 | 192 | #define OB_WRP_PAGES48TO255MASK ((uint32_t)0xFF000000) |
bogdanm | 92:4fc01daae5a5 | 193 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx */ |
bogdanm | 92:4fc01daae5a5 | 194 | |
bogdanm | 92:4fc01daae5a5 | 195 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 92:4fc01daae5a5 | 196 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 197 | #define OB_WRP_PAGES32TO47MASK ((uint32_t)0x00FF0000) |
bogdanm | 86:04dd9b1680ae | 198 | #define OB_WRP_PAGES48TO127MASK ((uint32_t)0xFF000000) |
bogdanm | 92:4fc01daae5a5 | 199 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 92:4fc01daae5a5 | 200 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 201 | |
bogdanm | 92:4fc01daae5a5 | 202 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ |
bogdanm | 92:4fc01daae5a5 | 203 | defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
bogdanm | 92:4fc01daae5a5 | 204 | defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 86:04dd9b1680ae | 205 | #define OB_WRP_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all pages */ |
bogdanm | 92:4fc01daae5a5 | 206 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ |
bogdanm | 92:4fc01daae5a5 | 207 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
bogdanm | 92:4fc01daae5a5 | 208 | /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 209 | |
bogdanm | 86:04dd9b1680ae | 210 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
bogdanm | 86:04dd9b1680ae | 211 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
bogdanm | 86:04dd9b1680ae | 212 | #define OB_WRP_ALLPAGES ((uint32_t)0x0000FFFF) /*!< Write protection of all pages */ |
bogdanm | 86:04dd9b1680ae | 213 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
bogdanm | 92:4fc01daae5a5 | 214 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
bogdanm | 86:04dd9b1680ae | 215 | |
bogdanm | 86:04dd9b1680ae | 216 | #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000)) |
bogdanm | 86:04dd9b1680ae | 217 | /** |
bogdanm | 86:04dd9b1680ae | 218 | * @} |
bogdanm | 86:04dd9b1680ae | 219 | */ |
bogdanm | 86:04dd9b1680ae | 220 | |
bogdanm | 86:04dd9b1680ae | 221 | #if defined(STM32F373xC) || defined(STM32F378xx) |
bogdanm | 92:4fc01daae5a5 | 222 | /** @defgroup FLASHEx_OB_SDADC12_VDD_MONITOR FLASH Extended Option Bytes SDADC12 VDD MONITOR |
bogdanm | 86:04dd9b1680ae | 223 | * @{ |
bogdanm | 86:04dd9b1680ae | 224 | */ |
bogdanm | 86:04dd9b1680ae | 225 | #define OB_SDACD_VDD_MONITOR_RESET ((uint8_t)0x00) /*!< SDADC VDD Monitor reset */ |
bogdanm | 86:04dd9b1680ae | 226 | #define OB_SDACD_VDD_MONITOR_SET ((uint8_t)0x80) /*!< SDADC VDD Monitor set */ |
bogdanm | 86:04dd9b1680ae | 227 | |
bogdanm | 86:04dd9b1680ae | 228 | #define IS_OB_SDACD_VDD_MONITOR(VDD_MONITOR) (((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_SET) || \ |
bogdanm | 86:04dd9b1680ae | 229 | ((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_RESET)) |
bogdanm | 86:04dd9b1680ae | 230 | /** |
bogdanm | 86:04dd9b1680ae | 231 | * @} |
bogdanm | 86:04dd9b1680ae | 232 | */ |
bogdanm | 86:04dd9b1680ae | 233 | #endif /* STM32F373xC || STM32F378xx */ |
bogdanm | 86:04dd9b1680ae | 234 | |
bogdanm | 86:04dd9b1680ae | 235 | |
bogdanm | 86:04dd9b1680ae | 236 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 237 | |
bogdanm | 86:04dd9b1680ae | 238 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 239 | /** @addtogroup FLASHEx_Exported_Functions FLASH Extended Exported Functions |
bogdanm | 92:4fc01daae5a5 | 240 | * @{ |
bogdanm | 92:4fc01daae5a5 | 241 | */ |
bogdanm | 92:4fc01daae5a5 | 242 | |
bogdanm | 92:4fc01daae5a5 | 243 | /** @addtogroup FLASHEx_Exported_Functions_Group1 Extended Input and Output operation functions |
bogdanm | 92:4fc01daae5a5 | 244 | * @{ |
bogdanm | 92:4fc01daae5a5 | 245 | */ |
bogdanm | 86:04dd9b1680ae | 246 | /* IO operation functions *****************************************************/ |
bogdanm | 86:04dd9b1680ae | 247 | HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); |
bogdanm | 86:04dd9b1680ae | 248 | HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); |
bogdanm | 86:04dd9b1680ae | 249 | |
bogdanm | 92:4fc01daae5a5 | 250 | /** |
bogdanm | 92:4fc01daae5a5 | 251 | * @} |
bogdanm | 92:4fc01daae5a5 | 252 | */ |
bogdanm | 92:4fc01daae5a5 | 253 | |
bogdanm | 92:4fc01daae5a5 | 254 | /** @addtogroup FLASHEx_Exported_Functions_Group2 Extended Peripheral Control functions |
bogdanm | 92:4fc01daae5a5 | 255 | * @{ |
bogdanm | 92:4fc01daae5a5 | 256 | */ |
bogdanm | 86:04dd9b1680ae | 257 | /* Peripheral Control functions ***********************************************/ |
bogdanm | 86:04dd9b1680ae | 258 | HAL_StatusTypeDef HAL_FLASHEx_OBErase(void); |
bogdanm | 86:04dd9b1680ae | 259 | HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 86:04dd9b1680ae | 260 | void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 86:04dd9b1680ae | 261 | |
bogdanm | 86:04dd9b1680ae | 262 | /** |
bogdanm | 86:04dd9b1680ae | 263 | * @} |
bogdanm | 86:04dd9b1680ae | 264 | */ |
bogdanm | 86:04dd9b1680ae | 265 | |
bogdanm | 86:04dd9b1680ae | 266 | /** |
bogdanm | 86:04dd9b1680ae | 267 | * @} |
bogdanm | 86:04dd9b1680ae | 268 | */ |
bogdanm | 92:4fc01daae5a5 | 269 | |
bogdanm | 92:4fc01daae5a5 | 270 | /** |
bogdanm | 92:4fc01daae5a5 | 271 | * @} |
bogdanm | 92:4fc01daae5a5 | 272 | */ |
bogdanm | 92:4fc01daae5a5 | 273 | |
bogdanm | 92:4fc01daae5a5 | 274 | /** |
bogdanm | 92:4fc01daae5a5 | 275 | * @} |
bogdanm | 92:4fc01daae5a5 | 276 | */ |
bogdanm | 86:04dd9b1680ae | 277 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 278 | } |
bogdanm | 86:04dd9b1680ae | 279 | #endif |
bogdanm | 86:04dd9b1680ae | 280 | |
bogdanm | 86:04dd9b1680ae | 281 | #endif /* __STM32F3xx_HAL_FLASH_EX_H */ |
bogdanm | 86:04dd9b1680ae | 282 | |
bogdanm | 86:04dd9b1680ae | 283 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |