mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F303VC/stm32f30x_flash.h@157:90e3acc479a2, 2014-04-11 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Apr 11 17:15:06 2014 +0100
- Revision:
- 157:90e3acc479a2
Synchronized with git revision 6e20ca17847dceb62132bf3d8519876411e175bf
Full URL: https://github.com/mbedmicro/mbed/commit/6e20ca17847dceb62132bf3d8519876411e175bf/
[STM32F3-Discovery][DISCO_F303VC] initial port.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 157:90e3acc479a2 | 1 | /** |
mbed_official | 157:90e3acc479a2 | 2 | ****************************************************************************** |
mbed_official | 157:90e3acc479a2 | 3 | * @file stm32f30x_flash.h |
mbed_official | 157:90e3acc479a2 | 4 | * @author MCD Application Team |
mbed_official | 157:90e3acc479a2 | 5 | * @version V1.1.0 |
mbed_official | 157:90e3acc479a2 | 6 | * @date 27-February-2014 |
mbed_official | 157:90e3acc479a2 | 7 | * @brief This file contains all the functions prototypes for the FLASH |
mbed_official | 157:90e3acc479a2 | 8 | * firmware library. |
mbed_official | 157:90e3acc479a2 | 9 | ****************************************************************************** |
mbed_official | 157:90e3acc479a2 | 10 | * @attention |
mbed_official | 157:90e3acc479a2 | 11 | * |
mbed_official | 157:90e3acc479a2 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 157:90e3acc479a2 | 13 | * |
mbed_official | 157:90e3acc479a2 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 157:90e3acc479a2 | 15 | * are permitted provided that the following conditions are met: |
mbed_official | 157:90e3acc479a2 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 157:90e3acc479a2 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 157:90e3acc479a2 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 157:90e3acc479a2 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 157:90e3acc479a2 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 157:90e3acc479a2 | 23 | * without specific prior written permission. |
mbed_official | 157:90e3acc479a2 | 24 | * |
mbed_official | 157:90e3acc479a2 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 157:90e3acc479a2 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 157:90e3acc479a2 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 157:90e3acc479a2 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 157:90e3acc479a2 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 157:90e3acc479a2 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 157:90e3acc479a2 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 157:90e3acc479a2 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 157:90e3acc479a2 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 157:90e3acc479a2 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 157:90e3acc479a2 | 35 | * |
mbed_official | 157:90e3acc479a2 | 36 | ****************************************************************************** |
mbed_official | 157:90e3acc479a2 | 37 | */ |
mbed_official | 157:90e3acc479a2 | 38 | |
mbed_official | 157:90e3acc479a2 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 40 | #ifndef __STM32F30x_FLASH_H |
mbed_official | 157:90e3acc479a2 | 41 | #define __STM32F30x_FLASH_H |
mbed_official | 157:90e3acc479a2 | 42 | |
mbed_official | 157:90e3acc479a2 | 43 | #ifdef __cplusplus |
mbed_official | 157:90e3acc479a2 | 44 | extern "C" { |
mbed_official | 157:90e3acc479a2 | 45 | #endif |
mbed_official | 157:90e3acc479a2 | 46 | |
mbed_official | 157:90e3acc479a2 | 47 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 48 | #include "stm32f30x.h" |
mbed_official | 157:90e3acc479a2 | 49 | |
mbed_official | 157:90e3acc479a2 | 50 | /** @addtogroup STM32F30x_StdPeriph_Driver |
mbed_official | 157:90e3acc479a2 | 51 | * @{ |
mbed_official | 157:90e3acc479a2 | 52 | */ |
mbed_official | 157:90e3acc479a2 | 53 | |
mbed_official | 157:90e3acc479a2 | 54 | /** @addtogroup FLASH |
mbed_official | 157:90e3acc479a2 | 55 | * @{ |
mbed_official | 157:90e3acc479a2 | 56 | */ |
mbed_official | 157:90e3acc479a2 | 57 | |
mbed_official | 157:90e3acc479a2 | 58 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 59 | /** |
mbed_official | 157:90e3acc479a2 | 60 | * @brief FLASH Status |
mbed_official | 157:90e3acc479a2 | 61 | */ |
mbed_official | 157:90e3acc479a2 | 62 | typedef enum |
mbed_official | 157:90e3acc479a2 | 63 | { |
mbed_official | 157:90e3acc479a2 | 64 | FLASH_BUSY = 1, |
mbed_official | 157:90e3acc479a2 | 65 | FLASH_ERROR_WRP, |
mbed_official | 157:90e3acc479a2 | 66 | FLASH_ERROR_PROGRAM, |
mbed_official | 157:90e3acc479a2 | 67 | FLASH_COMPLETE, |
mbed_official | 157:90e3acc479a2 | 68 | FLASH_TIMEOUT |
mbed_official | 157:90e3acc479a2 | 69 | }FLASH_Status; |
mbed_official | 157:90e3acc479a2 | 70 | |
mbed_official | 157:90e3acc479a2 | 71 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 72 | |
mbed_official | 157:90e3acc479a2 | 73 | /** @defgroup FLASH_Exported_Constants |
mbed_official | 157:90e3acc479a2 | 74 | * @{ |
mbed_official | 157:90e3acc479a2 | 75 | */ |
mbed_official | 157:90e3acc479a2 | 76 | |
mbed_official | 157:90e3acc479a2 | 77 | /** @defgroup Flash_Latency |
mbed_official | 157:90e3acc479a2 | 78 | * @{ |
mbed_official | 157:90e3acc479a2 | 79 | */ |
mbed_official | 157:90e3acc479a2 | 80 | #define FLASH_Latency_0 ((uint8_t)0x0000) /*!< FLASH Zero Latency cycle */ |
mbed_official | 157:90e3acc479a2 | 81 | #define FLASH_Latency_1 FLASH_ACR_LATENCY_0 /*!< FLASH One Latency cycle */ |
mbed_official | 157:90e3acc479a2 | 82 | #define FLASH_Latency_2 FLASH_ACR_LATENCY_1 /*!< FLASH Two Latency cycles */ |
mbed_official | 157:90e3acc479a2 | 83 | |
mbed_official | 157:90e3acc479a2 | 84 | #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_Latency_0) || \ |
mbed_official | 157:90e3acc479a2 | 85 | ((LATENCY) == FLASH_Latency_1) || \ |
mbed_official | 157:90e3acc479a2 | 86 | ((LATENCY) == FLASH_Latency_2)) |
mbed_official | 157:90e3acc479a2 | 87 | /** |
mbed_official | 157:90e3acc479a2 | 88 | * @} |
mbed_official | 157:90e3acc479a2 | 89 | */ |
mbed_official | 157:90e3acc479a2 | 90 | |
mbed_official | 157:90e3acc479a2 | 91 | /** @defgroup FLASH_Interrupts |
mbed_official | 157:90e3acc479a2 | 92 | * @{ |
mbed_official | 157:90e3acc479a2 | 93 | */ |
mbed_official | 157:90e3acc479a2 | 94 | |
mbed_official | 157:90e3acc479a2 | 95 | #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of programming interrupt source */ |
mbed_official | 157:90e3acc479a2 | 96 | #define FLASH_IT_ERR FLASH_CR_ERRIE /*!< Error interrupt source */ |
mbed_official | 157:90e3acc479a2 | 97 | #define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0xFFFFEBFF) == 0x00000000) && (((IT) != 0x00000000))) |
mbed_official | 157:90e3acc479a2 | 98 | /** |
mbed_official | 157:90e3acc479a2 | 99 | * @} |
mbed_official | 157:90e3acc479a2 | 100 | */ |
mbed_official | 157:90e3acc479a2 | 101 | /** @defgroup FLASH_Address |
mbed_official | 157:90e3acc479a2 | 102 | * @{ |
mbed_official | 157:90e3acc479a2 | 103 | */ |
mbed_official | 157:90e3acc479a2 | 104 | |
mbed_official | 157:90e3acc479a2 | 105 | #define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) <= 0x0803FFFF)) |
mbed_official | 157:90e3acc479a2 | 106 | |
mbed_official | 157:90e3acc479a2 | 107 | /** |
mbed_official | 157:90e3acc479a2 | 108 | * @} |
mbed_official | 157:90e3acc479a2 | 109 | */ |
mbed_official | 157:90e3acc479a2 | 110 | |
mbed_official | 157:90e3acc479a2 | 111 | /** @defgroup FLASH_OB_DATA_ADDRESS |
mbed_official | 157:90e3acc479a2 | 112 | * @{ |
mbed_official | 157:90e3acc479a2 | 113 | */ |
mbed_official | 157:90e3acc479a2 | 114 | #define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == 0x1FFFF804) || ((ADDRESS) == 0x1FFFF806)) |
mbed_official | 157:90e3acc479a2 | 115 | |
mbed_official | 157:90e3acc479a2 | 116 | /** |
mbed_official | 157:90e3acc479a2 | 117 | * @} |
mbed_official | 157:90e3acc479a2 | 118 | */ |
mbed_official | 157:90e3acc479a2 | 119 | |
mbed_official | 157:90e3acc479a2 | 120 | /** @defgroup Option_Bytes_Write_Protection |
mbed_official | 157:90e3acc479a2 | 121 | * @{ |
mbed_official | 157:90e3acc479a2 | 122 | */ |
mbed_official | 157:90e3acc479a2 | 123 | |
mbed_official | 157:90e3acc479a2 | 124 | #define OB_WRP_Pages0to1 ((uint32_t)0x00000001) /* Write protection of page 0 to 1 */ |
mbed_official | 157:90e3acc479a2 | 125 | #define OB_WRP_Pages2to3 ((uint32_t)0x00000002) /* Write protection of page 2 to 3 */ |
mbed_official | 157:90e3acc479a2 | 126 | #define OB_WRP_Pages4to5 ((uint32_t)0x00000004) /* Write protection of page 4 to 5 */ |
mbed_official | 157:90e3acc479a2 | 127 | #define OB_WRP_Pages6to7 ((uint32_t)0x00000008) /* Write protection of page 6 to 7 */ |
mbed_official | 157:90e3acc479a2 | 128 | #define OB_WRP_Pages8to9 ((uint32_t)0x00000010) /* Write protection of page 8 to 9 */ |
mbed_official | 157:90e3acc479a2 | 129 | #define OB_WRP_Pages10to11 ((uint32_t)0x00000020) /* Write protection of page 10 to 11 */ |
mbed_official | 157:90e3acc479a2 | 130 | #define OB_WRP_Pages12to13 ((uint32_t)0x00000040) /* Write protection of page 12 to 13 */ |
mbed_official | 157:90e3acc479a2 | 131 | #define OB_WRP_Pages14to15 ((uint32_t)0x00000080) /* Write protection of page 14 to 15 */ |
mbed_official | 157:90e3acc479a2 | 132 | #define OB_WRP_Pages16to17 ((uint32_t)0x00000100) /* Write protection of page 16 to 17 */ |
mbed_official | 157:90e3acc479a2 | 133 | #define OB_WRP_Pages18to19 ((uint32_t)0x00000200) /* Write protection of page 18 to 19 */ |
mbed_official | 157:90e3acc479a2 | 134 | #define OB_WRP_Pages20to21 ((uint32_t)0x00000400) /* Write protection of page 20 to 21 */ |
mbed_official | 157:90e3acc479a2 | 135 | #define OB_WRP_Pages22to23 ((uint32_t)0x00000800) /* Write protection of page 22 to 23 */ |
mbed_official | 157:90e3acc479a2 | 136 | #define OB_WRP_Pages24to25 ((uint32_t)0x00001000) /* Write protection of page 24 to 25 */ |
mbed_official | 157:90e3acc479a2 | 137 | #define OB_WRP_Pages26to27 ((uint32_t)0x00002000) /* Write protection of page 26 to 27 */ |
mbed_official | 157:90e3acc479a2 | 138 | #define OB_WRP_Pages28to29 ((uint32_t)0x00004000) /* Write protection of page 28 to 29 */ |
mbed_official | 157:90e3acc479a2 | 139 | #define OB_WRP_Pages30to31 ((uint32_t)0x00008000) /* Write protection of page 30 to 31 */ |
mbed_official | 157:90e3acc479a2 | 140 | #define OB_WRP_Pages32to33 ((uint32_t)0x00010000) /* Write protection of page 32 to 33 */ |
mbed_official | 157:90e3acc479a2 | 141 | #define OB_WRP_Pages34to35 ((uint32_t)0x00020000) /* Write protection of page 34 to 35 */ |
mbed_official | 157:90e3acc479a2 | 142 | #define OB_WRP_Pages36to37 ((uint32_t)0x00040000) /* Write protection of page 36 to 37 */ |
mbed_official | 157:90e3acc479a2 | 143 | #define OB_WRP_Pages38to39 ((uint32_t)0x00080000) /* Write protection of page 38 to 39 */ |
mbed_official | 157:90e3acc479a2 | 144 | #define OB_WRP_Pages40to41 ((uint32_t)0x00100000) /* Write protection of page 40 to 41 */ |
mbed_official | 157:90e3acc479a2 | 145 | #define OB_WRP_Pages42to43 ((uint32_t)0x00200000) /* Write protection of page 42 to 43 */ |
mbed_official | 157:90e3acc479a2 | 146 | #define OB_WRP_Pages44to45 ((uint32_t)0x00400000) /* Write protection of page 44 to 45 */ |
mbed_official | 157:90e3acc479a2 | 147 | #define OB_WRP_Pages46to47 ((uint32_t)0x00800000) /* Write protection of page 46 to 47 */ |
mbed_official | 157:90e3acc479a2 | 148 | #define OB_WRP_Pages48to49 ((uint32_t)0x01000000) /* Write protection of page 48 to 49 */ |
mbed_official | 157:90e3acc479a2 | 149 | #define OB_WRP_Pages50to51 ((uint32_t)0x02000000) /* Write protection of page 50 to 51 */ |
mbed_official | 157:90e3acc479a2 | 150 | #define OB_WRP_Pages52to53 ((uint32_t)0x04000000) /* Write protection of page 52 to 53 */ |
mbed_official | 157:90e3acc479a2 | 151 | #define OB_WRP_Pages54to55 ((uint32_t)0x08000000) /* Write protection of page 54 to 55 */ |
mbed_official | 157:90e3acc479a2 | 152 | #define OB_WRP_Pages56to57 ((uint32_t)0x10000000) /* Write protection of page 56 to 57 */ |
mbed_official | 157:90e3acc479a2 | 153 | #define OB_WRP_Pages58to59 ((uint32_t)0x20000000) /* Write protection of page 58 to 59 */ |
mbed_official | 157:90e3acc479a2 | 154 | #define OB_WRP_Pages60to61 ((uint32_t)0x40000000) /* Write protection of page 60 to 61 */ |
mbed_official | 157:90e3acc479a2 | 155 | #define OB_WRP_Pages62to127 ((uint32_t)0x80000000) /* Write protection of page 62 to 127 */ |
mbed_official | 157:90e3acc479a2 | 156 | |
mbed_official | 157:90e3acc479a2 | 157 | #define OB_WRP_AllPages ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Sectors */ |
mbed_official | 157:90e3acc479a2 | 158 | |
mbed_official | 157:90e3acc479a2 | 159 | #define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000)) |
mbed_official | 157:90e3acc479a2 | 160 | |
mbed_official | 157:90e3acc479a2 | 161 | /** |
mbed_official | 157:90e3acc479a2 | 162 | * @} |
mbed_official | 157:90e3acc479a2 | 163 | */ |
mbed_official | 157:90e3acc479a2 | 164 | |
mbed_official | 157:90e3acc479a2 | 165 | /** @defgroup Option_Bytes_Read_Protection |
mbed_official | 157:90e3acc479a2 | 166 | * @{ |
mbed_official | 157:90e3acc479a2 | 167 | */ |
mbed_official | 157:90e3acc479a2 | 168 | |
mbed_official | 157:90e3acc479a2 | 169 | /** |
mbed_official | 157:90e3acc479a2 | 170 | * @brief Read Protection Level |
mbed_official | 157:90e3acc479a2 | 171 | */ |
mbed_official | 157:90e3acc479a2 | 172 | #define OB_RDP_Level_0 ((uint8_t)0xAA) |
mbed_official | 157:90e3acc479a2 | 173 | #define OB_RDP_Level_1 ((uint8_t)0xBB) |
mbed_official | 157:90e3acc479a2 | 174 | /*#define OB_RDP_Level_2 ((uint8_t)0xCC)*/ /* Warning: When enabling read protection level 2 |
mbed_official | 157:90e3acc479a2 | 175 | it's no more possible to go back to level 1 or 0 */ |
mbed_official | 157:90e3acc479a2 | 176 | |
mbed_official | 157:90e3acc479a2 | 177 | #define IS_OB_RDP(LEVEL) (((LEVEL) == OB_RDP_Level_0)||\ |
mbed_official | 157:90e3acc479a2 | 178 | ((LEVEL) == OB_RDP_Level_1))/*||\ |
mbed_official | 157:90e3acc479a2 | 179 | ((LEVEL) == OB_RDP_Level_2))*/ |
mbed_official | 157:90e3acc479a2 | 180 | /** |
mbed_official | 157:90e3acc479a2 | 181 | * @} |
mbed_official | 157:90e3acc479a2 | 182 | */ |
mbed_official | 157:90e3acc479a2 | 183 | |
mbed_official | 157:90e3acc479a2 | 184 | /** @defgroup Option_Bytes_IWatchdog |
mbed_official | 157:90e3acc479a2 | 185 | * @{ |
mbed_official | 157:90e3acc479a2 | 186 | */ |
mbed_official | 157:90e3acc479a2 | 187 | |
mbed_official | 157:90e3acc479a2 | 188 | #define OB_IWDG_SW ((uint8_t)0x01) /*!< Software IWDG selected */ |
mbed_official | 157:90e3acc479a2 | 189 | #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware IWDG selected */ |
mbed_official | 157:90e3acc479a2 | 190 | #define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW)) |
mbed_official | 157:90e3acc479a2 | 191 | |
mbed_official | 157:90e3acc479a2 | 192 | /** |
mbed_official | 157:90e3acc479a2 | 193 | * @} |
mbed_official | 157:90e3acc479a2 | 194 | */ |
mbed_official | 157:90e3acc479a2 | 195 | |
mbed_official | 157:90e3acc479a2 | 196 | /** @defgroup Option_Bytes_nRST_STOP |
mbed_official | 157:90e3acc479a2 | 197 | * @{ |
mbed_official | 157:90e3acc479a2 | 198 | */ |
mbed_official | 157:90e3acc479a2 | 199 | |
mbed_official | 157:90e3acc479a2 | 200 | #define OB_STOP_NoRST ((uint8_t)0x02) /*!< No reset generated when entering in STOP */ |
mbed_official | 157:90e3acc479a2 | 201 | #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */ |
mbed_official | 157:90e3acc479a2 | 202 | #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NoRST) || ((SOURCE) == OB_STOP_RST)) |
mbed_official | 157:90e3acc479a2 | 203 | |
mbed_official | 157:90e3acc479a2 | 204 | /** |
mbed_official | 157:90e3acc479a2 | 205 | * @} |
mbed_official | 157:90e3acc479a2 | 206 | */ |
mbed_official | 157:90e3acc479a2 | 207 | |
mbed_official | 157:90e3acc479a2 | 208 | /** @defgroup Option_Bytes_nRST_STDBY |
mbed_official | 157:90e3acc479a2 | 209 | * @{ |
mbed_official | 157:90e3acc479a2 | 210 | */ |
mbed_official | 157:90e3acc479a2 | 211 | |
mbed_official | 157:90e3acc479a2 | 212 | #define OB_STDBY_NoRST ((uint8_t)0x04) /*!< No reset generated when entering in STANDBY */ |
mbed_official | 157:90e3acc479a2 | 213 | #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */ |
mbed_official | 157:90e3acc479a2 | 214 | #define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NoRST) || ((SOURCE) == OB_STDBY_RST)) |
mbed_official | 157:90e3acc479a2 | 215 | |
mbed_official | 157:90e3acc479a2 | 216 | /** |
mbed_official | 157:90e3acc479a2 | 217 | * @} |
mbed_official | 157:90e3acc479a2 | 218 | */ |
mbed_official | 157:90e3acc479a2 | 219 | /** @defgroup Option_Bytes_BOOT1 |
mbed_official | 157:90e3acc479a2 | 220 | * @{ |
mbed_official | 157:90e3acc479a2 | 221 | */ |
mbed_official | 157:90e3acc479a2 | 222 | |
mbed_official | 157:90e3acc479a2 | 223 | #define OB_BOOT1_RESET ((uint8_t)0x00) /*!< BOOT1 Reset */ |
mbed_official | 157:90e3acc479a2 | 224 | #define OB_BOOT1_SET ((uint8_t)0x10) /*!< BOOT1 Set */ |
mbed_official | 157:90e3acc479a2 | 225 | #define IS_OB_BOOT1(BOOT1) (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET)) |
mbed_official | 157:90e3acc479a2 | 226 | |
mbed_official | 157:90e3acc479a2 | 227 | /** |
mbed_official | 157:90e3acc479a2 | 228 | * @} |
mbed_official | 157:90e3acc479a2 | 229 | */ |
mbed_official | 157:90e3acc479a2 | 230 | /** @defgroup Option_Bytes_VDDA_Analog_Monitoring |
mbed_official | 157:90e3acc479a2 | 231 | * @{ |
mbed_official | 157:90e3acc479a2 | 232 | */ |
mbed_official | 157:90e3acc479a2 | 233 | |
mbed_official | 157:90e3acc479a2 | 234 | #define OB_VDDA_ANALOG_ON ((uint8_t)0x20) /*!< Analog monitoring on VDDA Power source ON */ |
mbed_official | 157:90e3acc479a2 | 235 | #define OB_VDDA_ANALOG_OFF ((uint8_t)0x00) /*!< Analog monitoring on VDDA Power source OFF */ |
mbed_official | 157:90e3acc479a2 | 236 | |
mbed_official | 157:90e3acc479a2 | 237 | #define IS_OB_VDDA_ANALOG(ANALOG) (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF)) |
mbed_official | 157:90e3acc479a2 | 238 | |
mbed_official | 157:90e3acc479a2 | 239 | /** |
mbed_official | 157:90e3acc479a2 | 240 | * @} |
mbed_official | 157:90e3acc479a2 | 241 | */ |
mbed_official | 157:90e3acc479a2 | 242 | |
mbed_official | 157:90e3acc479a2 | 243 | /** @defgroup FLASH_Option_Bytes_SRAM_Parity_Enable |
mbed_official | 157:90e3acc479a2 | 244 | * @{ |
mbed_official | 157:90e3acc479a2 | 245 | */ |
mbed_official | 157:90e3acc479a2 | 246 | |
mbed_official | 157:90e3acc479a2 | 247 | #define OB_SRAM_PARITY_SET ((uint8_t)0x00) /*!< SRAM parity enable Set */ |
mbed_official | 157:90e3acc479a2 | 248 | #define OB_SRAM_PARITY_RESET ((uint8_t)0x40) /*!< SRAM parity enable reset */ |
mbed_official | 157:90e3acc479a2 | 249 | |
mbed_official | 157:90e3acc479a2 | 250 | #define IS_OB_SRAM_PARITY(PARITY) (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET)) |
mbed_official | 157:90e3acc479a2 | 251 | |
mbed_official | 157:90e3acc479a2 | 252 | /** |
mbed_official | 157:90e3acc479a2 | 253 | * @} |
mbed_official | 157:90e3acc479a2 | 254 | */ |
mbed_official | 157:90e3acc479a2 | 255 | |
mbed_official | 157:90e3acc479a2 | 256 | /** @defgroup FLASH_Flags |
mbed_official | 157:90e3acc479a2 | 257 | * @{ |
mbed_official | 157:90e3acc479a2 | 258 | */ |
mbed_official | 157:90e3acc479a2 | 259 | |
mbed_official | 157:90e3acc479a2 | 260 | #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */ |
mbed_official | 157:90e3acc479a2 | 261 | #define FLASH_FLAG_PGERR FLASH_SR_PGERR /*!< FLASH Programming error flag */ |
mbed_official | 157:90e3acc479a2 | 262 | #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */ |
mbed_official | 157:90e3acc479a2 | 263 | #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Programming flag */ |
mbed_official | 157:90e3acc479a2 | 264 | |
mbed_official | 157:90e3acc479a2 | 265 | #define IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFCB) == 0x00000000) && ((FLAG) != 0x00000000)) |
mbed_official | 157:90e3acc479a2 | 266 | |
mbed_official | 157:90e3acc479a2 | 267 | #define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_PGERR) || \ |
mbed_official | 157:90e3acc479a2 | 268 | ((FLAG) == FLASH_FLAG_WRPERR) || ((FLAG) == FLASH_FLAG_EOP)) |
mbed_official | 157:90e3acc479a2 | 269 | /** |
mbed_official | 157:90e3acc479a2 | 270 | * @} |
mbed_official | 157:90e3acc479a2 | 271 | */ |
mbed_official | 157:90e3acc479a2 | 272 | /** @defgroup Timeout_definition |
mbed_official | 157:90e3acc479a2 | 273 | * @{ |
mbed_official | 157:90e3acc479a2 | 274 | */ |
mbed_official | 157:90e3acc479a2 | 275 | #define FLASH_ER_PRG_TIMEOUT ((uint32_t)0x000B0000) |
mbed_official | 157:90e3acc479a2 | 276 | |
mbed_official | 157:90e3acc479a2 | 277 | /** |
mbed_official | 157:90e3acc479a2 | 278 | * @} |
mbed_official | 157:90e3acc479a2 | 279 | */ |
mbed_official | 157:90e3acc479a2 | 280 | |
mbed_official | 157:90e3acc479a2 | 281 | /** |
mbed_official | 157:90e3acc479a2 | 282 | * @} |
mbed_official | 157:90e3acc479a2 | 283 | */ |
mbed_official | 157:90e3acc479a2 | 284 | |
mbed_official | 157:90e3acc479a2 | 285 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 286 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 157:90e3acc479a2 | 287 | |
mbed_official | 157:90e3acc479a2 | 288 | /* FLASH Interface configuration functions ************************************/ |
mbed_official | 157:90e3acc479a2 | 289 | void FLASH_SetLatency(uint32_t FLASH_Latency); |
mbed_official | 157:90e3acc479a2 | 290 | void FLASH_HalfCycleAccessCmd(FunctionalState NewState); |
mbed_official | 157:90e3acc479a2 | 291 | void FLASH_PrefetchBufferCmd(FunctionalState NewState); |
mbed_official | 157:90e3acc479a2 | 292 | |
mbed_official | 157:90e3acc479a2 | 293 | /* FLASH Memory Programming functions *****************************************/ |
mbed_official | 157:90e3acc479a2 | 294 | void FLASH_Unlock(void); |
mbed_official | 157:90e3acc479a2 | 295 | void FLASH_Lock(void); |
mbed_official | 157:90e3acc479a2 | 296 | FLASH_Status FLASH_ErasePage(uint32_t Page_Address); |
mbed_official | 157:90e3acc479a2 | 297 | FLASH_Status FLASH_EraseAllPages(void); |
mbed_official | 157:90e3acc479a2 | 298 | FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data); |
mbed_official | 157:90e3acc479a2 | 299 | FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); |
mbed_official | 157:90e3acc479a2 | 300 | |
mbed_official | 157:90e3acc479a2 | 301 | /* Option Bytes Programming functions *****************************************/ |
mbed_official | 157:90e3acc479a2 | 302 | void FLASH_OB_Unlock(void); |
mbed_official | 157:90e3acc479a2 | 303 | void FLASH_OB_Lock(void); |
mbed_official | 157:90e3acc479a2 | 304 | void FLASH_OB_Launch(void); |
mbed_official | 157:90e3acc479a2 | 305 | FLASH_Status FLASH_OB_Erase(void); |
mbed_official | 157:90e3acc479a2 | 306 | FLASH_Status FLASH_OB_EnableWRP(uint32_t OB_WRP); |
mbed_official | 157:90e3acc479a2 | 307 | FLASH_Status FLASH_OB_RDPConfig(uint8_t OB_RDP); |
mbed_official | 157:90e3acc479a2 | 308 | FLASH_Status FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY); |
mbed_official | 157:90e3acc479a2 | 309 | FLASH_Status FLASH_OB_BOOTConfig(uint8_t OB_BOOT1); |
mbed_official | 157:90e3acc479a2 | 310 | FLASH_Status FLASH_OB_VDDAConfig(uint8_t OB_VDDA_ANALOG); |
mbed_official | 157:90e3acc479a2 | 311 | FLASH_Status FLASH_OB_SRAMParityConfig(uint8_t OB_SRAM_Parity); |
mbed_official | 157:90e3acc479a2 | 312 | FLASH_Status FLASH_OB_WriteUser(uint8_t OB_USER); |
mbed_official | 157:90e3acc479a2 | 313 | FLASH_Status FLASH_ProgramOptionByteData(uint32_t Address, uint8_t Data); |
mbed_official | 157:90e3acc479a2 | 314 | uint8_t FLASH_OB_GetUser(void); |
mbed_official | 157:90e3acc479a2 | 315 | uint32_t FLASH_OB_GetWRP(void); |
mbed_official | 157:90e3acc479a2 | 316 | FlagStatus FLASH_OB_GetRDP(void); |
mbed_official | 157:90e3acc479a2 | 317 | |
mbed_official | 157:90e3acc479a2 | 318 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 157:90e3acc479a2 | 319 | void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState); |
mbed_official | 157:90e3acc479a2 | 320 | FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG); |
mbed_official | 157:90e3acc479a2 | 321 | void FLASH_ClearFlag(uint32_t FLASH_FLAG); |
mbed_official | 157:90e3acc479a2 | 322 | FLASH_Status FLASH_GetStatus(void); |
mbed_official | 157:90e3acc479a2 | 323 | FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); |
mbed_official | 157:90e3acc479a2 | 324 | |
mbed_official | 157:90e3acc479a2 | 325 | #ifdef __cplusplus |
mbed_official | 157:90e3acc479a2 | 326 | } |
mbed_official | 157:90e3acc479a2 | 327 | #endif |
mbed_official | 157:90e3acc479a2 | 328 | |
mbed_official | 157:90e3acc479a2 | 329 | #endif /* __STM32F30x_FLASH_H */ |
mbed_official | 157:90e3acc479a2 | 330 | |
mbed_official | 157:90e3acc479a2 | 331 | /** |
mbed_official | 157:90e3acc479a2 | 332 | * @} |
mbed_official | 157:90e3acc479a2 | 333 | */ |
mbed_official | 157:90e3acc479a2 | 334 | |
mbed_official | 157:90e3acc479a2 | 335 | /** |
mbed_official | 157:90e3acc479a2 | 336 | * @} |
mbed_official | 157:90e3acc479a2 | 337 | */ |
mbed_official | 157:90e3acc479a2 | 338 | |
mbed_official | 157:90e3acc479a2 | 339 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |