meh
Fork of mbed by
TARGET_NUCLEO_L053R8/stm32l0xx_hal_flash_ex.h@92:4fc01daae5a5, 2014-11-27 (annotated)
- Committer:
- bogdanm
- Date:
- Thu Nov 27 13:33:22 2014 +0000
- Revision:
- 92:4fc01daae5a5
- Parent:
- 84:0b3ab51c8877
- Child:
- 96:487b796308b0
Release 92 of the mbed libray
Main changes:
- nRF51822: fixed pin assignment issues
- ST targets moving to the STM32Cube driver
- LPC1439: fixed serial interrupt issue
- first Cortex-A platform supported in mbed (RZ_A1H)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 84:0b3ab51c8877 | 1 | /** |
bogdanm | 84:0b3ab51c8877 | 2 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 3 | * @file stm32l0xx_hal_flash_ex.h |
bogdanm | 84:0b3ab51c8877 | 4 | * @author MCD Application Team |
bogdanm | 92:4fc01daae5a5 | 5 | * @version V1.1.0 |
bogdanm | 92:4fc01daae5a5 | 6 | * @date 18-June-2014 |
bogdanm | 84:0b3ab51c8877 | 7 | * @brief Header file of FLASH HAL Extension module. |
bogdanm | 84:0b3ab51c8877 | 8 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 9 | * @attention |
bogdanm | 84:0b3ab51c8877 | 10 | * |
bogdanm | 84:0b3ab51c8877 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
bogdanm | 84:0b3ab51c8877 | 12 | * |
bogdanm | 84:0b3ab51c8877 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 84:0b3ab51c8877 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 84:0b3ab51c8877 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 84:0b3ab51c8877 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 84:0b3ab51c8877 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 84:0b3ab51c8877 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 84:0b3ab51c8877 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 84:0b3ab51c8877 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 84:0b3ab51c8877 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 84:0b3ab51c8877 | 22 | * without specific prior written permission. |
bogdanm | 84:0b3ab51c8877 | 23 | * |
bogdanm | 84:0b3ab51c8877 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 84:0b3ab51c8877 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 84:0b3ab51c8877 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 84:0b3ab51c8877 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 84:0b3ab51c8877 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 84:0b3ab51c8877 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 84:0b3ab51c8877 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 84:0b3ab51c8877 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 84:0b3ab51c8877 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 84:0b3ab51c8877 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 84:0b3ab51c8877 | 34 | * |
bogdanm | 84:0b3ab51c8877 | 35 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 36 | */ |
bogdanm | 84:0b3ab51c8877 | 37 | |
bogdanm | 84:0b3ab51c8877 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 39 | #ifndef __STM32L0xx_HAL_FLASH_EX_H |
bogdanm | 84:0b3ab51c8877 | 40 | #define __STM32L0xx_HAL_FLASH_EX_H |
bogdanm | 84:0b3ab51c8877 | 41 | |
bogdanm | 84:0b3ab51c8877 | 42 | #ifdef __cplusplus |
bogdanm | 84:0b3ab51c8877 | 43 | extern "C" { |
bogdanm | 84:0b3ab51c8877 | 44 | #endif |
bogdanm | 84:0b3ab51c8877 | 45 | |
bogdanm | 84:0b3ab51c8877 | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 47 | #include "stm32l0xx_hal_def.h" |
bogdanm | 84:0b3ab51c8877 | 48 | |
bogdanm | 84:0b3ab51c8877 | 49 | /** @addtogroup STM32L0xx_HAL_Driver |
bogdanm | 84:0b3ab51c8877 | 50 | * @{ |
bogdanm | 84:0b3ab51c8877 | 51 | */ |
bogdanm | 84:0b3ab51c8877 | 52 | |
bogdanm | 84:0b3ab51c8877 | 53 | /** @addtogroup FLASHEx |
bogdanm | 84:0b3ab51c8877 | 54 | * @{ |
bogdanm | 84:0b3ab51c8877 | 55 | */ |
bogdanm | 84:0b3ab51c8877 | 56 | |
bogdanm | 84:0b3ab51c8877 | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 58 | /** |
bogdanm | 84:0b3ab51c8877 | 59 | * @brief FLASH Advanced Option Bytes Program structure definition |
bogdanm | 84:0b3ab51c8877 | 60 | */ |
bogdanm | 84:0b3ab51c8877 | 61 | typedef struct |
bogdanm | 84:0b3ab51c8877 | 62 | { |
bogdanm | 84:0b3ab51c8877 | 63 | uint32_t OptionType; /*!< OptionType: Option byte to be configured for extension . |
bogdanm | 92:4fc01daae5a5 | 64 | This parameter can be a value of @ref FLASHEx_Option_Type */ |
bogdanm | 84:0b3ab51c8877 | 65 | |
bogdanm | 84:0b3ab51c8877 | 66 | uint32_t PCROPState; /*!< PCROPState: PCROP activation or deactivation. |
bogdanm | 84:0b3ab51c8877 | 67 | This parameter can be a value of @ref FLASHEx_PCROP_State */ |
bogdanm | 84:0b3ab51c8877 | 68 | |
bogdanm | 84:0b3ab51c8877 | 69 | uint16_t Pages; /*!< Sectors: specifies the sector(s) set for PCROP |
bogdanm | 84:0b3ab51c8877 | 70 | This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */ |
bogdanm | 84:0b3ab51c8877 | 71 | |
bogdanm | 84:0b3ab51c8877 | 72 | uint16_t BootConfig; /*!< BootConfig: specifies Option bytes for boot config |
bogdanm | 92:4fc01daae5a5 | 73 | This parameter can be a value of @ref FLASHEx_Option_Bytes_BOOT1 */ |
bogdanm | 84:0b3ab51c8877 | 74 | } FLASH_AdvOBProgramInitTypeDef; |
bogdanm | 84:0b3ab51c8877 | 75 | |
bogdanm | 84:0b3ab51c8877 | 76 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 77 | |
bogdanm | 92:4fc01daae5a5 | 78 | /** @defgroup FLASHEx_Exported_Constants |
bogdanm | 84:0b3ab51c8877 | 79 | * @{ |
bogdanm | 84:0b3ab51c8877 | 80 | */ |
bogdanm | 92:4fc01daae5a5 | 81 | /** @defgroup FLASHEx_PCROP_State |
bogdanm | 84:0b3ab51c8877 | 82 | * @{ |
bogdanm | 84:0b3ab51c8877 | 83 | */ |
bogdanm | 84:0b3ab51c8877 | 84 | #define PCROPSTATE_DISABLE ((uint32_t)0x00) /*!<Disable PCROP */ |
bogdanm | 84:0b3ab51c8877 | 85 | #define PCROPSTATE_ENABLE ((uint32_t)0x01) /*!<Enable PCROP */ |
bogdanm | 84:0b3ab51c8877 | 86 | |
bogdanm | 84:0b3ab51c8877 | 87 | #define IS_PCROPSTATE(VALUE)(((VALUE) == PCROPSTATE_DISABLE) || \ |
bogdanm | 84:0b3ab51c8877 | 88 | ((VALUE) == PCROPSTATE_ENABLE)) |
bogdanm | 84:0b3ab51c8877 | 89 | |
bogdanm | 84:0b3ab51c8877 | 90 | /** |
bogdanm | 84:0b3ab51c8877 | 91 | * @} |
bogdanm | 84:0b3ab51c8877 | 92 | */ |
bogdanm | 84:0b3ab51c8877 | 93 | |
bogdanm | 92:4fc01daae5a5 | 94 | /** @defgroup FLASHEx_Option_Type |
bogdanm | 84:0b3ab51c8877 | 95 | * @{ |
bogdanm | 84:0b3ab51c8877 | 96 | */ |
bogdanm | 84:0b3ab51c8877 | 97 | #define OBEX_PCROP ((uint32_t)0x01) /*!<PCROP option byte configuration*/ |
bogdanm | 84:0b3ab51c8877 | 98 | #define OBEX_BOOTCONFIG ((uint32_t)0x02) /*!<BOOTConfig option byte configuration*/ |
bogdanm | 84:0b3ab51c8877 | 99 | |
bogdanm | 84:0b3ab51c8877 | 100 | #define IS_OBEX(VALUE)(((VALUE) == OBEX_PCROP) || \ |
bogdanm | 84:0b3ab51c8877 | 101 | ((VALUE) == OBEX_BOOTCONFIG)) |
bogdanm | 84:0b3ab51c8877 | 102 | /** |
bogdanm | 84:0b3ab51c8877 | 103 | * @} |
bogdanm | 84:0b3ab51c8877 | 104 | */ |
bogdanm | 84:0b3ab51c8877 | 105 | |
bogdanm | 92:4fc01daae5a5 | 106 | /** @defgroup FLASHEx_Latency |
bogdanm | 84:0b3ab51c8877 | 107 | * @{ |
bogdanm | 84:0b3ab51c8877 | 108 | */ |
bogdanm | 84:0b3ab51c8877 | 109 | #define FLASH_LATENCY_0 ((uint8_t)0x00) /*!< FLASH Zero Latency cycle */ |
bogdanm | 84:0b3ab51c8877 | 110 | #define FLASH_LATENCY_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */ |
bogdanm | 84:0b3ab51c8877 | 111 | |
bogdanm | 84:0b3ab51c8877 | 112 | #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \ |
bogdanm | 84:0b3ab51c8877 | 113 | ((LATENCY) == FLASH_LATENCY_1)) |
bogdanm | 84:0b3ab51c8877 | 114 | |
bogdanm | 84:0b3ab51c8877 | 115 | /** |
bogdanm | 84:0b3ab51c8877 | 116 | * @} |
bogdanm | 84:0b3ab51c8877 | 117 | */ |
bogdanm | 92:4fc01daae5a5 | 118 | /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection |
bogdanm | 84:0b3ab51c8877 | 119 | * @{ |
bogdanm | 84:0b3ab51c8877 | 120 | */ |
bogdanm | 84:0b3ab51c8877 | 121 | #define OB_PCROP_Pages0to31 ((uint32_t)0x00000001) /* PC Read/Write protection of Sector0 */ |
bogdanm | 84:0b3ab51c8877 | 122 | #define OB_PCROP_Pages32to63 ((uint32_t)0x00000002) /* PC Read/Write protection of Sector1 */ |
bogdanm | 84:0b3ab51c8877 | 123 | #define OB_PCROP_Pages64to95 ((uint32_t)0x00000004) /* PC Read/Write protection of Sector2 */ |
bogdanm | 84:0b3ab51c8877 | 124 | #define OB_PCROP_Pages96to127 ((uint32_t)0x00000008) /* PC Read/Write protection of Sector3 */ |
bogdanm | 84:0b3ab51c8877 | 125 | #define OB_PCROP_Pages128to159 ((uint32_t)0x00000010) /* PC Read/Write protection of Sector4 */ |
bogdanm | 84:0b3ab51c8877 | 126 | #define OB_PCROP_Pages160to191 ((uint32_t)0x00000020) /* PC Read/Write protection of Sector5 */ |
bogdanm | 84:0b3ab51c8877 | 127 | #define OB_PCROP_Pages192to223 ((uint32_t)0x00000040) /* PC Read/Write protection of Sector6 */ |
bogdanm | 84:0b3ab51c8877 | 128 | #define OB_PCROP_Pages224to255 ((uint32_t)0x00000080) /* PC Read/Write protection of Sector7 */ |
bogdanm | 84:0b3ab51c8877 | 129 | #define OB_PCROP_Pages256to287 ((uint32_t)0x00000100) /* PC Read/Write protection of Sector8 */ |
bogdanm | 84:0b3ab51c8877 | 130 | #define OB_PCROP_Pages288to319 ((uint32_t)0x00000200) /* PC Read/Write protection of Sector9 */ |
bogdanm | 84:0b3ab51c8877 | 131 | #define OB_PCROP_Pages320to351 ((uint32_t)0x00000400) /* PC Read/Write protection of Sector10 */ |
bogdanm | 84:0b3ab51c8877 | 132 | #define OB_PCROP_Pages352to383 ((uint32_t)0x00000800) /* PC Read/Write protection of Sector11 */ |
bogdanm | 84:0b3ab51c8877 | 133 | #define OB_PCROP_Pages384to415 ((uint32_t)0x00001000) /* PC Read/Write protection of Sector12 */ |
bogdanm | 84:0b3ab51c8877 | 134 | #define OB_PCROP_Pages416to447 ((uint32_t)0x00002000) /* PC Read/Write protection of Sector13 */ |
bogdanm | 84:0b3ab51c8877 | 135 | #define OB_PCROP_Pages448to479 ((uint32_t)0x00004000) /* PC Read/Write protection of Sector14 */ |
bogdanm | 84:0b3ab51c8877 | 136 | #define OB_PCROP_Pages480to511 ((uint32_t)0x00008000) /* PC Read/Write protection of Sector15 */ |
bogdanm | 84:0b3ab51c8877 | 137 | #define OB_PCROP_AllPages ((uint32_t)0x0000FFFF) /*!< PC Read/Write protection of all Sectors */ |
bogdanm | 84:0b3ab51c8877 | 138 | |
bogdanm | 84:0b3ab51c8877 | 139 | #define IS_OB_PCROP(PAGE) (((PAGE) != 0x0000000)) |
bogdanm | 84:0b3ab51c8877 | 140 | |
bogdanm | 84:0b3ab51c8877 | 141 | /** |
bogdanm | 84:0b3ab51c8877 | 142 | * @} |
bogdanm | 84:0b3ab51c8877 | 143 | */ |
bogdanm | 84:0b3ab51c8877 | 144 | |
bogdanm | 84:0b3ab51c8877 | 145 | /** @defgroup FLASHEx_Option_Bytes_BOOT1 |
bogdanm | 84:0b3ab51c8877 | 146 | * @{ |
bogdanm | 84:0b3ab51c8877 | 147 | */ |
bogdanm | 84:0b3ab51c8877 | 148 | |
bogdanm | 84:0b3ab51c8877 | 149 | #define OB_BOOT1_RESET ((uint16_t)0x0000) /*!< BOOT1 Reset */ |
bogdanm | 84:0b3ab51c8877 | 150 | #define OB_BOOT1_SET ((uint16_t)0x8000) /*!< BOOT1 Set */ |
bogdanm | 84:0b3ab51c8877 | 151 | #define IS_OB_BOOT1(BOOT1) (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET)) |
bogdanm | 84:0b3ab51c8877 | 152 | |
bogdanm | 84:0b3ab51c8877 | 153 | /** |
bogdanm | 84:0b3ab51c8877 | 154 | * @} |
bogdanm | 84:0b3ab51c8877 | 155 | */ |
bogdanm | 84:0b3ab51c8877 | 156 | |
bogdanm | 92:4fc01daae5a5 | 157 | /** @defgroup FLASHEx_Selection_Protection_Mode |
bogdanm | 84:0b3ab51c8877 | 158 | * @{ |
bogdanm | 84:0b3ab51c8877 | 159 | */ |
bogdanm | 84:0b3ab51c8877 | 160 | #define OB_PCROP_DESELECTED ((uint16_t)0x0000) /*!< Disabled PcROP, nWPRi bits used for Write Protection on sector i */ |
bogdanm | 84:0b3ab51c8877 | 161 | #define OB_PCROP_SELECTED ((uint16_t)0x0100) /*!< Enable PcROP, nWPRi bits used for PCRoP Protection on sector i */ |
bogdanm | 84:0b3ab51c8877 | 162 | #define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PCROP_SELECTED) || ((PCROP) == OB_PCROP_DESELECTED)) |
bogdanm | 84:0b3ab51c8877 | 163 | /** |
bogdanm | 84:0b3ab51c8877 | 164 | * @} |
bogdanm | 84:0b3ab51c8877 | 165 | */ |
bogdanm | 84:0b3ab51c8877 | 166 | |
bogdanm | 84:0b3ab51c8877 | 167 | /** |
bogdanm | 84:0b3ab51c8877 | 168 | * @} |
bogdanm | 84:0b3ab51c8877 | 169 | */ |
bogdanm | 84:0b3ab51c8877 | 170 | |
bogdanm | 84:0b3ab51c8877 | 171 | |
bogdanm | 84:0b3ab51c8877 | 172 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 173 | /** @defgroup FLASHEx_Macros |
bogdanm | 84:0b3ab51c8877 | 174 | * @brief macros to control FLASH features |
bogdanm | 84:0b3ab51c8877 | 175 | * @{ |
bogdanm | 84:0b3ab51c8877 | 176 | */ |
bogdanm | 84:0b3ab51c8877 | 177 | |
bogdanm | 84:0b3ab51c8877 | 178 | /** |
bogdanm | 84:0b3ab51c8877 | 179 | * @brief Set the FLASH Latency. |
bogdanm | 84:0b3ab51c8877 | 180 | * @param __LATENCY__: FLASH Latency |
bogdanm | 84:0b3ab51c8877 | 181 | * The value of this parameter depend on device used within the same series |
bogdanm | 84:0b3ab51c8877 | 182 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 183 | */ |
bogdanm | 84:0b3ab51c8877 | 184 | #define __HAL_FLASH_SET_LATENCY(__LATENCY__) \ |
bogdanm | 84:0b3ab51c8877 | 185 | MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (uint32_t)(__LATENCY__)) |
bogdanm | 84:0b3ab51c8877 | 186 | |
bogdanm | 84:0b3ab51c8877 | 187 | /** |
bogdanm | 84:0b3ab51c8877 | 188 | * @brief Enable the FLASH prefetch buffer. |
bogdanm | 84:0b3ab51c8877 | 189 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 190 | */ |
bogdanm | 84:0b3ab51c8877 | 191 | #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTEN) |
bogdanm | 84:0b3ab51c8877 | 192 | |
bogdanm | 84:0b3ab51c8877 | 193 | /** |
bogdanm | 84:0b3ab51c8877 | 194 | * @brief Disable the FLASH prefetch buffer. |
bogdanm | 84:0b3ab51c8877 | 195 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 196 | */ |
bogdanm | 84:0b3ab51c8877 | 197 | #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTEN)) |
bogdanm | 84:0b3ab51c8877 | 198 | |
bogdanm | 84:0b3ab51c8877 | 199 | /** |
bogdanm | 84:0b3ab51c8877 | 200 | * @brief Enable the FLASH Buffer cache. |
bogdanm | 84:0b3ab51c8877 | 201 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 202 | */ |
bogdanm | 84:0b3ab51c8877 | 203 | #define __HAL_FLASH_BUFFER_CACHE_ENABLE() (FLASH->ACR &= (~FLASH_ACR_DISAB_BUF)) |
bogdanm | 84:0b3ab51c8877 | 204 | |
bogdanm | 84:0b3ab51c8877 | 205 | /** |
bogdanm | 84:0b3ab51c8877 | 206 | * @brief Disable the FLASH Buffer cache. |
bogdanm | 84:0b3ab51c8877 | 207 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 208 | */ |
bogdanm | 84:0b3ab51c8877 | 209 | #define __HAL_FLASH_BUFFER_CACHE_DISABLE() (FLASH->ACR |= FLASH_ACR_DISAB_BUF) |
bogdanm | 84:0b3ab51c8877 | 210 | |
bogdanm | 84:0b3ab51c8877 | 211 | /** |
bogdanm | 84:0b3ab51c8877 | 212 | * @brief Enable the FLASH preread buffer |
bogdanm | 84:0b3ab51c8877 | 213 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 214 | */ |
bogdanm | 84:0b3ab51c8877 | 215 | #define __HAL_FLASH_PREREAD_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRE_READ) |
bogdanm | 84:0b3ab51c8877 | 216 | |
bogdanm | 84:0b3ab51c8877 | 217 | /** |
bogdanm | 84:0b3ab51c8877 | 218 | * @brief Disable the FLASH preread buffer |
bogdanm | 84:0b3ab51c8877 | 219 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 220 | */ |
bogdanm | 84:0b3ab51c8877 | 221 | #define __HAL_FLASH_PREREAD_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRE_READ)) |
bogdanm | 84:0b3ab51c8877 | 222 | |
bogdanm | 84:0b3ab51c8877 | 223 | /** |
bogdanm | 84:0b3ab51c8877 | 224 | * @brief Enable the FLASH power down during Sleep mode |
bogdanm | 84:0b3ab51c8877 | 225 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 226 | */ |
bogdanm | 84:0b3ab51c8877 | 227 | #define __HAL_FLASH_SLEEP_POWERDOWN_ENABLE() SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD) |
bogdanm | 84:0b3ab51c8877 | 228 | |
bogdanm | 84:0b3ab51c8877 | 229 | /** |
bogdanm | 84:0b3ab51c8877 | 230 | * @brief Disable the FLASH power down during Sleep mode |
bogdanm | 84:0b3ab51c8877 | 231 | * @retval none |
bogdanm | 84:0b3ab51c8877 | 232 | */ |
bogdanm | 84:0b3ab51c8877 | 233 | #define __HAL_FLASH_SLEEP_POWERDOWN_DISABLE() CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD) |
bogdanm | 84:0b3ab51c8877 | 234 | |
bogdanm | 84:0b3ab51c8877 | 235 | /** |
bogdanm | 84:0b3ab51c8877 | 236 | * @brief Macro to enable or disable the Flash Run power down mode. |
bogdanm | 84:0b3ab51c8877 | 237 | * @note Writing this bit to 0 this bit, automatically the keys are |
bogdanm | 84:0b3ab51c8877 | 238 | * loss and a new unlock sequence is necessary to re-write it to 1. |
bogdanm | 84:0b3ab51c8877 | 239 | */ |
bogdanm | 84:0b3ab51c8877 | 240 | |
bogdanm | 84:0b3ab51c8877 | 241 | #define __HAL_FLASH_POWER_DOWN_ENABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \ |
bogdanm | 84:0b3ab51c8877 | 242 | FLASH->PDKEYR = FLASH_PDKEY2; \ |
bogdanm | 84:0b3ab51c8877 | 243 | SET_BIT(FLASH->ACR, FLASH_ACR_RUN_PD); \ |
bogdanm | 84:0b3ab51c8877 | 244 | } while (0) |
bogdanm | 84:0b3ab51c8877 | 245 | |
bogdanm | 84:0b3ab51c8877 | 246 | #define __HAL_FLASH_POWER_DOWN_DISABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \ |
bogdanm | 84:0b3ab51c8877 | 247 | FLASH->PDKEYR = FLASH_PDKEY2; \ |
bogdanm | 84:0b3ab51c8877 | 248 | CLEAR_BIT(FLASH->ACR, FLASH_ACR_RUN_PD); \ |
bogdanm | 84:0b3ab51c8877 | 249 | } while (0) |
bogdanm | 84:0b3ab51c8877 | 250 | /** |
bogdanm | 84:0b3ab51c8877 | 251 | * @} |
bogdanm | 84:0b3ab51c8877 | 252 | */ |
bogdanm | 84:0b3ab51c8877 | 253 | |
bogdanm | 84:0b3ab51c8877 | 254 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 255 | |
bogdanm | 84:0b3ab51c8877 | 256 | /* I/O operation functions *****************************************************/ |
bogdanm | 84:0b3ab51c8877 | 257 | /* Peripheral Control functions ************************************************/ |
bogdanm | 92:4fc01daae5a5 | 258 | HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Unlock(void); |
bogdanm | 92:4fc01daae5a5 | 259 | HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Lock(void); |
bogdanm | 92:4fc01daae5a5 | 260 | HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Erase(uint32_t Address); |
bogdanm | 92:4fc01daae5a5 | 261 | HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Program(uint32_t TypeProgram, uint32_t Address, uint32_t Data); |
bogdanm | 84:0b3ab51c8877 | 262 | |
bogdanm | 92:4fc01daae5a5 | 263 | /* Aliases for legacy HAL versions compatibility */ |
bogdanm | 92:4fc01daae5a5 | 264 | #define HAL_DATA_EEPROMEx_Unlock HAL_FLASHEx_DATAEEPROM_Unlock |
bogdanm | 92:4fc01daae5a5 | 265 | #define HAL_DATA_EEPROMEx_Lock HAL_FLASHEx_DATAEEPROM_Lock |
bogdanm | 92:4fc01daae5a5 | 266 | #define HAL_DATA_EEPROMEx_Erase HAL_FLASHEx_DATAEEPROM_Erase |
bogdanm | 92:4fc01daae5a5 | 267 | #define HAL_DATA_EEPROMEx_Program HAL_FLASHEx_DATAEEPROM_Program |
bogdanm | 84:0b3ab51c8877 | 268 | |
bogdanm | 84:0b3ab51c8877 | 269 | HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); |
bogdanm | 84:0b3ab51c8877 | 270 | HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); |
bogdanm | 84:0b3ab51c8877 | 271 | |
bogdanm | 92:4fc01daae5a5 | 272 | HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void); |
bogdanm | 92:4fc01daae5a5 | 273 | HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void); |
bogdanm | 92:4fc01daae5a5 | 274 | |
bogdanm | 84:0b3ab51c8877 | 275 | HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 84:0b3ab51c8877 | 276 | void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); |
bogdanm | 84:0b3ab51c8877 | 277 | |
bogdanm | 84:0b3ab51c8877 | 278 | HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit); |
bogdanm | 84:0b3ab51c8877 | 279 | void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit); |
bogdanm | 84:0b3ab51c8877 | 280 | |
bogdanm | 84:0b3ab51c8877 | 281 | |
bogdanm | 84:0b3ab51c8877 | 282 | |
bogdanm | 84:0b3ab51c8877 | 283 | /** |
bogdanm | 84:0b3ab51c8877 | 284 | * @} |
bogdanm | 84:0b3ab51c8877 | 285 | */ |
bogdanm | 84:0b3ab51c8877 | 286 | |
bogdanm | 84:0b3ab51c8877 | 287 | /** |
bogdanm | 84:0b3ab51c8877 | 288 | * @} |
bogdanm | 84:0b3ab51c8877 | 289 | */ |
bogdanm | 84:0b3ab51c8877 | 290 | |
bogdanm | 84:0b3ab51c8877 | 291 | #ifdef __cplusplus |
bogdanm | 84:0b3ab51c8877 | 292 | } |
bogdanm | 84:0b3ab51c8877 | 293 | #endif |
bogdanm | 84:0b3ab51c8877 | 294 | |
bogdanm | 84:0b3ab51c8877 | 295 | #endif /* __STM32L0xx_HAL_FLASH_EX_H */ |
bogdanm | 84:0b3ab51c8877 | 296 | |
bogdanm | 84:0b3ab51c8877 | 297 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |