annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_flash_ex.h @ 49:1e707b34667e

add o4pack files
author heinrichsweikamp
date Mon, 30 Jul 2018 11:31:20 +0200
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_flash_ex.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of FLASH HAL Extension module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_FLASH_EX_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_FLASH_EX_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_hal_def.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /** @addtogroup FLASHEx
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 /** @defgroup FLASHEx_Exported_Types FLASH Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 * @brief FLASH Erase structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint32_t TypeErase; /*!< Mass erase or sector Erase.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 This parameter can be a value of @ref FLASHEx_Type_Erase */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 uint32_t Banks; /*!< Select banks to erase when Mass erase is enabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 This parameter must be a value of @ref FLASHEx_Banks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 uint32_t Sector; /*!< Initial FLASH sector to erase when Mass erase is disabled
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 This parameter must be a value of @ref FLASHEx_Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint32_t NbSectors; /*!< Number of sectors to be erased.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 This parameter must be a value between 1 and (max number of sectors - value of Initial sector)*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 uint32_t VoltageRange;/*!< The device voltage range which defines the erase parallelism
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 This parameter must be a value of @ref FLASHEx_Voltage_Range */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 } FLASH_EraseInitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 * @brief FLASH Option Bytes Program structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 uint32_t OptionType; /*!< Option byte to be configured.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 This parameter can be a value of @ref FLASHEx_Option_Type */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint32_t WRPState; /*!< Write protection activation or deactivation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 This parameter can be a value of @ref FLASHEx_WRP_State */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 uint32_t WRPSector; /*!< Specifies the sector(s) to be write protected.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 The value of this parameter depend on device used within the same series */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 uint32_t Banks; /*!< Select banks for WRP activation/deactivation of all sectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 This parameter must be a value of @ref FLASHEx_Banks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 uint32_t RDPLevel; /*!< Set the read protection level.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 This parameter can be a value of @ref FLASHEx_Option_Bytes_Read_Protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 uint32_t BORLevel; /*!< Set the BOR Level.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 This parameter can be a value of @ref FLASHEx_BOR_Reset_Level */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 uint8_t USERConfig; /*!< Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 } FLASH_OBProgramInitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 * @brief FLASH Advanced Option Bytes Program structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 uint32_t OptionType; /*!< Option byte to be configured for extension.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 This parameter can be a value of @ref FLASHEx_Advanced_Option_Type */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 uint32_t PCROPState; /*!< PCROP activation or deactivation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 This parameter can be a value of @ref FLASHEx_PCROP_State */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 #if defined (STM32F401xC) || defined (STM32F401xE) || defined (STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 uint16_t Sectors; /*!< specifies the sector(s) set for PCROP.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 #endif /* STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 uint32_t Banks; /*!< Select banks for PCROP activation/deactivation of all sectors.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 This parameter must be a value of @ref FLASHEx_Banks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 uint16_t SectorsBank1; /*!< Specifies the sector(s) set for PCROP for Bank1.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 uint16_t SectorsBank2; /*!< Specifies the sector(s) set for PCROP for Bank2.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 uint8_t BootConfig; /*!< Specifies Option bytes for boot config.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 This parameter can be a value of @ref FLASHEx_Dual_Boot */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 #endif /*STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 } FLASH_AdvOBProgramInitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 /** @defgroup FLASHEx_Exported_Constants FLASH Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 /** @defgroup FLASHEx_Type_Erase FLASH Type Erase
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 #define FLASH_TYPEERASE_SECTORS ((uint32_t)0x00) /*!< Sectors erase only */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 #define FLASH_TYPEERASE_MASSERASE ((uint32_t)0x01) /*!< Flash Mass erase activation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 /** @defgroup FLASHEx_Voltage_Range FLASH Voltage Range
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 #define FLASH_VOLTAGE_RANGE_1 ((uint32_t)0x00) /*!< Device operating range: 1.8V to 2.1V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 #define FLASH_VOLTAGE_RANGE_2 ((uint32_t)0x01) /*!< Device operating range: 2.1V to 2.7V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 #define FLASH_VOLTAGE_RANGE_3 ((uint32_t)0x02) /*!< Device operating range: 2.7V to 3.6V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 #define FLASH_VOLTAGE_RANGE_4 ((uint32_t)0x03) /*!< Device operating range: 2.7V to 3.6V + External Vpp */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 /** @defgroup FLASHEx_WRP_State FLASH WRP State
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 #define OB_WRPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable the write protection of the desired bank 1 sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 #define OB_WRPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable the write protection of the desired bank 1 sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 /** @defgroup FLASHEx_Option_Type FLASH Option Type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 #define OPTIONBYTE_WRP ((uint32_t)0x01) /*!< WRP option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 #define OPTIONBYTE_RDP ((uint32_t)0x02) /*!< RDP option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 #define OPTIONBYTE_USER ((uint32_t)0x04) /*!< USER option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 #define OPTIONBYTE_BOR ((uint32_t)0x08) /*!< BOR option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 /** @defgroup FLASHEx_Option_Bytes_Read_Protection FLASH Option Bytes Read Protection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 #define OB_RDP_LEVEL_0 ((uint8_t)0xAA)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 #define OB_RDP_LEVEL_1 ((uint8_t)0x55)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 /*#define OB_RDP_LEVEL_2 ((uint8_t)0xCC)*/ /*!< Warning: When enabling read protection level 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 it s no more possible to go back to level 1 or 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 /** @defgroup FLASHEx_Option_Bytes_IWatchdog FLASH Option Bytes IWatchdog
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 #define OB_IWDG_SW ((uint8_t)0x20) /*!< Software IWDG selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware IWDG selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 /** @defgroup FLASHEx_Option_Bytes_nRST_STOP FLASH Option Bytes nRST_STOP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 #define OB_STOP_NO_RST ((uint8_t)0x40) /*!< No reset generated when entering in STOP */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 /** @defgroup FLASHEx_Option_Bytes_nRST_STDBY FLASH Option Bytes nRST_STDBY
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 #define OB_STDBY_NO_RST ((uint8_t)0x80) /*!< No reset generated when entering in STANDBY */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 /** @defgroup FLASHEx_BOR_Reset_Level FLASH BOR Reset Level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 #define OB_BOR_LEVEL3 ((uint8_t)0x00) /*!< Supply voltage ranges from 2.70 to 3.60 V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 #define OB_BOR_LEVEL2 ((uint8_t)0x04) /*!< Supply voltage ranges from 2.40 to 2.70 V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 #define OB_BOR_LEVEL1 ((uint8_t)0x08) /*!< Supply voltage ranges from 2.10 to 2.40 V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 #define OB_BOR_OFF ((uint8_t)0x0C) /*!< Supply voltage ranges from 1.62 to 2.10 V */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 /** @defgroup FLASHEx_PCROP_State FLASH PCROP State
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 #define OB_PCROP_STATE_DISABLE ((uint32_t)0x00) /*!< Disable PCROP */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 #define OB_PCROP_STATE_ENABLE ((uint32_t)0x01) /*!< Enable PCROP */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 /** @defgroup FLASHEx_Advanced_Option_Type FLASH Advanced Option Type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 #define OPTIONBYTE_PCROP ((uint32_t)0x01) /*!< PCROP option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 #define OPTIONBYTE_BOOTCONFIG ((uint32_t)0x02) /*!< BOOTConfig option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 #define OPTIONBYTE_PCROP ((uint32_t)0x01) /*!<PCROP option byte configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 #endif /* STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 /** @defgroup FLASH_Latency FLASH Latency
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 /*------------------------------------------- STM32F42xxx/STM32F43xxx------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 #define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero Latency cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One Latency cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 #define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 #define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 #define FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 #define FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH Five Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 #define FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH Six Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 #define FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH Seven Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 #define FLASH_LATENCY_8 FLASH_ACR_LATENCY_8WS /*!< FLASH Eight Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 #define FLASH_LATENCY_9 FLASH_ACR_LATENCY_9WS /*!< FLASH Nine Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 #define FLASH_LATENCY_10 FLASH_ACR_LATENCY_10WS /*!< FLASH Ten Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 #define FLASH_LATENCY_11 FLASH_ACR_LATENCY_11WS /*!< FLASH Eleven Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 #define FLASH_LATENCY_12 FLASH_ACR_LATENCY_12WS /*!< FLASH Twelve Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 #define FLASH_LATENCY_13 FLASH_ACR_LATENCY_13WS /*!< FLASH Thirteen Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 #define FLASH_LATENCY_14 FLASH_ACR_LATENCY_14WS /*!< FLASH Fourteen Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 #define FLASH_LATENCY_15 FLASH_ACR_LATENCY_15WS /*!< FLASH Fifteen Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 /*--------------------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 /*-------------------------- STM32F40xxx/STM32F41xxx/STM32F401xx/STM32F411xx -----------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 #define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero Latency cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 #define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One Latency cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 #define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 #define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 #define FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 #define FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH Five Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 #define FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH Six Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 #define FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH Seven Latency cycles */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 /*--------------------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 /** @defgroup FLASHEx_Banks FLASH Banks
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 #define FLASH_BANK_1 ((uint32_t)1) /*!< Bank 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 #define FLASH_BANK_2 ((uint32_t)2) /*!< Bank 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #define FLASH_BANK_BOTH ((uint32_t)FLASH_BANK_1 | FLASH_BANK_2) /*!< Bank1 and Bank2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 #define FLASH_BANK_1 ((uint32_t)1) /*!< Bank 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 /** @defgroup FLASHEx_MassErase_bit FLASH Mass Erase bit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 #define FLASH_MER_BIT (FLASH_CR_MER1 | FLASH_CR_MER2) /*!< 2 MER bits here to clear */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 #define FLASH_MER_BIT (FLASH_CR_MER) /*!< only 1 MER Bit */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 /** @defgroup FLASHEx_Sectors FLASH Sectors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 /*------------------------------------------ STM32F42xxx/STM32F43xxx--------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 #define FLASH_SECTOR_8 ((uint32_t)8) /*!< Sector Number 8 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define FLASH_SECTOR_9 ((uint32_t)9) /*!< Sector Number 9 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 #define FLASH_SECTOR_10 ((uint32_t)10) /*!< Sector Number 10 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 #define FLASH_SECTOR_11 ((uint32_t)11) /*!< Sector Number 11 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #define FLASH_SECTOR_12 ((uint32_t)12) /*!< Sector Number 12 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 #define FLASH_SECTOR_13 ((uint32_t)13) /*!< Sector Number 13 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 #define FLASH_SECTOR_14 ((uint32_t)14) /*!< Sector Number 14 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 #define FLASH_SECTOR_15 ((uint32_t)15) /*!< Sector Number 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 #define FLASH_SECTOR_16 ((uint32_t)16) /*!< Sector Number 16 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 #define FLASH_SECTOR_17 ((uint32_t)17) /*!< Sector Number 17 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 #define FLASH_SECTOR_18 ((uint32_t)18) /*!< Sector Number 18 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 #define FLASH_SECTOR_19 ((uint32_t)19) /*!< Sector Number 19 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 #define FLASH_SECTOR_20 ((uint32_t)20) /*!< Sector Number 20 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 #define FLASH_SECTOR_21 ((uint32_t)21) /*!< Sector Number 21 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 #define FLASH_SECTOR_22 ((uint32_t)22) /*!< Sector Number 22 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 #define FLASH_SECTOR_23 ((uint32_t)23) /*!< Sector Number 23 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 #define FLASH_SECTOR_8 ((uint32_t)8) /*!< Sector Number 8 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 #define FLASH_SECTOR_9 ((uint32_t)9) /*!< Sector Number 9 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 #define FLASH_SECTOR_10 ((uint32_t)10) /*!< Sector Number 10 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 #define FLASH_SECTOR_11 ((uint32_t)11) /*!< Sector Number 11 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 /*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 #define FLASH_SECTOR_0 ((uint32_t)0) /*!< Sector Number 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 #define FLASH_SECTOR_1 ((uint32_t)1) /*!< Sector Number 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 #define FLASH_SECTOR_2 ((uint32_t)2) /*!< Sector Number 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 #define FLASH_SECTOR_3 ((uint32_t)3) /*!< Sector Number 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 #define FLASH_SECTOR_4 ((uint32_t)4) /*!< Sector Number 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 #define FLASH_SECTOR_5 ((uint32_t)5) /*!< Sector Number 5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 #define FLASH_SECTOR_6 ((uint32_t)6) /*!< Sector Number 6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 #define FLASH_SECTOR_7 ((uint32_t)7) /*!< Sector Number 7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 /** @defgroup FLASHEx_Option_Bytes_Write_Protection FLASH Option Bytes Write Protection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 /*----------------------------------------- STM32F42xxx/STM32F43xxx-------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 #define OB_WRP_SECTOR_8 ((uint32_t)0x00000100) /*!< Write protection of Sector8 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 #define OB_WRP_SECTOR_9 ((uint32_t)0x00000200) /*!< Write protection of Sector9 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 #define OB_WRP_SECTOR_10 ((uint32_t)0x00000400) /*!< Write protection of Sector10 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 #define OB_WRP_SECTOR_11 ((uint32_t)0x00000800) /*!< Write protection of Sector11 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 #define OB_WRP_SECTOR_12 ((uint32_t)0x00000001 << 12) /*!< Write protection of Sector12 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 #define OB_WRP_SECTOR_13 ((uint32_t)0x00000002 << 12) /*!< Write protection of Sector13 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 #define OB_WRP_SECTOR_14 ((uint32_t)0x00000004 << 12) /*!< Write protection of Sector14 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 #define OB_WRP_SECTOR_15 ((uint32_t)0x00000008 << 12) /*!< Write protection of Sector15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 #define OB_WRP_SECTOR_16 ((uint32_t)0x00000010 << 12) /*!< Write protection of Sector16 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 #define OB_WRP_SECTOR_17 ((uint32_t)0x00000020 << 12) /*!< Write protection of Sector17 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 #define OB_WRP_SECTOR_18 ((uint32_t)0x00000040 << 12) /*!< Write protection of Sector18 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 #define OB_WRP_SECTOR_19 ((uint32_t)0x00000080 << 12) /*!< Write protection of Sector19 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 #define OB_WRP_SECTOR_20 ((uint32_t)0x00000100 << 12) /*!< Write protection of Sector20 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 #define OB_WRP_SECTOR_21 ((uint32_t)0x00000200 << 12) /*!< Write protection of Sector21 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 #define OB_WRP_SECTOR_22 ((uint32_t)0x00000400 << 12) /*!< Write protection of Sector22 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 #define OB_WRP_SECTOR_23 ((uint32_t)0x00000800 << 12) /*!< Write protection of Sector23 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF << 12) /*!< Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 #define OB_WRP_SECTOR_8 ((uint32_t)0x00000100) /*!< Write protection of Sector8 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 #define OB_WRP_SECTOR_9 ((uint32_t)0x00000200) /*!< Write protection of Sector9 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 #define OB_WRP_SECTOR_10 ((uint32_t)0x00000400) /*!< Write protection of Sector10 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 #define OB_WRP_SECTOR_11 ((uint32_t)0x00000800) /*!< Write protection of Sector11 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 /*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 #define OB_WRP_SECTOR_3 ((uint32_t)0x00000008) /*!< Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 /** @defgroup FLASHEx_Option_Bytes_PC_ReadWrite_Protection FLASH Option Bytes PC ReadWrite Protection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 /*----------------------------------------- STM32F42xxx/STM32F43xxx-------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 #define OB_PCROP_SECTOR_6 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 #define OB_PCROP_SECTOR_7 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 #define OB_PCROP_SECTOR_8 ((uint32_t)0x00000100) /*!< PC Read/Write protection of Sector8 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 #define OB_PCROP_SECTOR_9 ((uint32_t)0x00000200) /*!< PC Read/Write protection of Sector9 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 #define OB_PCROP_SECTOR_10 ((uint32_t)0x00000400) /*!< PC Read/Write protection of Sector10 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 #define OB_PCROP_SECTOR_11 ((uint32_t)0x00000800) /*!< PC Read/Write protection of Sector11 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 #define OB_PCROP_SECTOR_12 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector12 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 #define OB_PCROP_SECTOR_13 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector13 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 #define OB_PCROP_SECTOR_14 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector14 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 #define OB_PCROP_SECTOR_15 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 #define OB_PCROP_SECTOR_16 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector16 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 #define OB_PCROP_SECTOR_17 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector17 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 #define OB_PCROP_SECTOR_18 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector18 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 #define OB_PCROP_SECTOR_19 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector19 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 #define OB_PCROP_SECTOR_20 ((uint32_t)0x00000100) /*!< PC Read/Write protection of Sector20 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 #define OB_PCROP_SECTOR_21 ((uint32_t)0x00000200) /*!< PC Read/Write protection of Sector21 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 #define OB_PCROP_SECTOR_22 ((uint32_t)0x00000400) /*!< PC Read/Write protection of Sector22 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 #define OB_PCROP_SECTOR_23 ((uint32_t)0x00000800) /*!< PC Read/Write protection of Sector23 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 /*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 #define OB_PCROP_SECTOR_3 ((uint32_t)0x00000008) /*!< PC Read/Write protection of Sector3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 #define OB_PCROP_SECTOR_6 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 #define OB_PCROP_SECTOR_7 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 /*-----------------------------------------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 /** @defgroup FLASHEx_Dual_Boot FLASH Dual Boot
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 #define OB_DUAL_BOOT_ENABLE ((uint8_t)0x10) /*!< Dual Bank Boot Enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 #define OB_DUAL_BOOT_DISABLE ((uint8_t)0x00) /*!< Dual Bank Boot Disable, always boot on User Flash */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 /** @defgroup FLASHEx_Selection_Protection_Mode FLASH Selection Protection Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 #define OB_PCROP_DESELECTED ((uint8_t)0x00) /*!< Disabled PcROP, nWPRi bits used for Write Protection on sector i */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 #define OB_PCROP_SELECTED ((uint8_t)0x80) /*!< Enable PcROP, nWPRi bits used for PCRoP Protection on sector i */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 /** @addtogroup FLASHEx_Exported_Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 /** @addtogroup FLASHEx_Exported_Functions_Group1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 /* Extension Program operation functions *************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 uint16_t HAL_FLASHEx_OB_GetBank2WRP(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 /* Private constants ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 /** @defgroup FLASHEx_Private_Constants FLASH Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 /*--------------------------------------- STM32F42xxx/STM32F43xxx--------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 #define FLASH_SECTOR_TOTAL 24
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 /*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 #define FLASH_SECTOR_TOTAL 12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 /*--------------------------------------------- STM32F401xC -------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 #define FLASH_SECTOR_TOTAL 6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 /*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 #define FLASH_SECTOR_TOTAL 8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 * @brief OPTCR1 register byte 2 (Bits[23:16]) base address
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 #define OPTCR1_BYTE2_ADDRESS ((uint32_t)0x40023C1A)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 /** @defgroup FLASHEx_Private_Macros FLASH Private Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 /** @defgroup FLASHEx_IS_FLASH_Definitions FLASH Private macros to check input parameters
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 #define IS_FLASH_TYPEERASE(VALUE)(((VALUE) == FLASH_TYPEERASE_SECTORS) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 ((VALUE) == FLASH_TYPEERASE_MASSERASE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 #define IS_VOLTAGERANGE(RANGE)(((RANGE) == FLASH_VOLTAGE_RANGE_1) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 ((RANGE) == FLASH_VOLTAGE_RANGE_2) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 ((RANGE) == FLASH_VOLTAGE_RANGE_3) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 ((RANGE) == FLASH_VOLTAGE_RANGE_4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 #define IS_WRPSTATE(VALUE)(((VALUE) == OB_WRPSTATE_DISABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 ((VALUE) == OB_WRPSTATE_ENABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 #define IS_OPTIONBYTE(VALUE)(((VALUE) <= (OPTIONBYTE_WRP|OPTIONBYTE_RDP|OPTIONBYTE_USER|OPTIONBYTE_BOR)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 #define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 ((LEVEL) == OB_RDP_LEVEL_1))/*||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 ((LEVEL) == OB_RDP_LEVEL_2))*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 #define IS_OB_BOR_LEVEL(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 #define IS_PCROPSTATE(VALUE)(((VALUE) == OB_PCROP_STATE_DISABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 ((VALUE) == OB_PCROP_STATE_ENABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 #define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 ((VALUE) == OPTIONBYTE_BOOTCONFIG))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 #define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 #endif /* STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 ((LATENCY) == FLASH_LATENCY_1) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 ((LATENCY) == FLASH_LATENCY_2) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 ((LATENCY) == FLASH_LATENCY_3) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 ((LATENCY) == FLASH_LATENCY_4) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 ((LATENCY) == FLASH_LATENCY_5) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 ((LATENCY) == FLASH_LATENCY_6) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 ((LATENCY) == FLASH_LATENCY_7) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 ((LATENCY) == FLASH_LATENCY_8) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 ((LATENCY) == FLASH_LATENCY_9) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 ((LATENCY) == FLASH_LATENCY_10) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 ((LATENCY) == FLASH_LATENCY_11) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 ((LATENCY) == FLASH_LATENCY_12) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 ((LATENCY) == FLASH_LATENCY_13) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 ((LATENCY) == FLASH_LATENCY_14) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 ((LATENCY) == FLASH_LATENCY_15))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 ((LATENCY) == FLASH_LATENCY_1) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 ((LATENCY) == FLASH_LATENCY_2) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 ((LATENCY) == FLASH_LATENCY_3) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 ((LATENCY) == FLASH_LATENCY_4) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 ((LATENCY) == FLASH_LATENCY_5) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 ((LATENCY) == FLASH_LATENCY_6) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 ((LATENCY) == FLASH_LATENCY_7))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 #define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 ((BANK) == FLASH_BANK_2) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 ((BANK) == FLASH_BANK_BOTH))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 #define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 #define IS_FLASH_SECTOR(SECTOR) ( ((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 ((SECTOR) == FLASH_SECTOR_12) || ((SECTOR) == FLASH_SECTOR_13) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 ((SECTOR) == FLASH_SECTOR_14) || ((SECTOR) == FLASH_SECTOR_15) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 ((SECTOR) == FLASH_SECTOR_16) || ((SECTOR) == FLASH_SECTOR_17) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 ((SECTOR) == FLASH_SECTOR_18) || ((SECTOR) == FLASH_SECTOR_19) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 ((SECTOR) == FLASH_SECTOR_20) || ((SECTOR) == FLASH_SECTOR_21) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 ((SECTOR) == FLASH_SECTOR_22) || ((SECTOR) == FLASH_SECTOR_23))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 #define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 #define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= FLASH_END))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 #define IS_FLASH_NBSECTORS(NBSECTORS) (((NBSECTORS) != 0) && ((NBSECTORS) <= FLASH_SECTOR_TOTAL))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFF000000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 #define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 #if defined(STM32F401xC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 #endif /* STM32F401xC */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 #if defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 #define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 #endif /* STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 #define IS_OB_BOOT(BOOT) (((BOOT) == OB_DUAL_BOOT_ENABLE) || ((BOOT) == OB_DUAL_BOOT_DISABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 #define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PCROP_SELECTED) || ((PCROP) == OB_PCROP_DESELECTED))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 /** @defgroup FLASHEx_Private_Functions FLASH Private Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 #endif /* __STM32F4xx_HAL_FLASH_EX_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/