A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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