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