my fork

Dependents:   Nucleo_blueNRG

Fork of mbed by mbed official

Committer:
filartrix
Date:
Wed Apr 08 14:12:53 2015 +0000
Revision:
97:4298809c7c9e
Parent:
90:cb3d968589d8
First reale BlueNRG module for nucleo 401 board

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 90:cb3d968589d8 1 /**
Kojto 90:cb3d968589d8 2 ******************************************************************************
Kojto 90:cb3d968589d8 3 * @file stm32l1xx_hal_flash.h
Kojto 90:cb3d968589d8 4 * @author MCD Application Team
Kojto 90:cb3d968589d8 5 * @version V1.0.0
Kojto 90:cb3d968589d8 6 * @date 5-September-2014
Kojto 90:cb3d968589d8 7 * @brief Header file of Flash HAL module.
Kojto 90:cb3d968589d8 8 ******************************************************************************
Kojto 90:cb3d968589d8 9 * @attention
Kojto 90:cb3d968589d8 10 *
Kojto 90:cb3d968589d8 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 90:cb3d968589d8 12 *
Kojto 90:cb3d968589d8 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 90:cb3d968589d8 14 * are permitted provided that the following conditions are met:
Kojto 90:cb3d968589d8 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 90:cb3d968589d8 16 * this list of conditions and the following disclaimer.
Kojto 90:cb3d968589d8 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 90:cb3d968589d8 18 * this list of conditions and the following disclaimer in the documentation
Kojto 90:cb3d968589d8 19 * and/or other materials provided with the distribution.
Kojto 90:cb3d968589d8 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 90:cb3d968589d8 21 * may be used to endorse or promote products derived from this software
Kojto 90:cb3d968589d8 22 * without specific prior written permission.
Kojto 90:cb3d968589d8 23 *
Kojto 90:cb3d968589d8 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 90:cb3d968589d8 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 90:cb3d968589d8 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 90:cb3d968589d8 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 90:cb3d968589d8 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 90:cb3d968589d8 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 90:cb3d968589d8 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 90:cb3d968589d8 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 90:cb3d968589d8 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 90:cb3d968589d8 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 90:cb3d968589d8 34 *
Kojto 90:cb3d968589d8 35 ******************************************************************************
Kojto 90:cb3d968589d8 36 */
Kojto 90:cb3d968589d8 37
Kojto 90:cb3d968589d8 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 90:cb3d968589d8 39 #ifndef __STM32L1xx_HAL_FLASH_EX_H
Kojto 90:cb3d968589d8 40 #define __STM32L1xx_HAL_FLASH_EX_H
Kojto 90:cb3d968589d8 41
Kojto 90:cb3d968589d8 42 #ifdef __cplusplus
Kojto 90:cb3d968589d8 43 extern "C" {
Kojto 90:cb3d968589d8 44 #endif
Kojto 90:cb3d968589d8 45
Kojto 90:cb3d968589d8 46 /* Includes ------------------------------------------------------------------*/
Kojto 90:cb3d968589d8 47 #include "stm32l1xx_hal_def.h"
Kojto 90:cb3d968589d8 48
Kojto 90:cb3d968589d8 49 /** @addtogroup STM32L1xx_HAL_Driver
Kojto 90:cb3d968589d8 50 * @{
Kojto 90:cb3d968589d8 51 */
Kojto 90:cb3d968589d8 52
Kojto 90:cb3d968589d8 53 /** @addtogroup FLASHEx
Kojto 90:cb3d968589d8 54 * @{
Kojto 90:cb3d968589d8 55 */
Kojto 90:cb3d968589d8 56
Kojto 90:cb3d968589d8 57 /* Exported types ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 58
Kojto 90:cb3d968589d8 59 /** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types
Kojto 90:cb3d968589d8 60 * @{
Kojto 90:cb3d968589d8 61 */
Kojto 90:cb3d968589d8 62
Kojto 90:cb3d968589d8 63 /**
Kojto 90:cb3d968589d8 64 * @brief FLASH Erase structure definition
Kojto 90:cb3d968589d8 65 */
Kojto 90:cb3d968589d8 66 typedef struct
Kojto 90:cb3d968589d8 67 {
Kojto 90:cb3d968589d8 68 uint32_t TypeErase; /*!< TypeErase: Page Erase only.
Kojto 90:cb3d968589d8 69 This parameter can be a value of @ref FLASHEx_Type_Erase */
Kojto 90:cb3d968589d8 70
Kojto 90:cb3d968589d8 71 uint32_t PageAddress; /*!< PageAddress: Initial FLASH address to be erased
Kojto 90:cb3d968589d8 72 This parameter must be a value belonging to FLASH Programm address (depending on the devices) */
Kojto 90:cb3d968589d8 73
Kojto 90:cb3d968589d8 74 uint32_t NbPages; /*!< NbPages: Number of pages to be erased.
Kojto 90:cb3d968589d8 75 This parameter must be a value between 1 and (max number of pages - value of Initial page)*/
Kojto 90:cb3d968589d8 76
Kojto 90:cb3d968589d8 77 } FLASH_EraseInitTypeDef;
Kojto 90:cb3d968589d8 78
Kojto 90:cb3d968589d8 79 /**
Kojto 90:cb3d968589d8 80 * @brief FLASH Option Bytes PROGRAM structure definition
Kojto 90:cb3d968589d8 81 */
Kojto 90:cb3d968589d8 82 typedef struct
Kojto 90:cb3d968589d8 83 {
Kojto 90:cb3d968589d8 84 uint32_t OptionType; /*!< OptionType: Option byte to be configured.
Kojto 90:cb3d968589d8 85 This parameter can be a value of @ref FLASHEx_Option_Type */
Kojto 90:cb3d968589d8 86
Kojto 90:cb3d968589d8 87 uint32_t WRPState; /*!< WRPState: Write protection activation or deactivation.
Kojto 90:cb3d968589d8 88 This parameter can be a value of @ref FLASHEx_WRP_State */
Kojto 90:cb3d968589d8 89
Kojto 90:cb3d968589d8 90 uint32_t WRPSector0To31; /*!< WRPSector0To31: specifies the sector(s) which are write protected between Sector 0 to 31
Kojto 90:cb3d968589d8 91 This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection1 */
Kojto 90:cb3d968589d8 92
Kojto 90:cb3d968589d8 93 #if defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 94 defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 95 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 96 uint32_t WRPSector32To63; /*!< WRPSector32To63: specifies the sector(s) which are write protected between Sector 32 to 63
Kojto 90:cb3d968589d8 97 This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection2 */
Kojto 90:cb3d968589d8 98 #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 99
Kojto 90:cb3d968589d8 100 #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 101 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 102 uint32_t WRPSector64To95; /*!< WRPSector64to95: specifies the sector(s) which are write protected between Sector 64 to 95
Kojto 90:cb3d968589d8 103 This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection3 */
Kojto 90:cb3d968589d8 104 #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 105
Kojto 90:cb3d968589d8 106 #if defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 107 uint32_t WRPSector96To127; /*!< WRPSector96To127: specifies the sector(s) which are write protected between Sector 96 to 127
Kojto 90:cb3d968589d8 108 This parameter can be a combination of @ref FLASHEx_Option_Bytes_Write_Protection4 */
Kojto 90:cb3d968589d8 109 #endif /* STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 110
Kojto 90:cb3d968589d8 111 uint8_t RDPLevel; /*!< RDPLevel: Set the read protection level..
Kojto 90:cb3d968589d8 112 This parameter can be a value of @ref FLASHEx_Option_Bytes_Read_Protection */
Kojto 90:cb3d968589d8 113
Kojto 90:cb3d968589d8 114 uint8_t BORLevel; /*!< BORLevel: Set the BOR Level.
Kojto 90:cb3d968589d8 115 This parameter can be a value of @ref FLASHEx_Option_Bytes_BOR_Level */
Kojto 90:cb3d968589d8 116
Kojto 90:cb3d968589d8 117 uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
Kojto 90:cb3d968589d8 118 This parameter can be a combination of @ref FLASHEx_Option_Bytes_IWatchdog, @ref FLASHEx_Option_Bytes_nRST_STOP and @ref FLASHEx_Option_Bytes_nRST_STDBY*/
Kojto 90:cb3d968589d8 119 } FLASH_OBProgramInitTypeDef;
Kojto 90:cb3d968589d8 120
Kojto 90:cb3d968589d8 121 /**
Kojto 90:cb3d968589d8 122 * @brief FLASH Advanced Option Bytes Program structure definition
Kojto 90:cb3d968589d8 123 */
Kojto 90:cb3d968589d8 124 typedef struct
Kojto 90:cb3d968589d8 125 {
Kojto 90:cb3d968589d8 126 uint32_t OptionType; /*!< OptionType: Option byte to be configured for extension .
Kojto 90:cb3d968589d8 127 This parameter can be a value of @ref FLASHEx_OptionAdv_Type */
Kojto 90:cb3d968589d8 128
Kojto 90:cb3d968589d8 129 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 130 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 131 uint32_t PCROPState; /*!< PCROPState: PCROP activation or deactivation.
Kojto 90:cb3d968589d8 132 This parameter can be a value of @ref FLASHEx_PCROP_State */
Kojto 90:cb3d968589d8 133
Kojto 90:cb3d968589d8 134 uint32_t PCROPSector0To31; /*!< PCROPSector0To31: specifies the sector(s) set for PCROP
Kojto 90:cb3d968589d8 135 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection1 */
Kojto 90:cb3d968589d8 136
Kojto 90:cb3d968589d8 137 #if defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 138 uint32_t PCROPSector32To63; /*!< PCROPSector32To63: specifies the sector(s) set for PCROP
Kojto 90:cb3d968589d8 139 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection2 */
Kojto 90:cb3d968589d8 140 #endif /* STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 141 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 142
Kojto 90:cb3d968589d8 143 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 144 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 145 uint16_t BootConfig; /*!< BootConfig: specifies Option bytes for boot config
Kojto 90:cb3d968589d8 146 This parameter can be a value of @ref FLASHEx_Option_Bytes_BOOT */
Kojto 90:cb3d968589d8 147 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE*/
Kojto 90:cb3d968589d8 148 } FLASH_AdvOBProgramInitTypeDef;
Kojto 90:cb3d968589d8 149
Kojto 90:cb3d968589d8 150 /**
Kojto 90:cb3d968589d8 151 * @}
Kojto 90:cb3d968589d8 152 */
Kojto 90:cb3d968589d8 153
Kojto 90:cb3d968589d8 154 /* Exported constants --------------------------------------------------------*/
Kojto 90:cb3d968589d8 155
Kojto 90:cb3d968589d8 156
Kojto 90:cb3d968589d8 157 /** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
Kojto 90:cb3d968589d8 158 * @{
Kojto 90:cb3d968589d8 159 */
Kojto 90:cb3d968589d8 160
Kojto 90:cb3d968589d8 161 /** @defgroup FLASHEx_Type_Erase FLASHEx_Type_Erase
Kojto 90:cb3d968589d8 162 * @{
Kojto 90:cb3d968589d8 163 */
Kojto 90:cb3d968589d8 164 #define TYPEERASE_PAGES ((uint32_t)0x00) /*!<Page erase only*/
Kojto 90:cb3d968589d8 165
Kojto 90:cb3d968589d8 166 #define IS_TYPEERASE(__VALUE__) (((__VALUE__) == TYPEERASE_PAGES))
Kojto 90:cb3d968589d8 167 /**
Kojto 90:cb3d968589d8 168 * @}
Kojto 90:cb3d968589d8 169 */
Kojto 90:cb3d968589d8 170
Kojto 90:cb3d968589d8 171 /** @defgroup FLASHEx_Option_Type FLASHEx Option Type
Kojto 90:cb3d968589d8 172 * @{
Kojto 90:cb3d968589d8 173 */
Kojto 90:cb3d968589d8 174 #define OPTIONBYTE_WRP ((uint32_t)0x01) /*!<WRP option byte configuration*/
Kojto 90:cb3d968589d8 175 #define OPTIONBYTE_RDP ((uint32_t)0x02) /*!<RDP option byte configuration*/
Kojto 90:cb3d968589d8 176 #define OPTIONBYTE_USER ((uint32_t)0x04) /*!<USER option byte configuration*/
Kojto 90:cb3d968589d8 177 #define OPTIONBYTE_BOR ((uint32_t)0x08) /*!<BOR option byte configuration*/
Kojto 90:cb3d968589d8 178
Kojto 90:cb3d968589d8 179 #define IS_OPTIONBYTE(__VALUE__) (((__VALUE__) < (OPTIONBYTE_WRP|OPTIONBYTE_RDP|OPTIONBYTE_USER|OPTIONBYTE_BOR)))
Kojto 90:cb3d968589d8 180 /**
Kojto 90:cb3d968589d8 181 * @}
Kojto 90:cb3d968589d8 182 */
Kojto 90:cb3d968589d8 183
Kojto 90:cb3d968589d8 184 /** @defgroup FLASHEx_WRP_State FLASHEx WRP State
Kojto 90:cb3d968589d8 185 * @{
Kojto 90:cb3d968589d8 186 */
Kojto 90:cb3d968589d8 187 #define WRPSTATE_DISABLE ((uint32_t)0x00) /*!<Disable the write protection of the desired bank 1 sectors*/
Kojto 90:cb3d968589d8 188 #define WRPSTATE_ENABLE ((uint32_t)0x01) /*!<Enable the write protection of the desired bank 1 sectors*/
Kojto 90:cb3d968589d8 189
Kojto 90:cb3d968589d8 190 #define IS_WRPSTATE(__VALUE__) (((__VALUE__) == WRPSTATE_DISABLE) || \
Kojto 90:cb3d968589d8 191 ((__VALUE__) == WRPSTATE_ENABLE))
Kojto 90:cb3d968589d8 192 /**
Kojto 90:cb3d968589d8 193 * @}
Kojto 90:cb3d968589d8 194 */
Kojto 90:cb3d968589d8 195
Kojto 90:cb3d968589d8 196 /** @defgroup FLASHEx_Option_Bytes_Write_Mask FLASHEx Option Bytes Write Mask
Kojto 90:cb3d968589d8 197 * @{
Kojto 90:cb3d968589d8 198 */
Kojto 90:cb3d968589d8 199 #define WRP_MASK_LOW ((uint32_t)0x0000FFFF)
Kojto 90:cb3d968589d8 200 #define WRP_MASK_HIGH ((uint32_t)0xFFFF0000)
Kojto 90:cb3d968589d8 201
Kojto 90:cb3d968589d8 202 /**
Kojto 90:cb3d968589d8 203 * @}
Kojto 90:cb3d968589d8 204 */
Kojto 90:cb3d968589d8 205
Kojto 90:cb3d968589d8 206 /** @defgroup FLASHEx_Option_Bytes_Write_Protection1 FLASHEx Option Bytes Write Protection1
Kojto 90:cb3d968589d8 207 * @{
Kojto 90:cb3d968589d8 208 */
Kojto 90:cb3d968589d8 209
Kojto 90:cb3d968589d8 210 /* Common pages for Cat1, Cat2, Cat3, Cat4 & Cat5 devices */
Kojto 90:cb3d968589d8 211 #define OB_WRP1_PAGES0TO15 ((uint32_t)0x00000001) /* Write protection of Sector0 */
Kojto 90:cb3d968589d8 212 #define OB_WRP1_PAGES16TO31 ((uint32_t)0x00000002) /* Write protection of Sector1 */
Kojto 90:cb3d968589d8 213 #define OB_WRP1_PAGES32TO47 ((uint32_t)0x00000004) /* Write protection of Sector2 */
Kojto 90:cb3d968589d8 214 #define OB_WRP1_PAGES48TO63 ((uint32_t)0x00000008) /* Write protection of Sector3 */
Kojto 90:cb3d968589d8 215 #define OB_WRP1_PAGES64TO79 ((uint32_t)0x00000010) /* Write protection of Sector4 */
Kojto 90:cb3d968589d8 216 #define OB_WRP1_PAGES80TO95 ((uint32_t)0x00000020) /* Write protection of Sector5 */
Kojto 90:cb3d968589d8 217 #define OB_WRP1_PAGES96TO111 ((uint32_t)0x00000040) /* Write protection of Sector6 */
Kojto 90:cb3d968589d8 218 #define OB_WRP1_PAGES112TO127 ((uint32_t)0x00000080) /* Write protection of Sector7 */
Kojto 90:cb3d968589d8 219 #define OB_WRP1_PAGES128TO143 ((uint32_t)0x00000100) /* Write protection of Sector8 */
Kojto 90:cb3d968589d8 220 #define OB_WRP1_PAGES144TO159 ((uint32_t)0x00000200) /* Write protection of Sector9 */
Kojto 90:cb3d968589d8 221 #define OB_WRP1_PAGES160TO175 ((uint32_t)0x00000400) /* Write protection of Sector10 */
Kojto 90:cb3d968589d8 222 #define OB_WRP1_PAGES176TO191 ((uint32_t)0x00000800) /* Write protection of Sector11 */
Kojto 90:cb3d968589d8 223 #define OB_WRP1_PAGES192TO207 ((uint32_t)0x00001000) /* Write protection of Sector12 */
Kojto 90:cb3d968589d8 224 #define OB_WRP1_PAGES208TO223 ((uint32_t)0x00002000) /* Write protection of Sector13 */
Kojto 90:cb3d968589d8 225 #define OB_WRP1_PAGES224TO239 ((uint32_t)0x00004000) /* Write protection of Sector14 */
Kojto 90:cb3d968589d8 226 #define OB_WRP1_PAGES240TO255 ((uint32_t)0x00008000) /* Write protection of Sector15 */
Kojto 90:cb3d968589d8 227 #define OB_WRP1_PAGES256TO271 ((uint32_t)0x00010000) /* Write protection of Sector16 */
Kojto 90:cb3d968589d8 228 #define OB_WRP1_PAGES272TO287 ((uint32_t)0x00020000) /* Write protection of Sector17 */
Kojto 90:cb3d968589d8 229 #define OB_WRP1_PAGES288TO303 ((uint32_t)0x00040000) /* Write protection of Sector18 */
Kojto 90:cb3d968589d8 230 #define OB_WRP1_PAGES304TO319 ((uint32_t)0x00080000) /* Write protection of Sector19 */
Kojto 90:cb3d968589d8 231 #define OB_WRP1_PAGES320TO335 ((uint32_t)0x00100000) /* Write protection of Sector20 */
Kojto 90:cb3d968589d8 232 #define OB_WRP1_PAGES336TO351 ((uint32_t)0x00200000) /* Write protection of Sector21 */
Kojto 90:cb3d968589d8 233 #define OB_WRP1_PAGES352TO367 ((uint32_t)0x00400000) /* Write protection of Sector22 */
Kojto 90:cb3d968589d8 234 #define OB_WRP1_PAGES368TO383 ((uint32_t)0x00800000) /* Write protection of Sector23 */
Kojto 90:cb3d968589d8 235 #define OB_WRP1_PAGES384TO399 ((uint32_t)0x01000000) /* Write protection of Sector24 */
Kojto 90:cb3d968589d8 236 #define OB_WRP1_PAGES400TO415 ((uint32_t)0x02000000) /* Write protection of Sector25 */
Kojto 90:cb3d968589d8 237 #define OB_WRP1_PAGES416TO431 ((uint32_t)0x04000000) /* Write protection of Sector26 */
Kojto 90:cb3d968589d8 238 #define OB_WRP1_PAGES432TO447 ((uint32_t)0x08000000) /* Write protection of Sector27 */
Kojto 90:cb3d968589d8 239 #define OB_WRP1_PAGES448TO463 ((uint32_t)0x10000000) /* Write protection of Sector28 */
Kojto 90:cb3d968589d8 240 #define OB_WRP1_PAGES464TO479 ((uint32_t)0x20000000) /* Write protection of Sector29 */
Kojto 90:cb3d968589d8 241 #define OB_WRP1_PAGES480TO495 ((uint32_t)0x40000000) /* Write protection of Sector30 */
Kojto 90:cb3d968589d8 242 #define OB_WRP1_PAGES496TO511 ((uint32_t)0x80000000) /* Write protection of Sector31 */
Kojto 90:cb3d968589d8 243
Kojto 90:cb3d968589d8 244 #define OB_WRP1_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Sectors */
Kojto 90:cb3d968589d8 245
Kojto 90:cb3d968589d8 246 /**
Kojto 90:cb3d968589d8 247 * @}
Kojto 90:cb3d968589d8 248 */
Kojto 90:cb3d968589d8 249
Kojto 90:cb3d968589d8 250 #if defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 251 defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 252 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 253
Kojto 90:cb3d968589d8 254 /** @defgroup FLASHEx_Option_Bytes_Write_Protection2 FLASHEx Option Bytes Write Protection2
Kojto 90:cb3d968589d8 255 * @{
Kojto 90:cb3d968589d8 256 */
Kojto 90:cb3d968589d8 257
Kojto 90:cb3d968589d8 258 /* Pages for Cat3, Cat4 & Cat5 devices*/
Kojto 90:cb3d968589d8 259 #define OB_WRP2_PAGES512TO527 ((uint32_t)0x00000001) /* Write protection of Sector32 */
Kojto 90:cb3d968589d8 260 #define OB_WRP2_PAGES528TO543 ((uint32_t)0x00000002) /* Write protection of Sector33 */
Kojto 90:cb3d968589d8 261 #define OB_WRP2_PAGES544TO559 ((uint32_t)0x00000004) /* Write protection of Sector34 */
Kojto 90:cb3d968589d8 262 #define OB_WRP2_PAGES560TO575 ((uint32_t)0x00000008) /* Write protection of Sector35 */
Kojto 90:cb3d968589d8 263 #define OB_WRP2_PAGES576TO591 ((uint32_t)0x00000010) /* Write protection of Sector36 */
Kojto 90:cb3d968589d8 264 #define OB_WRP2_PAGES592TO607 ((uint32_t)0x00000020) /* Write protection of Sector37 */
Kojto 90:cb3d968589d8 265 #define OB_WRP2_PAGES608TO623 ((uint32_t)0x00000040) /* Write protection of Sector38 */
Kojto 90:cb3d968589d8 266 #define OB_WRP2_PAGES624TO639 ((uint32_t)0x00000080) /* Write protection of Sector39 */
Kojto 90:cb3d968589d8 267 #define OB_WRP2_PAGES640TO655 ((uint32_t)0x00000100) /* Write protection of Sector40 */
Kojto 90:cb3d968589d8 268 #define OB_WRP2_PAGES656TO671 ((uint32_t)0x00000200) /* Write protection of Sector41 */
Kojto 90:cb3d968589d8 269 #define OB_WRP2_PAGES672TO687 ((uint32_t)0x00000400) /* Write protection of Sector42 */
Kojto 90:cb3d968589d8 270 #define OB_WRP2_PAGES688TO703 ((uint32_t)0x00000800) /* Write protection of Sector43 */
Kojto 90:cb3d968589d8 271 #define OB_WRP2_PAGES704TO719 ((uint32_t)0x00001000) /* Write protection of Sector44 */
Kojto 90:cb3d968589d8 272 #define OB_WRP2_PAGES720TO735 ((uint32_t)0x00002000) /* Write protection of Sector45 */
Kojto 90:cb3d968589d8 273 #define OB_WRP2_PAGES736TO751 ((uint32_t)0x00004000) /* Write protection of Sector46 */
Kojto 90:cb3d968589d8 274 #define OB_WRP2_PAGES752TO767 ((uint32_t)0x00008000) /* Write protection of Sector47 */
Kojto 90:cb3d968589d8 275 #define OB_WRP2_PAGES768TO783 ((uint32_t)0x00010000) /* Write protection of Sector48 */
Kojto 90:cb3d968589d8 276 #define OB_WRP2_PAGES784TO799 ((uint32_t)0x00020000) /* Write protection of Sector49 */
Kojto 90:cb3d968589d8 277 #define OB_WRP2_PAGES800TO815 ((uint32_t)0x00040000) /* Write protection of Sector50 */
Kojto 90:cb3d968589d8 278 #define OB_WRP2_PAGES816TO831 ((uint32_t)0x00080000) /* Write protection of Sector51 */
Kojto 90:cb3d968589d8 279 #define OB_WRP2_PAGES832TO847 ((uint32_t)0x00100000) /* Write protection of Sector52 */
Kojto 90:cb3d968589d8 280 #define OB_WRP2_PAGES848TO863 ((uint32_t)0x00200000) /* Write protection of Sector53 */
Kojto 90:cb3d968589d8 281 #define OB_WRP2_PAGES864TO879 ((uint32_t)0x00400000) /* Write protection of Sector54 */
Kojto 90:cb3d968589d8 282 #define OB_WRP2_PAGES880TO895 ((uint32_t)0x00800000) /* Write protection of Sector55 */
Kojto 90:cb3d968589d8 283 #define OB_WRP2_PAGES896TO911 ((uint32_t)0x01000000) /* Write protection of Sector56 */
Kojto 90:cb3d968589d8 284 #define OB_WRP2_PAGES912TO927 ((uint32_t)0x02000000) /* Write protection of Sector57 */
Kojto 90:cb3d968589d8 285 #define OB_WRP2_PAGES928TO943 ((uint32_t)0x04000000) /* Write protection of Sector58 */
Kojto 90:cb3d968589d8 286 #define OB_WRP2_PAGES944TO959 ((uint32_t)0x08000000) /* Write protection of Sector59 */
Kojto 90:cb3d968589d8 287 #define OB_WRP2_PAGES960TO975 ((uint32_t)0x10000000) /* Write protection of Sector60 */
Kojto 90:cb3d968589d8 288 #define OB_WRP2_PAGES976TO991 ((uint32_t)0x20000000) /* Write protection of Sector61 */
Kojto 90:cb3d968589d8 289 #define OB_WRP2_PAGES992TO1007 ((uint32_t)0x40000000) /* Write protection of Sector62 */
Kojto 90:cb3d968589d8 290 #define OB_WRP2_PAGES1008TO1023 ((uint32_t)0x80000000) /* Write protection of Sector63 */
Kojto 90:cb3d968589d8 291
Kojto 90:cb3d968589d8 292 #define OB_WRP2_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Sectors */
Kojto 90:cb3d968589d8 293
Kojto 90:cb3d968589d8 294 /**
Kojto 90:cb3d968589d8 295 * @}
Kojto 90:cb3d968589d8 296 */
Kojto 90:cb3d968589d8 297
Kojto 90:cb3d968589d8 298 #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 299
Kojto 90:cb3d968589d8 300 #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 301 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 302
Kojto 90:cb3d968589d8 303 /** @defgroup FLASHEx_Option_Bytes_Write_Protection3 FLASHEx Option Bytes Write Protection3
Kojto 90:cb3d968589d8 304 * @{
Kojto 90:cb3d968589d8 305 */
Kojto 90:cb3d968589d8 306
Kojto 90:cb3d968589d8 307 /* Pages for devices with FLASH >= 256KB*/
Kojto 90:cb3d968589d8 308 #define OB_WRP3_PAGES1024TO1039 ((uint32_t)0x00000001) /* Write protection of Sector64 */
Kojto 90:cb3d968589d8 309 #define OB_WRP3_PAGES1040TO1055 ((uint32_t)0x00000002) /* Write protection of Sector65 */
Kojto 90:cb3d968589d8 310 #define OB_WRP3_PAGES1056TO1071 ((uint32_t)0x00000004) /* Write protection of Sector66 */
Kojto 90:cb3d968589d8 311 #define OB_WRP3_PAGES1072TO1087 ((uint32_t)0x00000008) /* Write protection of Sector67 */
Kojto 90:cb3d968589d8 312 #define OB_WRP3_PAGES1088TO1103 ((uint32_t)0x00000010) /* Write protection of Sector68 */
Kojto 90:cb3d968589d8 313 #define OB_WRP3_PAGES1104TO1119 ((uint32_t)0x00000020) /* Write protection of Sector69 */
Kojto 90:cb3d968589d8 314 #define OB_WRP3_PAGES1120TO1135 ((uint32_t)0x00000040) /* Write protection of Sector70 */
Kojto 90:cb3d968589d8 315 #define OB_WRP3_PAGES1136TO1151 ((uint32_t)0x00000080) /* Write protection of Sector71 */
Kojto 90:cb3d968589d8 316 #define OB_WRP3_PAGES1152TO1167 ((uint32_t)0x00000100) /* Write protection of Sector72 */
Kojto 90:cb3d968589d8 317 #define OB_WRP3_PAGES1168TO1183 ((uint32_t)0x00000200) /* Write protection of Sector73 */
Kojto 90:cb3d968589d8 318 #define OB_WRP3_PAGES1184TO1199 ((uint32_t)0x00000400) /* Write protection of Sector74 */
Kojto 90:cb3d968589d8 319 #define OB_WRP3_PAGES1200TO1215 ((uint32_t)0x00000800) /* Write protection of Sector75 */
Kojto 90:cb3d968589d8 320 #define OB_WRP3_PAGES1216TO1231 ((uint32_t)0x00001000) /* Write protection of Sector76 */
Kojto 90:cb3d968589d8 321 #define OB_WRP3_PAGES1232TO1247 ((uint32_t)0x00002000) /* Write protection of Sector77 */
Kojto 90:cb3d968589d8 322 #define OB_WRP3_PAGES1248TO1263 ((uint32_t)0x00004000) /* Write protection of Sector78 */
Kojto 90:cb3d968589d8 323 #define OB_WRP3_PAGES1264TO1279 ((uint32_t)0x00008000) /* Write protection of Sector79 */
Kojto 90:cb3d968589d8 324 #define OB_WRP3_PAGES1280TO1295 ((uint32_t)0x00010000) /* Write protection of Sector80 */
Kojto 90:cb3d968589d8 325 #define OB_WRP3_PAGES1296TO1311 ((uint32_t)0x00020000) /* Write protection of Sector81 */
Kojto 90:cb3d968589d8 326 #define OB_WRP3_PAGES1312TO1327 ((uint32_t)0x00040000) /* Write protection of Sector82 */
Kojto 90:cb3d968589d8 327 #define OB_WRP3_PAGES1328TO1343 ((uint32_t)0x00080000) /* Write protection of Sector83 */
Kojto 90:cb3d968589d8 328 #define OB_WRP3_PAGES1344TO1359 ((uint32_t)0x00100000) /* Write protection of Sector84 */
Kojto 90:cb3d968589d8 329 #define OB_WRP3_PAGES1360TO1375 ((uint32_t)0x00200000) /* Write protection of Sector85 */
Kojto 90:cb3d968589d8 330 #define OB_WRP3_PAGES1376TO1391 ((uint32_t)0x00400000) /* Write protection of Sector86 */
Kojto 90:cb3d968589d8 331 #define OB_WRP3_PAGES1392TO1407 ((uint32_t)0x00800000) /* Write protection of Sector87 */
Kojto 90:cb3d968589d8 332 #define OB_WRP3_PAGES1408TO1423 ((uint32_t)0x01000000) /* Write protection of Sector88 */
Kojto 90:cb3d968589d8 333 #define OB_WRP3_PAGES1424TO1439 ((uint32_t)0x02000000) /* Write protection of Sector89 */
Kojto 90:cb3d968589d8 334 #define OB_WRP3_PAGES1440TO1455 ((uint32_t)0x04000000) /* Write protection of Sector90 */
Kojto 90:cb3d968589d8 335 #define OB_WRP3_PAGES1456TO1471 ((uint32_t)0x08000000) /* Write protection of Sector91 */
Kojto 90:cb3d968589d8 336 #define OB_WRP3_PAGES1472TO1487 ((uint32_t)0x10000000) /* Write protection of Sector92 */
Kojto 90:cb3d968589d8 337 #define OB_WRP3_PAGES1488TO1503 ((uint32_t)0x20000000) /* Write protection of Sector93 */
Kojto 90:cb3d968589d8 338 #define OB_WRP3_PAGES1504TO1519 ((uint32_t)0x40000000) /* Write protection of Sector94 */
Kojto 90:cb3d968589d8 339 #define OB_WRP3_PAGES1520TO1535 ((uint32_t)0x80000000) /* Write protection of Sector95 */
Kojto 90:cb3d968589d8 340
Kojto 90:cb3d968589d8 341 #define OB_WRP3_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Sectors */
Kojto 90:cb3d968589d8 342
Kojto 90:cb3d968589d8 343 /**
Kojto 90:cb3d968589d8 344 * @}
Kojto 90:cb3d968589d8 345 */
Kojto 90:cb3d968589d8 346
Kojto 90:cb3d968589d8 347 #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE*/
Kojto 90:cb3d968589d8 348
Kojto 90:cb3d968589d8 349 #if defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 350
Kojto 90:cb3d968589d8 351 /** @defgroup FLASHEx_Option_Bytes_Write_Protection4 FLASHEx Option Bytes Write Protection4
Kojto 90:cb3d968589d8 352 * @{
Kojto 90:cb3d968589d8 353 */
Kojto 90:cb3d968589d8 354
Kojto 90:cb3d968589d8 355 /* Pages for Cat5 devices*/
Kojto 90:cb3d968589d8 356 #define OB_WRP4_PAGES1536TO1551 ((uint32_t)0x00000001)/* Write protection of Sector96*/
Kojto 90:cb3d968589d8 357 #define OB_WRP4_PAGES1552TO1567 ((uint32_t)0x00000002)/* Write protection of Sector97*/
Kojto 90:cb3d968589d8 358 #define OB_WRP4_PAGES1568TO1583 ((uint32_t)0x00000004)/* Write protection of Sector98*/
Kojto 90:cb3d968589d8 359 #define OB_WRP4_PAGES1584TO1599 ((uint32_t)0x00000008)/* Write protection of Sector99*/
Kojto 90:cb3d968589d8 360 #define OB_WRP4_PAGES1600TO1615 ((uint32_t)0x00000010) /* Write protection of Sector100*/
Kojto 90:cb3d968589d8 361 #define OB_WRP4_PAGES1616TO1631 ((uint32_t)0x00000020) /* Write protection of Sector101*/
Kojto 90:cb3d968589d8 362 #define OB_WRP4_PAGES1632TO1647 ((uint32_t)0x00000040) /* Write protection of Sector102*/
Kojto 90:cb3d968589d8 363 #define OB_WRP4_PAGES1648TO1663 ((uint32_t)0x00000080) /* Write protection of Sector103*/
Kojto 90:cb3d968589d8 364 #define OB_WRP4_PAGES1664TO1679 ((uint32_t)0x00000100) /* Write protection of Sector104*/
Kojto 90:cb3d968589d8 365 #define OB_WRP4_PAGES1680TO1695 ((uint32_t)0x00000200) /* Write protection of Sector105*/
Kojto 90:cb3d968589d8 366 #define OB_WRP4_PAGES1696TO1711 ((uint32_t)0x00000400) /* Write protection of Sector106*/
Kojto 90:cb3d968589d8 367 #define OB_WRP4_PAGES1712TO1727 ((uint32_t)0x00000800) /* Write protection of Sector107*/
Kojto 90:cb3d968589d8 368 #define OB_WRP4_PAGES1728TO1743 ((uint32_t)0x00001000) /* Write protection of Sector108*/
Kojto 90:cb3d968589d8 369 #define OB_WRP4_PAGES1744TO1759 ((uint32_t)0x00002000) /* Write protection of Sector109*/
Kojto 90:cb3d968589d8 370 #define OB_WRP4_PAGES1760TO1775 ((uint32_t)0x00004000) /* Write protection of Sector110*/
Kojto 90:cb3d968589d8 371 #define OB_WRP4_PAGES1776TO1791 ((uint32_t)0x00008000) /* Write protection of Sector111*/
Kojto 90:cb3d968589d8 372 #define OB_WRP4_PAGES1792TO1807 ((uint32_t)0x00010000) /* Write protection of Sector112*/
Kojto 90:cb3d968589d8 373 #define OB_WRP4_PAGES1808TO1823 ((uint32_t)0x00020000) /* Write protection of Sector113*/
Kojto 90:cb3d968589d8 374 #define OB_WRP4_PAGES1824TO1839 ((uint32_t)0x00040000) /* Write protection of Sector114*/
Kojto 90:cb3d968589d8 375 #define OB_WRP4_PAGES1840TO1855 ((uint32_t)0x00080000) /* Write protection of Sector115*/
Kojto 90:cb3d968589d8 376 #define OB_WRP4_PAGES1856TO1871 ((uint32_t)0x00100000) /* Write protection of Sector116*/
Kojto 90:cb3d968589d8 377 #define OB_WRP4_PAGES1872TO1887 ((uint32_t)0x00200000) /* Write protection of Sector117*/
Kojto 90:cb3d968589d8 378 #define OB_WRP4_PAGES1888TO1903 ((uint32_t)0x00400000) /* Write protection of Sector118*/
Kojto 90:cb3d968589d8 379 #define OB_WRP4_PAGES1904TO1919 ((uint32_t)0x00800000) /* Write protection of Sector119*/
Kojto 90:cb3d968589d8 380 #define OB_WRP4_PAGES1920TO1935 ((uint32_t)0x01000000) /* Write protection of Sector120*/
Kojto 90:cb3d968589d8 381 #define OB_WRP4_PAGES1936TO1951 ((uint32_t)0x02000000) /* Write protection of Sector121*/
Kojto 90:cb3d968589d8 382 #define OB_WRP4_PAGES1952TO1967 ((uint32_t)0x04000000) /* Write protection of Sector122*/
Kojto 90:cb3d968589d8 383 #define OB_WRP4_PAGES1968TO1983 ((uint32_t)0x08000000) /* Write protection of Sector123*/
Kojto 90:cb3d968589d8 384 #define OB_WRP4_PAGES1984TO1999 ((uint32_t)0x10000000) /* Write protection of Sector124*/
Kojto 90:cb3d968589d8 385 #define OB_WRP4_PAGES2000TO2015 ((uint32_t)0x20000000) /* Write protection of Sector125*/
Kojto 90:cb3d968589d8 386 #define OB_WRP4_PAGES2016TO2031 ((uint32_t)0x40000000) /* Write protection of Sector126*/
Kojto 90:cb3d968589d8 387 #define OB_WRP4_PAGES2032TO2047 ((uint32_t)0x80000000) /* Write protection of Sector127*/
Kojto 90:cb3d968589d8 388
Kojto 90:cb3d968589d8 389 #define OB_WRP4_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Sectors */
Kojto 90:cb3d968589d8 390
Kojto 90:cb3d968589d8 391 /**
Kojto 90:cb3d968589d8 392 * @}
Kojto 90:cb3d968589d8 393 */
Kojto 90:cb3d968589d8 394
Kojto 90:cb3d968589d8 395 #endif /* STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 396
Kojto 90:cb3d968589d8 397 /** @defgroup FLASHEx_Option_Bytes_Read_Protection FLASHEx Option Bytes Read Protection
Kojto 90:cb3d968589d8 398 * @{
Kojto 90:cb3d968589d8 399 */
Kojto 90:cb3d968589d8 400 #define OB_RDP_LEVEL0 ((uint8_t)0xAA)
Kojto 90:cb3d968589d8 401 #define OB_RDP_LEVEL1 ((uint8_t)0xBB)
Kojto 90:cb3d968589d8 402 /*#define OB_RDP_LEVEL2 ((uint8_t)0xCC)*/ /* Warning: When enabling read protection level 2
Kojto 90:cb3d968589d8 403 it's no more possible to go back to level 1 or 0 */
Kojto 90:cb3d968589d8 404
Kojto 90:cb3d968589d8 405 #define IS_OB_RDP(__LEVEL__) (((__LEVEL__) == OB_RDP_LEVEL0)||\
Kojto 90:cb3d968589d8 406 ((__LEVEL__) == OB_RDP_LEVEL1))/*||\
Kojto 90:cb3d968589d8 407 ((__LEVEL__) == OB_RDP_LEVEL2))*/
Kojto 90:cb3d968589d8 408 /**
Kojto 90:cb3d968589d8 409 * @}
Kojto 90:cb3d968589d8 410 */
Kojto 90:cb3d968589d8 411
Kojto 90:cb3d968589d8 412 /** @defgroup FLASHEx_Option_Bytes_BOR_Level FLASHEx Option Bytes BOR Level
Kojto 90:cb3d968589d8 413 * @{
Kojto 90:cb3d968589d8 414 */
Kojto 90:cb3d968589d8 415
Kojto 90:cb3d968589d8 416 #define OB_BOR_OFF ((uint8_t)0x00) /*!< BOR is disabled at power down, the reset is asserted when the VDD
Kojto 90:cb3d968589d8 417 power supply reaches the PDR(Power Down Reset) threshold (1.5V) */
Kojto 90:cb3d968589d8 418 #define OB_BOR_LEVEL1 ((uint8_t)0x08) /*!< BOR Reset threshold levels for 1.7V - 1.8V VDD power supply */
Kojto 90:cb3d968589d8 419 #define OB_BOR_LEVEL2 ((uint8_t)0x09) /*!< BOR Reset threshold levels for 1.9V - 2.0V VDD power supply */
Kojto 90:cb3d968589d8 420 #define OB_BOR_LEVEL3 ((uint8_t)0x0A) /*!< BOR Reset threshold levels for 2.3V - 2.4V VDD power supply */
Kojto 90:cb3d968589d8 421 #define OB_BOR_LEVEL4 ((uint8_t)0x0B) /*!< BOR Reset threshold levels for 2.55V - 2.65V VDD power supply */
Kojto 90:cb3d968589d8 422 #define OB_BOR_LEVEL5 ((uint8_t)0x0C) /*!< BOR Reset threshold levels for 2.8V - 2.9V VDD power supply */
Kojto 90:cb3d968589d8 423
Kojto 90:cb3d968589d8 424 #define IS_OB_BOR_LEVEL(__LEVEL__) ( ((__LEVEL__) == OB_BOR_OFF) || \
Kojto 90:cb3d968589d8 425 ((__LEVEL__) == OB_BOR_LEVEL1) || \
Kojto 90:cb3d968589d8 426 ((__LEVEL__) == OB_BOR_LEVEL2) || \
Kojto 90:cb3d968589d8 427 ((__LEVEL__) == OB_BOR_LEVEL3) || \
Kojto 90:cb3d968589d8 428 ((__LEVEL__) == OB_BOR_LEVEL4) || \
Kojto 90:cb3d968589d8 429 ((__LEVEL__) == OB_BOR_LEVEL5))
Kojto 90:cb3d968589d8 430
Kojto 90:cb3d968589d8 431 /**
Kojto 90:cb3d968589d8 432 * @}
Kojto 90:cb3d968589d8 433 */
Kojto 90:cb3d968589d8 434
Kojto 90:cb3d968589d8 435 /** @defgroup FLASHEx_Option_Bytes_IWatchdog FLASHEx Option Bytes IWatchdog
Kojto 90:cb3d968589d8 436 * @{
Kojto 90:cb3d968589d8 437 */
Kojto 90:cb3d968589d8 438
Kojto 90:cb3d968589d8 439 #define OB_IWDG_SW ((uint8_t)0x10) /*!< Software WDG selected */
Kojto 90:cb3d968589d8 440 #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware WDG selected */
Kojto 90:cb3d968589d8 441
Kojto 90:cb3d968589d8 442 #define IS_OB_IWDG_SOURCE(__SOURCE__) (((__SOURCE__) == OB_IWDG_SW) || ((__SOURCE__) == OB_IWDG_HW))
Kojto 90:cb3d968589d8 443
Kojto 90:cb3d968589d8 444 /**
Kojto 90:cb3d968589d8 445 * @}
Kojto 90:cb3d968589d8 446 */
Kojto 90:cb3d968589d8 447
Kojto 90:cb3d968589d8 448 /** @defgroup FLASHEx_Option_Bytes_nRST_STOP FLASHEx Option Bytes nRST_STOP
Kojto 90:cb3d968589d8 449 * @{
Kojto 90:cb3d968589d8 450 */
Kojto 90:cb3d968589d8 451
Kojto 90:cb3d968589d8 452 #define OB_STOP_NORST ((uint8_t)0x20) /*!< No reset generated when entering in STOP */
Kojto 90:cb3d968589d8 453 #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */
Kojto 90:cb3d968589d8 454 #define IS_OB_STOP_SOURCE(__SOURCE__) (((__SOURCE__) == OB_STOP_NORST) || ((__SOURCE__) == OB_STOP_RST))
Kojto 90:cb3d968589d8 455
Kojto 90:cb3d968589d8 456 /**
Kojto 90:cb3d968589d8 457 * @}
Kojto 90:cb3d968589d8 458 */
Kojto 90:cb3d968589d8 459
Kojto 90:cb3d968589d8 460 /** @defgroup FLASHEx_Option_Bytes_nRST_STDBY FLASHEx Option Bytes nRST_STDBY
Kojto 90:cb3d968589d8 461 * @{
Kojto 90:cb3d968589d8 462 */
Kojto 90:cb3d968589d8 463
Kojto 90:cb3d968589d8 464 #define OB_STDBY_NORST ((uint8_t)0x40) /*!< No reset generated when entering in STANDBY */
Kojto 90:cb3d968589d8 465 #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */
Kojto 90:cb3d968589d8 466 #define IS_OB_STDBY_SOURCE(__SOURCE__) (((__SOURCE__) == OB_STDBY_NORST) || ((__SOURCE__) == OB_STDBY_RST))
Kojto 90:cb3d968589d8 467
Kojto 90:cb3d968589d8 468 /**
Kojto 90:cb3d968589d8 469 * @}
Kojto 90:cb3d968589d8 470 */
Kojto 90:cb3d968589d8 471
Kojto 90:cb3d968589d8 472 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 473 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 474
Kojto 90:cb3d968589d8 475 /** @defgroup FLASHEx_OptionAdv_Type FLASHEx Option Advanced Type
Kojto 90:cb3d968589d8 476 * @{
Kojto 90:cb3d968589d8 477 */
Kojto 90:cb3d968589d8 478
Kojto 90:cb3d968589d8 479 #define OBEX_PCROP ((uint32_t)0x01) /*!<PCROP option byte configuration*/
Kojto 90:cb3d968589d8 480
Kojto 90:cb3d968589d8 481 #define IS_OBEX(__VALUE__) ((__VALUE__) == OBEX_PCROP)
Kojto 90:cb3d968589d8 482
Kojto 90:cb3d968589d8 483 /**
Kojto 90:cb3d968589d8 484 * @}
Kojto 90:cb3d968589d8 485 */
Kojto 90:cb3d968589d8 486
Kojto 90:cb3d968589d8 487 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 488
Kojto 90:cb3d968589d8 489 #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 490 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 491
Kojto 90:cb3d968589d8 492 /** @defgroup FLASHEx_OptionAdv_Type FLASHEx Option Advanced Type
Kojto 90:cb3d968589d8 493 * @{
Kojto 90:cb3d968589d8 494 */
Kojto 90:cb3d968589d8 495
Kojto 90:cb3d968589d8 496 #define OBEX_BOOTCONFIG ((uint32_t)0x02) /*!<BOOTConfig option byte configuration*/
Kojto 90:cb3d968589d8 497
Kojto 90:cb3d968589d8 498 #define IS_OBEX(__VALUE__) ((__VALUE__) == OBEX_BOOTCONFIG)
Kojto 90:cb3d968589d8 499
Kojto 90:cb3d968589d8 500 /**
Kojto 90:cb3d968589d8 501 * @}
Kojto 90:cb3d968589d8 502 */
Kojto 90:cb3d968589d8 503
Kojto 90:cb3d968589d8 504 #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 505
Kojto 90:cb3d968589d8 506 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 507 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 508
Kojto 90:cb3d968589d8 509 /** @defgroup FLASHEx_PCROP_State FLASHEx PCROP State
Kojto 90:cb3d968589d8 510 * @{
Kojto 90:cb3d968589d8 511 */
Kojto 90:cb3d968589d8 512 #define PCROPSTATE_DISABLE ((uint32_t)0x00) /*!<Disable PCROP for selected sectors */
Kojto 90:cb3d968589d8 513 #define PCROPSTATE_ENABLE ((uint32_t)0x01) /*!<Enable PCROP for selected sectors */
Kojto 90:cb3d968589d8 514
Kojto 90:cb3d968589d8 515 #define IS_PCROPSTATE(__VALUE__) (((__VALUE__) == PCROPSTATE_DISABLE) || \
Kojto 90:cb3d968589d8 516 ((__VALUE__) == PCROPSTATE_ENABLE))
Kojto 90:cb3d968589d8 517 /**
Kojto 90:cb3d968589d8 518 * @}
Kojto 90:cb3d968589d8 519 */
Kojto 90:cb3d968589d8 520
Kojto 90:cb3d968589d8 521 /** @defgroup FLASHEx_Selection_Protection_Mode FLASHEx Selection Protection Mode
Kojto 90:cb3d968589d8 522 * @{
Kojto 90:cb3d968589d8 523 */
Kojto 90:cb3d968589d8 524 #define OB_PCROP_DESELECTED ((uint16_t)0x0000) /*!< Disabled PCROP, nWPRi bits used for Write Protection on sector i */
Kojto 90:cb3d968589d8 525 #define OB_PCROP_SELECTED ((uint16_t)FLASH_OBR_SPRMOD) /*!< Enable PCROP, nWPRi bits used for PCRoP Protection on sector i */
Kojto 90:cb3d968589d8 526
Kojto 90:cb3d968589d8 527 /**
Kojto 90:cb3d968589d8 528 * @}
Kojto 90:cb3d968589d8 529 */
Kojto 90:cb3d968589d8 530
Kojto 90:cb3d968589d8 531 /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection1 FLASHEx Option Bytes PC ReadWrite Protection 1
Kojto 90:cb3d968589d8 532 * @{
Kojto 90:cb3d968589d8 533 */
Kojto 90:cb3d968589d8 534
Kojto 90:cb3d968589d8 535 /* Common pages for Cat1, Cat2, Cat3, Cat4 & Cat5 devices */
Kojto 90:cb3d968589d8 536 #define OB_PCROP1_PAGES0TO15 ((uint32_t)0x00000001) /* PC Read/Write protection of Sector0 */
Kojto 90:cb3d968589d8 537 #define OB_PCROP1_PAGES16TO31 ((uint32_t)0x00000002) /* PC Read/Write protection of Sector1 */
Kojto 90:cb3d968589d8 538 #define OB_PCROP1_PAGES32TO47 ((uint32_t)0x00000004) /* PC Read/Write protection of Sector2 */
Kojto 90:cb3d968589d8 539 #define OB_PCROP1_PAGES48TO63 ((uint32_t)0x00000008) /* PC Read/Write protection of Sector3 */
Kojto 90:cb3d968589d8 540 #define OB_PCROP1_PAGES64TO79 ((uint32_t)0x00000010) /* PC Read/Write protection of Sector4 */
Kojto 90:cb3d968589d8 541 #define OB_PCROP1_PAGES80TO95 ((uint32_t)0x00000020) /* PC Read/Write protection of Sector5 */
Kojto 90:cb3d968589d8 542 #define OB_PCROP1_PAGES96TO111 ((uint32_t)0x00000040) /* PC Read/Write protection of Sector6 */
Kojto 90:cb3d968589d8 543 #define OB_PCROP1_PAGES112TO127 ((uint32_t)0x00000080) /* PC Read/Write protection of Sector7 */
Kojto 90:cb3d968589d8 544 #define OB_PCROP1_PAGES128TO143 ((uint32_t)0x00000100) /* PC Read/Write protection of Sector8 */
Kojto 90:cb3d968589d8 545 #define OB_PCROP1_PAGES144TO159 ((uint32_t)0x00000200) /* PC Read/Write protection of Sector9 */
Kojto 90:cb3d968589d8 546 #define OB_PCROP1_PAGES160TO175 ((uint32_t)0x00000400) /* PC Read/Write protection of Sector10 */
Kojto 90:cb3d968589d8 547 #define OB_PCROP1_PAGES176TO191 ((uint32_t)0x00000800) /* PC Read/Write protection of Sector11 */
Kojto 90:cb3d968589d8 548 #define OB_PCROP1_PAGES192TO207 ((uint32_t)0x00001000) /* PC Read/Write protection of Sector12 */
Kojto 90:cb3d968589d8 549 #define OB_PCROP1_PAGES208TO223 ((uint32_t)0x00002000) /* PC Read/Write protection of Sector13 */
Kojto 90:cb3d968589d8 550 #define OB_PCROP1_PAGES224TO239 ((uint32_t)0x00004000) /* PC Read/Write protection of Sector14 */
Kojto 90:cb3d968589d8 551 #define OB_PCROP1_PAGES240TO255 ((uint32_t)0x00008000) /* PC Read/Write protection of Sector15 */
Kojto 90:cb3d968589d8 552 #define OB_PCROP1_PAGES256TO271 ((uint32_t)0x00010000) /* PC Read/Write protection of Sector16 */
Kojto 90:cb3d968589d8 553 #define OB_PCROP1_PAGES272TO287 ((uint32_t)0x00020000) /* PC Read/Write protection of Sector17 */
Kojto 90:cb3d968589d8 554 #define OB_PCROP1_PAGES288TO303 ((uint32_t)0x00040000) /* PC Read/Write protection of Sector18 */
Kojto 90:cb3d968589d8 555 #define OB_PCROP1_PAGES304TO319 ((uint32_t)0x00080000) /* PC Read/Write protection of Sector19 */
Kojto 90:cb3d968589d8 556 #define OB_PCROP1_PAGES320TO335 ((uint32_t)0x00100000) /* PC Read/Write protection of Sector20 */
Kojto 90:cb3d968589d8 557 #define OB_PCROP1_PAGES336TO351 ((uint32_t)0x00200000) /* PC Read/Write protection of Sector21 */
Kojto 90:cb3d968589d8 558 #define OB_PCROP1_PAGES352TO367 ((uint32_t)0x00400000) /* PC Read/Write protection of Sector22 */
Kojto 90:cb3d968589d8 559 #define OB_PCROP1_PAGES368TO383 ((uint32_t)0x00800000) /* PC Read/Write protection of Sector23 */
Kojto 90:cb3d968589d8 560 #define OB_PCROP1_PAGES384TO399 ((uint32_t)0x01000000) /* PC Read/Write protection of Sector24 */
Kojto 90:cb3d968589d8 561 #define OB_PCROP1_PAGES400TO415 ((uint32_t)0x02000000) /* PC Read/Write protection of Sector25 */
Kojto 90:cb3d968589d8 562 #define OB_PCROP1_PAGES416TO431 ((uint32_t)0x04000000) /* PC Read/Write protection of Sector26 */
Kojto 90:cb3d968589d8 563 #define OB_PCROP1_PAGES432TO447 ((uint32_t)0x08000000) /* PC Read/Write protection of Sector27 */
Kojto 90:cb3d968589d8 564 #define OB_PCROP1_PAGES448TO463 ((uint32_t)0x10000000) /* PC Read/Write protection of Sector28 */
Kojto 90:cb3d968589d8 565 #define OB_PCROP1_PAGES464TO479 ((uint32_t)0x20000000) /* PC Read/Write protection of Sector29 */
Kojto 90:cb3d968589d8 566 #define OB_PCROP1_PAGES480TO495 ((uint32_t)0x40000000) /* PC Read/Write protection of Sector30 */
Kojto 90:cb3d968589d8 567 #define OB_PCROP1_PAGES496TO511 ((uint32_t)0x80000000) /* PC Read/Write protection of Sector31 */
Kojto 90:cb3d968589d8 568
Kojto 90:cb3d968589d8 569 #define OB_PCROP1_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< PC Read/Write protection of all Sectors */
Kojto 90:cb3d968589d8 570
Kojto 90:cb3d968589d8 571 /**
Kojto 90:cb3d968589d8 572 * @}
Kojto 90:cb3d968589d8 573 */
Kojto 90:cb3d968589d8 574
Kojto 90:cb3d968589d8 575 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 576
Kojto 90:cb3d968589d8 577 #if defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 578
Kojto 90:cb3d968589d8 579 /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection2 FLASHEx Option Bytes PC ReadWrite Protection 2
Kojto 90:cb3d968589d8 580 * @{
Kojto 90:cb3d968589d8 581 */
Kojto 90:cb3d968589d8 582
Kojto 90:cb3d968589d8 583 /* Pages for Cat3, Cat4 & Cat5 devices*/
Kojto 90:cb3d968589d8 584 #define OB_PCROP2_PAGES512TO527 ((uint32_t)0x00000001) /* PC Read/Write protection of Sector32 */
Kojto 90:cb3d968589d8 585 #define OB_PCROP2_PAGES528TO543 ((uint32_t)0x00000002) /* PC Read/Write protection of Sector33 */
Kojto 90:cb3d968589d8 586 #define OB_PCROP2_PAGES544TO559 ((uint32_t)0x00000004) /* PC Read/Write protection of Sector34 */
Kojto 90:cb3d968589d8 587 #define OB_PCROP2_PAGES560TO575 ((uint32_t)0x00000008) /* PC Read/Write protection of Sector35 */
Kojto 90:cb3d968589d8 588 #define OB_PCROP2_PAGES576TO591 ((uint32_t)0x00000010) /* PC Read/Write protection of Sector36 */
Kojto 90:cb3d968589d8 589 #define OB_PCROP2_PAGES592TO607 ((uint32_t)0x00000020) /* PC Read/Write protection of Sector37 */
Kojto 90:cb3d968589d8 590 #define OB_PCROP2_PAGES608TO623 ((uint32_t)0x00000040) /* PC Read/Write protection of Sector38 */
Kojto 90:cb3d968589d8 591 #define OB_PCROP2_PAGES624TO639 ((uint32_t)0x00000080) /* PC Read/Write protection of Sector39 */
Kojto 90:cb3d968589d8 592 #define OB_PCROP2_PAGES640TO655 ((uint32_t)0x00000100) /* PC Read/Write protection of Sector40 */
Kojto 90:cb3d968589d8 593 #define OB_PCROP2_PAGES656TO671 ((uint32_t)0x00000200) /* PC Read/Write protection of Sector41 */
Kojto 90:cb3d968589d8 594 #define OB_PCROP2_PAGES672TO687 ((uint32_t)0x00000400) /* PC Read/Write protection of Sector42 */
Kojto 90:cb3d968589d8 595 #define OB_PCROP2_PAGES688TO703 ((uint32_t)0x00000800) /* PC Read/Write protection of Sector43 */
Kojto 90:cb3d968589d8 596 #define OB_PCROP2_PAGES704TO719 ((uint32_t)0x00001000) /* PC Read/Write protection of Sector44 */
Kojto 90:cb3d968589d8 597 #define OB_PCROP2_PAGES720TO735 ((uint32_t)0x00002000) /* PC Read/Write protection of Sector45 */
Kojto 90:cb3d968589d8 598 #define OB_PCROP2_PAGES736TO751 ((uint32_t)0x00004000) /* PC Read/Write protection of Sector46 */
Kojto 90:cb3d968589d8 599 #define OB_PCROP2_PAGES752TO767 ((uint32_t)0x00008000) /* PC Read/Write protection of Sector47 */
Kojto 90:cb3d968589d8 600 #define OB_PCROP2_PAGES768TO783 ((uint32_t)0x00010000) /* PC Read/Write protection of Sector48 */
Kojto 90:cb3d968589d8 601 #define OB_PCROP2_PAGES784TO799 ((uint32_t)0x00020000) /* PC Read/Write protection of Sector49 */
Kojto 90:cb3d968589d8 602 #define OB_PCROP2_PAGES800TO815 ((uint32_t)0x00040000) /* PC Read/Write protection of Sector50 */
Kojto 90:cb3d968589d8 603 #define OB_PCROP2_PAGES816TO831 ((uint32_t)0x00080000) /* PC Read/Write protection of Sector51 */
Kojto 90:cb3d968589d8 604 #define OB_PCROP2_PAGES832TO847 ((uint32_t)0x00100000) /* PC Read/Write protection of Sector52 */
Kojto 90:cb3d968589d8 605 #define OB_PCROP2_PAGES848TO863 ((uint32_t)0x00200000) /* PC Read/Write protection of Sector53 */
Kojto 90:cb3d968589d8 606 #define OB_PCROP2_PAGES864TO879 ((uint32_t)0x00400000) /* PC Read/Write protection of Sector54 */
Kojto 90:cb3d968589d8 607 #define OB_PCROP2_PAGES880TO895 ((uint32_t)0x00800000) /* PC Read/Write protection of Sector55 */
Kojto 90:cb3d968589d8 608 #define OB_PCROP2_PAGES896TO911 ((uint32_t)0x01000000) /* PC Read/Write protection of Sector56 */
Kojto 90:cb3d968589d8 609 #define OB_PCROP2_PAGES912TO927 ((uint32_t)0x02000000) /* PC Read/Write protection of Sector57 */
Kojto 90:cb3d968589d8 610 #define OB_PCROP2_PAGES928TO943 ((uint32_t)0x04000000) /* PC Read/Write protection of Sector58 */
Kojto 90:cb3d968589d8 611 #define OB_PCROP2_PAGES944TO959 ((uint32_t)0x08000000) /* PC Read/Write protection of Sector59 */
Kojto 90:cb3d968589d8 612 #define OB_PCROP2_PAGES960TO975 ((uint32_t)0x10000000) /* PC Read/Write protection of Sector60 */
Kojto 90:cb3d968589d8 613 #define OB_PCROP2_PAGES976TO991 ((uint32_t)0x20000000) /* PC Read/Write protection of Sector61 */
Kojto 90:cb3d968589d8 614 #define OB_PCROP2_PAGES992TO1007 ((uint32_t)0x40000000) /* PC Read/Write protection of Sector62 */
Kojto 90:cb3d968589d8 615 #define OB_PCROP2_PAGES1008TO1023 ((uint32_t)0x80000000) /* PC Read/Write protection of Sector63 */
Kojto 90:cb3d968589d8 616
Kojto 90:cb3d968589d8 617 #define OB_PCROP2_ALLPAGES ((uint32_t)0xFFFFFFFF) /*!< PC Read/Write protection of all Sectors */
Kojto 90:cb3d968589d8 618
Kojto 90:cb3d968589d8 619 /**
Kojto 90:cb3d968589d8 620 * @}
Kojto 90:cb3d968589d8 621 */
Kojto 90:cb3d968589d8 622
Kojto 90:cb3d968589d8 623 #endif /* STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 624
Kojto 90:cb3d968589d8 625 /** @defgroup FLASHEx_Type_Erase_Data FLASHEx Type Erase Data
Kojto 90:cb3d968589d8 626 * @{
Kojto 90:cb3d968589d8 627 */
Kojto 90:cb3d968589d8 628 #define TYPEERASEDATA_BYTE ((uint32_t)0x00) /*!<Erase byte (8-bit) at a specified address.*/
Kojto 90:cb3d968589d8 629 #define TYPEERASEDATA_HALFWORD ((uint32_t)0x01) /*!<Erase a half-word (16-bit) at a specified address.*/
Kojto 90:cb3d968589d8 630 #define TYPEERASEDATA_WORD ((uint32_t)0x02) /*!<Erase a word (32-bit) at a specified address.*/
Kojto 90:cb3d968589d8 631
Kojto 90:cb3d968589d8 632 #define IS_TYPEERASEDATA(__VALUE__) (((__VALUE__) == TYPEERASEDATA_BYTE) || \
Kojto 90:cb3d968589d8 633 ((__VALUE__) == TYPEERASEDATA_HALFWORD) || \
Kojto 90:cb3d968589d8 634 ((__VALUE__) == TYPEERASEDATA_WORD))
Kojto 90:cb3d968589d8 635 /**
Kojto 90:cb3d968589d8 636 * @}
Kojto 90:cb3d968589d8 637 */
Kojto 90:cb3d968589d8 638
Kojto 90:cb3d968589d8 639 /** @defgroup FLASHEx_Type_Program_Data FLASHEx Type Program Data
Kojto 90:cb3d968589d8 640 * @{
Kojto 90:cb3d968589d8 641 */
Kojto 90:cb3d968589d8 642 #define TYPEPROGRAMDATA_BYTE ((uint32_t)0x00) /*!<Program byte (8-bit) at a specified address.*/
Kojto 90:cb3d968589d8 643 #define TYPEPROGRAMDATA_HALFWORD ((uint32_t)0x01) /*!<Program a half-word (16-bit) at a specified address.*/
Kojto 90:cb3d968589d8 644 #define TYPEPROGRAMDATA_WORD ((uint32_t)0x02) /*!<Program a word (32-bit) at a specified address.*/
Kojto 90:cb3d968589d8 645 #define TYPEPROGRAMDATA_FASTBYTE ((uint32_t)0x04) /*!<Fast Program byte (8-bit) at a specified address.*/
Kojto 90:cb3d968589d8 646 #define TYPEPROGRAMDATA_FASTHALFWORD ((uint32_t)0x08) /*!<Fast Program a half-word (16-bit) at a specified address.*/
Kojto 90:cb3d968589d8 647 #define TYPEPROGRAMDATA_FASTWORD ((uint32_t)0x10) /*!<Fast Program a word (32-bit) at a specified address.*/
Kojto 90:cb3d968589d8 648
Kojto 90:cb3d968589d8 649 #define IS_TYPEPROGRAMDATA(__VALUE__) (((__VALUE__) == TYPEPROGRAMDATA_BYTE) || \
Kojto 90:cb3d968589d8 650 ((__VALUE__) == TYPEPROGRAMDATA_HALFWORD) || \
Kojto 90:cb3d968589d8 651 ((__VALUE__) == TYPEPROGRAMDATA_WORD) || \
Kojto 90:cb3d968589d8 652 ((__VALUE__) == TYPEPROGRAMDATA_FASTBYTE) || \
Kojto 90:cb3d968589d8 653 ((__VALUE__) == TYPEPROGRAMDATA_FASTHALFWORD) || \
Kojto 90:cb3d968589d8 654 ((__VALUE__) == TYPEPROGRAMDATA_FASTWORD))
Kojto 90:cb3d968589d8 655 /**
Kojto 90:cb3d968589d8 656 * @}
Kojto 90:cb3d968589d8 657 */
Kojto 90:cb3d968589d8 658
Kojto 90:cb3d968589d8 659
Kojto 90:cb3d968589d8 660 /** @defgroup FLASHEx_Address FLASHEx Address
Kojto 90:cb3d968589d8 661 * @{
Kojto 90:cb3d968589d8 662 */
Kojto 90:cb3d968589d8 663 #if defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB) || \
Kojto 90:cb3d968589d8 664 defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA)
Kojto 90:cb3d968589d8 665
Kojto 90:cb3d968589d8 666 /******* Devices with FLASH 128K *******/
Kojto 90:cb3d968589d8 667 #define FLASH_NBPAGES_MAX 512 /* 512 pages from page 0 to page 511 */
Kojto 90:cb3d968589d8 668
Kojto 90:cb3d968589d8 669 #elif defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 670 defined (STM32L151xCA) || defined (STM32L152xCA) || defined (STM32L162xCA)
Kojto 90:cb3d968589d8 671
Kojto 90:cb3d968589d8 672 /******* Devices with FLASH 256K *******/
Kojto 90:cb3d968589d8 673 #define FLASH_NBPAGES_MAX 1025 /* 1025 pages from page 0 to page 1024 */
Kojto 90:cb3d968589d8 674
Kojto 90:cb3d968589d8 675 #elif defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD)
Kojto 90:cb3d968589d8 676
Kojto 90:cb3d968589d8 677 /******* Devices with FLASH 384K *******/
Kojto 90:cb3d968589d8 678 #define FLASH_NBPAGES_MAX 1536 /* 1536 pages from page 0 to page 1535 */
Kojto 90:cb3d968589d8 679
Kojto 90:cb3d968589d8 680 #elif defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 681
Kojto 90:cb3d968589d8 682 /******* Devices with FLASH 512K *******/
Kojto 90:cb3d968589d8 683 #define FLASH_NBPAGES_MAX 2048 /* 2048 pages from page 0 to page 2047 */
Kojto 90:cb3d968589d8 684
Kojto 90:cb3d968589d8 685 #endif /* STM32L100xB || STM32L151xB || STM32L152xB || STM32L100xBA || STM32L151xBA || STM32L152xBA */
Kojto 90:cb3d968589d8 686
Kojto 90:cb3d968589d8 687 #define IS_FLASH_DATA_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_EEPROM_BASE) && ((__ADDRESS__) <= FLASH_EEPROM_END))
Kojto 90:cb3d968589d8 688
Kojto 90:cb3d968589d8 689 #if defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB) || \
Kojto 90:cb3d968589d8 690 defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 691 defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 692 defined (STM32L151xCA) || defined (STM32L152xCA) || defined (STM32L162xCA)
Kojto 90:cb3d968589d8 693
Kojto 90:cb3d968589d8 694 #define IS_FLASH_PROGRAM_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) <= FLASH_END))
Kojto 90:cb3d968589d8 695
Kojto 90:cb3d968589d8 696 #else /*STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 697
Kojto 90:cb3d968589d8 698 #define IS_FLASH_PROGRAM_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) <= FLASH_BANK2_END))
Kojto 90:cb3d968589d8 699 #define IS_FLASH_PROGRAM_BANK1_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BASE) && ((__ADDRESS__) <= FLASH_BANK1_END))
Kojto 90:cb3d968589d8 700 #define IS_FLASH_PROGRAM_BANK2_ADDRESS(__ADDRESS__) (((__ADDRESS__) >= FLASH_BANK2_BASE) && ((__ADDRESS__) <= FLASH_BANK2_END))
Kojto 90:cb3d968589d8 701
Kojto 90:cb3d968589d8 702 #endif /* STM32L100xB || STM32L151xB || STM32L152xB || STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L152xCA || STM32L162xCA */
Kojto 90:cb3d968589d8 703
Kojto 90:cb3d968589d8 704 #define IS_NBPAGES(_PAGES_) (((_PAGES_) >= 1) && ((_PAGES_) <= FLASH_NBPAGES_MAX))
Kojto 90:cb3d968589d8 705
Kojto 90:cb3d968589d8 706 /**
Kojto 90:cb3d968589d8 707 * @}
Kojto 90:cb3d968589d8 708 */
Kojto 90:cb3d968589d8 709
Kojto 90:cb3d968589d8 710 /** @defgroup FLASHEx_Flags FLASHEx Flags
Kojto 90:cb3d968589d8 711 * @{
Kojto 90:cb3d968589d8 712 */
Kojto 90:cb3d968589d8 713
Kojto 90:cb3d968589d8 714 /* Cat2 & Cat3*/
Kojto 90:cb3d968589d8 715 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 716 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 717
Kojto 90:cb3d968589d8 718 #define FLASH_FLAG_RDERR FLASH_SR_RDERR /*!< Read protected error flag */
Kojto 90:cb3d968589d8 719
Kojto 90:cb3d968589d8 720 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 721
Kojto 90:cb3d968589d8 722 /* Cat3, Cat4 & Cat5*/
Kojto 90:cb3d968589d8 723 #if defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 724 defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 725 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 726
Kojto 90:cb3d968589d8 727 #define FLASH_FLAG_OPTVERRUSR FLASH_SR_OPTVERRUSR /*!< FLASH Option User Validity error flag */
Kojto 90:cb3d968589d8 728
Kojto 90:cb3d968589d8 729 #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 730
Kojto 90:cb3d968589d8 731 /* Cat1*/
Kojto 90:cb3d968589d8 732 #if defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB) || defined (STM32L100xBA)
Kojto 90:cb3d968589d8 733
Kojto 90:cb3d968589d8 734 #define FLASH_FLAG_MASK ( FLASH_FLAG_EOP | FLASH_FLAG_ENDHV | FLASH_FLAG_WRPERR | \
Kojto 90:cb3d968589d8 735 FLASH_FLAG_OPTVERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR)
Kojto 90:cb3d968589d8 736
Kojto 90:cb3d968589d8 737 #endif /* STM32L100xB || STM32L151xB || STM32L152xB || STM32L100xBA */
Kojto 90:cb3d968589d8 738
Kojto 90:cb3d968589d8 739 /* RDERR only for STM32L151xBA & STM32L152xBA (Cat2)*/
Kojto 90:cb3d968589d8 740 #if defined (STM32L151xBA) || defined (STM32L152xBA)
Kojto 90:cb3d968589d8 741
Kojto 90:cb3d968589d8 742 #define FLASH_FLAG_MASK ( FLASH_FLAG_EOP | FLASH_FLAG_ENDHV | FLASH_FLAG_WRPERR | \
Kojto 90:cb3d968589d8 743 FLASH_FLAG_OPTVERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | \
Kojto 90:cb3d968589d8 744 FLASH_FLAG_RDERR)
Kojto 90:cb3d968589d8 745
Kojto 90:cb3d968589d8 746 #endif /* STM32L151xBA || STM32L152xBA */
Kojto 90:cb3d968589d8 747
Kojto 90:cb3d968589d8 748 /* FLASH_FLAG_OPTVERRUSR & RDERR only for STM32L151xC, STM32L152xC & STM32L152xBA (Cat3) */
Kojto 90:cb3d968589d8 749 #if defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 750
Kojto 90:cb3d968589d8 751 #define FLASH_FLAG_MASK ( FLASH_FLAG_EOP | FLASH_FLAG_ENDHV | FLASH_FLAG_WRPERR | \
Kojto 90:cb3d968589d8 752 FLASH_FLAG_OPTVERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | \
Kojto 90:cb3d968589d8 753 FLASH_FLAG_OPTVERRUSR | FLASH_FLAG_RDERR)
Kojto 90:cb3d968589d8 754
Kojto 90:cb3d968589d8 755 #endif /* STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 756
Kojto 90:cb3d968589d8 757 /* FLASH_FLAG_OPTVERRUSR only for STM32L100xC (Cat3) */
Kojto 90:cb3d968589d8 758 #if defined (STM32L100xC)
Kojto 90:cb3d968589d8 759
Kojto 90:cb3d968589d8 760 #define FLASH_FLAG_MASK ( FLASH_FLAG_EOP | FLASH_FLAG_ENDHV | FLASH_FLAG_WRPERR | \
Kojto 90:cb3d968589d8 761 FLASH_FLAG_OPTVERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | \
Kojto 90:cb3d968589d8 762 FLASH_FLAG_OPTVERRUSR)
Kojto 90:cb3d968589d8 763
Kojto 90:cb3d968589d8 764 #endif /* STM32L100xC */
Kojto 90:cb3d968589d8 765
Kojto 90:cb3d968589d8 766 /* Cat4 & Cat5 */
Kojto 90:cb3d968589d8 767 #if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 768 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 769
Kojto 90:cb3d968589d8 770 #define FLASH_FLAG_MASK ( FLASH_FLAG_EOP | FLASH_FLAG_ENDHV | FLASH_FLAG_WRPERR | \
Kojto 90:cb3d968589d8 771 FLASH_FLAG_OPTVERR | FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | \
Kojto 90:cb3d968589d8 772 FLASH_FLAG_OPTVERRUSR)
Kojto 90:cb3d968589d8 773
Kojto 90:cb3d968589d8 774 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 775
Kojto 90:cb3d968589d8 776 /**
Kojto 90:cb3d968589d8 777 * @}
Kojto 90:cb3d968589d8 778 */
Kojto 90:cb3d968589d8 779
Kojto 90:cb3d968589d8 780 #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 781 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 782
Kojto 90:cb3d968589d8 783 /** @defgroup FLASHEx_Option_Bytes_BOOT FLASHEx Option Bytes BOOT
Kojto 90:cb3d968589d8 784 * @{
Kojto 90:cb3d968589d8 785 */
Kojto 90:cb3d968589d8 786
Kojto 90:cb3d968589d8 787 #define OB_BOOT_BANK2 ((uint8_t)0x00) /*!< At startup, if boot pins are set in boot from user Flash position
Kojto 90:cb3d968589d8 788 and this parameter is selected the device will boot from Bank 2
Kojto 90:cb3d968589d8 789 or Bank 1, depending on the activation of the bank */
Kojto 90:cb3d968589d8 790 #define OB_BOOT_BANK1 ((uint8_t)(FLASH_OBR_nRST_BFB2 >> 16)) /*!< At startup, if boot pins are set in boot from user Flash position
Kojto 90:cb3d968589d8 791 and this parameter is selected the device will boot from Bank1(Default) */
Kojto 90:cb3d968589d8 792 #define IS_OB_BOOT_BANK(__BANK__) (((__BANK__) == OB_BOOT_BANK2) || ((__BANK__) == OB_BOOT_BANK1))
Kojto 90:cb3d968589d8 793
Kojto 90:cb3d968589d8 794 /**
Kojto 90:cb3d968589d8 795 * @}
Kojto 90:cb3d968589d8 796 */
Kojto 90:cb3d968589d8 797 #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 798
Kojto 90:cb3d968589d8 799 /**
Kojto 90:cb3d968589d8 800 * @}
Kojto 90:cb3d968589d8 801 */
Kojto 90:cb3d968589d8 802
Kojto 90:cb3d968589d8 803 /* Exported macro ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 804
Kojto 90:cb3d968589d8 805 /** @defgroup FLASHEx_Exported_Macros FLASHEx Exported Macros
Kojto 90:cb3d968589d8 806 * @{
Kojto 90:cb3d968589d8 807 */
Kojto 90:cb3d968589d8 808
Kojto 90:cb3d968589d8 809 /**
Kojto 90:cb3d968589d8 810 * @brief Set the FLASH Latency.
Kojto 90:cb3d968589d8 811 * @param __LATENCY__: FLASH Latency
Kojto 90:cb3d968589d8 812 * This parameter can be one of the following values:
Kojto 90:cb3d968589d8 813 * @arg FLASH_LATENCY_0: FLASH Zero Latency cycle
Kojto 90:cb3d968589d8 814 * @arg FLASH_LATENCY_1: FLASH One Latency cycle
Kojto 90:cb3d968589d8 815 * @retval none
Kojto 90:cb3d968589d8 816 */
Kojto 90:cb3d968589d8 817 #define __HAL_FLASH_SET_LATENCY(__LATENCY__) do { \
Kojto 90:cb3d968589d8 818 if ((__LATENCY__) == FLASH_LATENCY_1) {__HAL_FLASH_ACC64_ENABLE();} \
Kojto 90:cb3d968589d8 819 MODIFY_REG((FLASH->ACR), FLASH_ACR_LATENCY, (__LATENCY__)); \
Kojto 90:cb3d968589d8 820 } while(0)
Kojto 90:cb3d968589d8 821
Kojto 90:cb3d968589d8 822 /**
Kojto 90:cb3d968589d8 823 * @brief Get the FLASH Latency.
Kojto 90:cb3d968589d8 824 * @retval FLASH Latency
Kojto 90:cb3d968589d8 825 * This parameter can be one of the following values:
Kojto 90:cb3d968589d8 826 * @arg FLASH_LATENCY_0: FLASH Zero Latency cycle
Kojto 90:cb3d968589d8 827 * @arg FLASH_LATENCY_1: FLASH One Latency cycle
Kojto 90:cb3d968589d8 828 */
Kojto 90:cb3d968589d8 829 #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
Kojto 90:cb3d968589d8 830
Kojto 90:cb3d968589d8 831 /**
Kojto 90:cb3d968589d8 832 * @brief Enable the FLASH 64-bit access.
Kojto 90:cb3d968589d8 833 * @note Read access 64 bit is used.
Kojto 90:cb3d968589d8 834 * @note This bit cannot be written at the same time as the LATENCY and
Kojto 90:cb3d968589d8 835 * PRFTEN bits.
Kojto 90:cb3d968589d8 836 * @retval none
Kojto 90:cb3d968589d8 837 */
Kojto 90:cb3d968589d8 838 #define __HAL_FLASH_ACC64_ENABLE() (SET_BIT((FLASH->ACR), FLASH_ACR_ACC64))
Kojto 90:cb3d968589d8 839
Kojto 90:cb3d968589d8 840 /**
Kojto 90:cb3d968589d8 841 * @brief Disable the FLASH 64-bit access.
Kojto 90:cb3d968589d8 842 * @note Read access 32 bit is used
Kojto 90:cb3d968589d8 843 * @note To reset this bit, the LATENCY should be zero wait state and the
Kojto 90:cb3d968589d8 844 * prefetch off.
Kojto 90:cb3d968589d8 845 * @retval none
Kojto 90:cb3d968589d8 846 */
Kojto 90:cb3d968589d8 847 #define __HAL_FLASH_ACC64_DISABLE() (CLEAR_BIT((FLASH->ACR), FLASH_ACR_ACC64))
Kojto 90:cb3d968589d8 848
Kojto 90:cb3d968589d8 849 /**
Kojto 90:cb3d968589d8 850 * @brief Enable the FLASH prefetch buffer.
Kojto 90:cb3d968589d8 851 * @retval none
Kojto 90:cb3d968589d8 852 */
Kojto 90:cb3d968589d8 853 #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() do { __HAL_FLASH_ACC64_ENABLE(); \
Kojto 90:cb3d968589d8 854 SET_BIT((FLASH->ACR), FLASH_ACR_PRFTEN); \
Kojto 90:cb3d968589d8 855 } while(0)
Kojto 90:cb3d968589d8 856
Kojto 90:cb3d968589d8 857 /**
Kojto 90:cb3d968589d8 858 * @brief Disable the FLASH prefetch buffer.
Kojto 90:cb3d968589d8 859 * @retval none
Kojto 90:cb3d968589d8 860 */
Kojto 90:cb3d968589d8 861 #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() CLEAR_BIT((FLASH->ACR), FLASH_ACR_PRFTEN)
Kojto 90:cb3d968589d8 862
Kojto 90:cb3d968589d8 863 /**
Kojto 90:cb3d968589d8 864 * @brief Enable the FLASH power down during Sleep mode
Kojto 90:cb3d968589d8 865 * @retval none
Kojto 90:cb3d968589d8 866 */
Kojto 90:cb3d968589d8 867 #define __HAL_FLASH_SLEEP_POWERDOWN_ENABLE() SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
Kojto 90:cb3d968589d8 868
Kojto 90:cb3d968589d8 869 /**
Kojto 90:cb3d968589d8 870 * @brief Disable the FLASH power down during Sleep mode
Kojto 90:cb3d968589d8 871 * @retval none
Kojto 90:cb3d968589d8 872 */
Kojto 90:cb3d968589d8 873 #define __HAL_FLASH_SLEEP_POWERDOWN_DISABLE() CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
Kojto 90:cb3d968589d8 874
Kojto 90:cb3d968589d8 875 /**
Kojto 90:cb3d968589d8 876 * @brief Macro to enable or disable the Flash Run power down mode.
Kojto 90:cb3d968589d8 877 * @note Writing this bit to 0 this bit, automatically the keys are
Kojto 90:cb3d968589d8 878 * loss and a new unlock sequence is necessary to re-write it to 1.
Kojto 90:cb3d968589d8 879 */
Kojto 90:cb3d968589d8 880
Kojto 90:cb3d968589d8 881 #define __HAL_FLASH_POWER_DOWN_ENABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \
Kojto 90:cb3d968589d8 882 FLASH->PDKEYR = FLASH_PDKEY2; \
Kojto 90:cb3d968589d8 883 SET_BIT((FLASH->ACR), FLASH_ACR_RUN_PD); \
Kojto 90:cb3d968589d8 884 } while (0)
Kojto 90:cb3d968589d8 885
Kojto 90:cb3d968589d8 886 #define __HAL_FLASH_POWER_DOWN_DISABLE() do { FLASH->PDKEYR = FLASH_PDKEY1; \
Kojto 90:cb3d968589d8 887 FLASH->PDKEYR = FLASH_PDKEY2; \
Kojto 90:cb3d968589d8 888 CLEAR_BIT((FLASH->ACR), FLASH_ACR_RUN_PD); \
Kojto 90:cb3d968589d8 889 } while (0)
Kojto 90:cb3d968589d8 890
Kojto 90:cb3d968589d8 891 /**
Kojto 90:cb3d968589d8 892 * @}
Kojto 90:cb3d968589d8 893 */
Kojto 90:cb3d968589d8 894
Kojto 90:cb3d968589d8 895 /* Exported functions --------------------------------------------------------*/
Kojto 90:cb3d968589d8 896
Kojto 90:cb3d968589d8 897 /** @addtogroup FLASHEx_Exported_Functions
Kojto 90:cb3d968589d8 898 * @{
Kojto 90:cb3d968589d8 899 */
Kojto 90:cb3d968589d8 900
Kojto 90:cb3d968589d8 901 /** @addtogroup FLASHEx_Exported_Functions_Group1
Kojto 90:cb3d968589d8 902 * @{
Kojto 90:cb3d968589d8 903 */
Kojto 90:cb3d968589d8 904
Kojto 90:cb3d968589d8 905 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
Kojto 90:cb3d968589d8 906 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
Kojto 90:cb3d968589d8 907
Kojto 90:cb3d968589d8 908 /**
Kojto 90:cb3d968589d8 909 * @}
Kojto 90:cb3d968589d8 910 */
Kojto 90:cb3d968589d8 911
Kojto 90:cb3d968589d8 912 /** @addtogroup FLASHEx_Exported_Functions_Group2
Kojto 90:cb3d968589d8 913 * @{
Kojto 90:cb3d968589d8 914 */
Kojto 90:cb3d968589d8 915
Kojto 90:cb3d968589d8 916 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
Kojto 90:cb3d968589d8 917 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
Kojto 90:cb3d968589d8 918
Kojto 90:cb3d968589d8 919 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 920 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || \
Kojto 90:cb3d968589d8 921 defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD) || \
Kojto 90:cb3d968589d8 922 defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 90:cb3d968589d8 923
Kojto 90:cb3d968589d8 924 HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
Kojto 90:cb3d968589d8 925 void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
Kojto 90:cb3d968589d8 926
Kojto 90:cb3d968589d8 927 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
Kojto 90:cb3d968589d8 928
Kojto 90:cb3d968589d8 929 #if defined (STM32L151xBA) || defined (STM32L152xBA) || \
Kojto 90:cb3d968589d8 930 defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 90:cb3d968589d8 931
Kojto 90:cb3d968589d8 932 HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void);
Kojto 90:cb3d968589d8 933 HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void);
Kojto 90:cb3d968589d8 934
Kojto 90:cb3d968589d8 935 #endif /* STM32L151xBA || STM32L152xBA || STM32L151xC || STM32L152xC || STM32L162xC */
Kojto 90:cb3d968589d8 936
Kojto 90:cb3d968589d8 937 /**
Kojto 90:cb3d968589d8 938 * @}
Kojto 90:cb3d968589d8 939 */
Kojto 90:cb3d968589d8 940
Kojto 90:cb3d968589d8 941 /** @addtogroup FLASHEx_Exported_Functions_Group3
Kojto 90:cb3d968589d8 942 * @{
Kojto 90:cb3d968589d8 943 */
Kojto 90:cb3d968589d8 944
Kojto 90:cb3d968589d8 945 HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Unlock(void);
Kojto 90:cb3d968589d8 946 HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Lock(void);
Kojto 90:cb3d968589d8 947
Kojto 90:cb3d968589d8 948 HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Erase(uint32_t TypeErase, uint32_t Address);
Kojto 90:cb3d968589d8 949 HAL_StatusTypeDef HAL_FLASHEx_DATAEEPROM_Program(uint32_t TypeProgram, uint32_t Address, uint32_t Data);
Kojto 90:cb3d968589d8 950 void HAL_FLASHEx_DATAEEPROM_EnableFixedTimeProgram(void);
Kojto 90:cb3d968589d8 951 void HAL_FLASHEx_DATAEEPROM_DisableFixedTimeProgram(void);
Kojto 90:cb3d968589d8 952
Kojto 90:cb3d968589d8 953 /**
Kojto 90:cb3d968589d8 954 * @}
Kojto 90:cb3d968589d8 955 */
Kojto 90:cb3d968589d8 956
Kojto 90:cb3d968589d8 957 /**
Kojto 90:cb3d968589d8 958 * @}
Kojto 90:cb3d968589d8 959 */
Kojto 90:cb3d968589d8 960
Kojto 90:cb3d968589d8 961 /**
Kojto 90:cb3d968589d8 962 * @}
Kojto 90:cb3d968589d8 963 */
Kojto 90:cb3d968589d8 964
Kojto 90:cb3d968589d8 965 /**
Kojto 90:cb3d968589d8 966 * @}
Kojto 90:cb3d968589d8 967 */
Kojto 90:cb3d968589d8 968
Kojto 90:cb3d968589d8 969 #ifdef __cplusplus
Kojto 90:cb3d968589d8 970 }
Kojto 90:cb3d968589d8 971 #endif
Kojto 90:cb3d968589d8 972
Kojto 90:cb3d968589d8 973 #endif /* __STM32L1xx_HAL_FLASH_EX_H */
Kojto 90:cb3d968589d8 974
Kojto 90:cb3d968589d8 975 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/