mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jul 31 14:15:09 2015 +0100
Revision:
600:7d17ca308cd1
Parent:
489:119543c9f674
Synchronized with git revision e4cd8bbd3e05b68e5a7f466c74035a85743d45e0

Full URL: https://github.com/mbedmicro/mbed/commit/e4cd8bbd3e05b68e5a7f466c74035a85743d45e0/

Enable LPC8xx usart when configuring it

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_ll_fsmc.h
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief Header file of FSMC HAL module.
mbed_official 489:119543c9f674 8 ******************************************************************************
mbed_official 489:119543c9f674 9 * @attention
mbed_official 489:119543c9f674 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 14 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 16 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 19 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 21 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 22 * without specific prior written permission.
mbed_official 489:119543c9f674 23 *
mbed_official 489:119543c9f674 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 34 *
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 */
mbed_official 489:119543c9f674 37
mbed_official 489:119543c9f674 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 489:119543c9f674 39 #ifndef __STM32F1xx_LL_FSMC_H
mbed_official 489:119543c9f674 40 #define __STM32F1xx_LL_FSMC_H
mbed_official 489:119543c9f674 41
mbed_official 489:119543c9f674 42 #ifdef __cplusplus
mbed_official 489:119543c9f674 43 extern "C" {
mbed_official 489:119543c9f674 44 #endif
mbed_official 489:119543c9f674 45
mbed_official 489:119543c9f674 46 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 47 #include "stm32f1xx_hal_def.h"
mbed_official 489:119543c9f674 48
mbed_official 489:119543c9f674 49 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 50 * @{
mbed_official 489:119543c9f674 51 */
mbed_official 489:119543c9f674 52
mbed_official 489:119543c9f674 53 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG) || defined(STM32F100xE)
mbed_official 489:119543c9f674 54
mbed_official 489:119543c9f674 55 /** @addtogroup FSMC_LL
mbed_official 489:119543c9f674 56 * @{
mbed_official 489:119543c9f674 57 */
mbed_official 489:119543c9f674 58
mbed_official 489:119543c9f674 59 /** @addtogroup FSMC_LL_Private_Macros
mbed_official 489:119543c9f674 60 * @{
mbed_official 489:119543c9f674 61 */
mbed_official 489:119543c9f674 62
mbed_official 489:119543c9f674 63 #define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \
mbed_official 489:119543c9f674 64 ((__BANK__) == FSMC_NORSRAM_BANK2) || \
mbed_official 489:119543c9f674 65 ((__BANK__) == FSMC_NORSRAM_BANK3) || \
mbed_official 489:119543c9f674 66 ((__BANK__) == FSMC_NORSRAM_BANK4))
mbed_official 489:119543c9f674 67
mbed_official 489:119543c9f674 68 #define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \
mbed_official 489:119543c9f674 69 ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE))
mbed_official 489:119543c9f674 70
mbed_official 489:119543c9f674 71 #define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \
mbed_official 489:119543c9f674 72 ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \
mbed_official 489:119543c9f674 73 ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR))
mbed_official 489:119543c9f674 74
mbed_official 489:119543c9f674 75 #define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \
mbed_official 489:119543c9f674 76 ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \
mbed_official 489:119543c9f674 77 ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32))
mbed_official 489:119543c9f674 78
mbed_official 489:119543c9f674 79 #define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \
mbed_official 489:119543c9f674 80 ((__MODE__) == FSMC_ACCESS_MODE_B) || \
mbed_official 489:119543c9f674 81 ((__MODE__) == FSMC_ACCESS_MODE_C) || \
mbed_official 489:119543c9f674 82 ((__MODE__) == FSMC_ACCESS_MODE_D))
mbed_official 489:119543c9f674 83
mbed_official 489:119543c9f674 84 #define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_NAND_BANK2) || \
mbed_official 489:119543c9f674 85 ((BANK) == FSMC_NAND_BANK3))
mbed_official 489:119543c9f674 86
mbed_official 489:119543c9f674 87 #define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \
mbed_official 489:119543c9f674 88 ((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_ENABLE))
mbed_official 489:119543c9f674 89
mbed_official 489:119543c9f674 90 #define IS_FSMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_8) || \
mbed_official 489:119543c9f674 91 ((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_16))
mbed_official 489:119543c9f674 92
mbed_official 489:119543c9f674 93 #define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_NAND_ECC_DISABLE) || \
mbed_official 489:119543c9f674 94 ((STATE) == FSMC_NAND_ECC_ENABLE))
mbed_official 489:119543c9f674 95
mbed_official 489:119543c9f674 96 #define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_256BYTE) || \
mbed_official 489:119543c9f674 97 ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_512BYTE) || \
mbed_official 489:119543c9f674 98 ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \
mbed_official 489:119543c9f674 99 ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \
mbed_official 489:119543c9f674 100 ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \
mbed_official 489:119543c9f674 101 ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_8192BYTE))
mbed_official 489:119543c9f674 102 /** @defgroup FSMC_TCLR_Setup_Time FSMC_TCLR_Setup_Time
mbed_official 489:119543c9f674 103 * @{
mbed_official 489:119543c9f674 104 */
mbed_official 489:119543c9f674 105 #define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 106 /**
mbed_official 489:119543c9f674 107 * @}
mbed_official 489:119543c9f674 108 */
mbed_official 489:119543c9f674 109
mbed_official 489:119543c9f674 110 /** @defgroup FSMC_TAR_Setup_Time FSMC_TAR_Setup_Time
mbed_official 489:119543c9f674 111 * @{
mbed_official 489:119543c9f674 112 */
mbed_official 489:119543c9f674 113 #define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 114 /**
mbed_official 489:119543c9f674 115 * @}
mbed_official 489:119543c9f674 116 */
mbed_official 489:119543c9f674 117
mbed_official 489:119543c9f674 118 /** @defgroup FSMC_Setup_Time FSMC_Setup_Time
mbed_official 489:119543c9f674 119 * @{
mbed_official 489:119543c9f674 120 */
mbed_official 489:119543c9f674 121 #define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 122 /**
mbed_official 489:119543c9f674 123 * @}
mbed_official 489:119543c9f674 124 */
mbed_official 489:119543c9f674 125
mbed_official 489:119543c9f674 126 /** @defgroup FSMC_Wait_Setup_Time FSMC_Wait_Setup_Time
mbed_official 489:119543c9f674 127 * @{
mbed_official 489:119543c9f674 128 */
mbed_official 489:119543c9f674 129 #define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 130 /**
mbed_official 489:119543c9f674 131 * @}
mbed_official 489:119543c9f674 132 */
mbed_official 489:119543c9f674 133
mbed_official 489:119543c9f674 134 /** @defgroup FSMC_Hold_Setup_Time FSMC_Hold_Setup_Time
mbed_official 489:119543c9f674 135 * @{
mbed_official 489:119543c9f674 136 */
mbed_official 489:119543c9f674 137 #define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 138 /**
mbed_official 489:119543c9f674 139 * @}
mbed_official 489:119543c9f674 140 */
mbed_official 489:119543c9f674 141
mbed_official 489:119543c9f674 142 /** @defgroup FSMC_HiZ_Setup_Time FSMC_HiZ_Setup_Time
mbed_official 489:119543c9f674 143 * @{
mbed_official 489:119543c9f674 144 */
mbed_official 489:119543c9f674 145 #define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 255)
mbed_official 489:119543c9f674 146 /**
mbed_official 489:119543c9f674 147 * @}
mbed_official 489:119543c9f674 148 */
mbed_official 489:119543c9f674 149
mbed_official 489:119543c9f674 150 /** @defgroup FSMC_NORSRAM_Device_Instance FSMC NOR/SRAM Device Instance
mbed_official 489:119543c9f674 151 * @{
mbed_official 489:119543c9f674 152 */
mbed_official 489:119543c9f674 153
mbed_official 489:119543c9f674 154 #define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE)
mbed_official 489:119543c9f674 155
mbed_official 489:119543c9f674 156 /**
mbed_official 489:119543c9f674 157 * @}
mbed_official 489:119543c9f674 158 */
mbed_official 489:119543c9f674 159
mbed_official 489:119543c9f674 160 /** @defgroup FSMC_NORSRAM_EXTENDED_Device_Instance FSMC NOR/SRAM EXTENDED Device Instance
mbed_official 489:119543c9f674 161 * @{
mbed_official 489:119543c9f674 162 */
mbed_official 489:119543c9f674 163
mbed_official 489:119543c9f674 164 #define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE)
mbed_official 489:119543c9f674 165
mbed_official 489:119543c9f674 166 /**
mbed_official 489:119543c9f674 167 * @}
mbed_official 489:119543c9f674 168 */
mbed_official 489:119543c9f674 169
mbed_official 489:119543c9f674 170 /** @defgroup FSMC_NAND_Device_Instance FSMC_NAND_Device_Instance
mbed_official 489:119543c9f674 171 * @{
mbed_official 489:119543c9f674 172 */
mbed_official 489:119543c9f674 173 #define IS_FSMC_NAND_DEVICE(INSTANCE) ((INSTANCE) == FSMC_NAND_DEVICE)
mbed_official 489:119543c9f674 174 /**
mbed_official 489:119543c9f674 175 * @}
mbed_official 489:119543c9f674 176 */
mbed_official 489:119543c9f674 177
mbed_official 489:119543c9f674 178 /** @defgroup FSMC_PCCARD_Device_Instance FSMC_PCCARD_Device_Instance
mbed_official 489:119543c9f674 179 * @{
mbed_official 489:119543c9f674 180 */
mbed_official 489:119543c9f674 181 #define IS_FSMC_PCCARD_DEVICE(INSTANCE) ((INSTANCE) == FSMC_PCCARD_DEVICE)
mbed_official 489:119543c9f674 182
mbed_official 489:119543c9f674 183 /**
mbed_official 489:119543c9f674 184 * @}
mbed_official 489:119543c9f674 185 */
mbed_official 489:119543c9f674 186
mbed_official 489:119543c9f674 187 #define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \
mbed_official 489:119543c9f674 188 ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE))
mbed_official 489:119543c9f674 189
mbed_official 489:119543c9f674 190 #define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \
mbed_official 489:119543c9f674 191 ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH))
mbed_official 489:119543c9f674 192
mbed_official 489:119543c9f674 193 #define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \
mbed_official 489:119543c9f674 194 ((__MODE__) == FSMC_WRAP_MODE_ENABLE))
mbed_official 489:119543c9f674 195
mbed_official 489:119543c9f674 196 #define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \
mbed_official 489:119543c9f674 197 ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS))
mbed_official 489:119543c9f674 198
mbed_official 489:119543c9f674 199 #define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \
mbed_official 489:119543c9f674 200 ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE))
mbed_official 489:119543c9f674 201
mbed_official 489:119543c9f674 202 #define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \
mbed_official 489:119543c9f674 203 ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE))
mbed_official 489:119543c9f674 204
mbed_official 489:119543c9f674 205 #define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \
mbed_official 489:119543c9f674 206 ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE))
mbed_official 489:119543c9f674 207
mbed_official 489:119543c9f674 208 #define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \
mbed_official 489:119543c9f674 209 ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE))
mbed_official 489:119543c9f674 210
mbed_official 489:119543c9f674 211 #define IS_FSMC_CLK_DIV(DIV) (((DIV) > 1) && ((DIV) <= 16))
mbed_official 489:119543c9f674 212
mbed_official 489:119543c9f674 213 /** @defgroup FSMC_Data_Latency FSMC Data Latency
mbed_official 489:119543c9f674 214 * @{
mbed_official 489:119543c9f674 215 */
mbed_official 489:119543c9f674 216
mbed_official 489:119543c9f674 217 #define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17))
mbed_official 489:119543c9f674 218 /**
mbed_official 489:119543c9f674 219 * @}
mbed_official 489:119543c9f674 220 */
mbed_official 489:119543c9f674 221
mbed_official 489:119543c9f674 222 #define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \
mbed_official 489:119543c9f674 223 ((__BURST__) == FSMC_WRITE_BURST_ENABLE))
mbed_official 489:119543c9f674 224 /** @defgroup FSMC_Address_Setup_Time FSMC Address Setup Time
mbed_official 489:119543c9f674 225 * @{
mbed_official 489:119543c9f674 226 */
mbed_official 489:119543c9f674 227
mbed_official 489:119543c9f674 228 #define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15)
mbed_official 489:119543c9f674 229 /**
mbed_official 489:119543c9f674 230 * @}
mbed_official 489:119543c9f674 231 */
mbed_official 489:119543c9f674 232
mbed_official 489:119543c9f674 233 /** @defgroup FSMC_Address_Hold_Time FSMC Address Hold Time
mbed_official 489:119543c9f674 234 * @{
mbed_official 489:119543c9f674 235 */
mbed_official 489:119543c9f674 236
mbed_official 489:119543c9f674 237 #define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15))
mbed_official 489:119543c9f674 238 /**
mbed_official 489:119543c9f674 239 * @}
mbed_official 489:119543c9f674 240 */
mbed_official 489:119543c9f674 241
mbed_official 489:119543c9f674 242 /** @defgroup FSMC_Data_Setup_Time FSMC Data Setup Time
mbed_official 489:119543c9f674 243 * @{
mbed_official 489:119543c9f674 244 */
mbed_official 489:119543c9f674 245
mbed_official 489:119543c9f674 246 #define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255))
mbed_official 489:119543c9f674 247 /**
mbed_official 489:119543c9f674 248 * @}
mbed_official 489:119543c9f674 249 */
mbed_official 489:119543c9f674 250
mbed_official 489:119543c9f674 251 /** @defgroup FSMC_Bus_Turn_around_Duration FSMC Bus Turn around Duration
mbed_official 489:119543c9f674 252 * @{
mbed_official 489:119543c9f674 253 */
mbed_official 489:119543c9f674 254
mbed_official 489:119543c9f674 255 #define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15)
mbed_official 489:119543c9f674 256 /**
mbed_official 489:119543c9f674 257 * @}
mbed_official 489:119543c9f674 258 */
mbed_official 489:119543c9f674 259
mbed_official 489:119543c9f674 260 /**
mbed_official 489:119543c9f674 261 * @}
mbed_official 489:119543c9f674 262 */
mbed_official 489:119543c9f674 263
mbed_official 489:119543c9f674 264 /* Exported typedef ----------------------------------------------------------*/
mbed_official 489:119543c9f674 265
mbed_official 489:119543c9f674 266 /** @defgroup FSMC_NORSRAM_Exported_typedef FSMC Low Layer Exported Types
mbed_official 489:119543c9f674 267 * @{
mbed_official 489:119543c9f674 268 */
mbed_official 489:119543c9f674 269
mbed_official 489:119543c9f674 270 #define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef
mbed_official 489:119543c9f674 271 #define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef
mbed_official 489:119543c9f674 272 #define FSMC_NAND_TypeDef FSMC_Bank2_3_TypeDef
mbed_official 489:119543c9f674 273 #define FSMC_PCCARD_TypeDef FSMC_Bank4_TypeDef
mbed_official 489:119543c9f674 274
mbed_official 489:119543c9f674 275 #define FSMC_NORSRAM_DEVICE FSMC_Bank1
mbed_official 489:119543c9f674 276 #define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E
mbed_official 489:119543c9f674 277 #define FSMC_NAND_DEVICE FSMC_Bank2_3
mbed_official 489:119543c9f674 278 #define FSMC_PCCARD_DEVICE FSMC_Bank4
mbed_official 489:119543c9f674 279
mbed_official 489:119543c9f674 280 /**
mbed_official 489:119543c9f674 281 * @brief FSMC_NORSRAM Configuration Structure definition
mbed_official 489:119543c9f674 282 */
mbed_official 489:119543c9f674 283 typedef struct
mbed_official 489:119543c9f674 284 {
mbed_official 489:119543c9f674 285 uint32_t NSBank; /*!< Specifies the NORSRAM memory device that will be used.
mbed_official 489:119543c9f674 286 This parameter can be a value of @ref FSMC_NORSRAM_Bank */
mbed_official 489:119543c9f674 287
mbed_official 489:119543c9f674 288 uint32_t DataAddressMux; /*!< Specifies whether the address and data values are
mbed_official 489:119543c9f674 289 multiplexed on the data bus or not.
mbed_official 489:119543c9f674 290 This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */
mbed_official 489:119543c9f674 291
mbed_official 489:119543c9f674 292 uint32_t MemoryType; /*!< Specifies the type of external memory attached to
mbed_official 489:119543c9f674 293 the corresponding memory device.
mbed_official 489:119543c9f674 294 This parameter can be a value of @ref FSMC_Memory_Type */
mbed_official 489:119543c9f674 295
mbed_official 489:119543c9f674 296 uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
mbed_official 489:119543c9f674 297 This parameter can be a value of @ref FSMC_NORSRAM_Data_Width */
mbed_official 489:119543c9f674 298
mbed_official 489:119543c9f674 299 uint32_t BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory,
mbed_official 489:119543c9f674 300 valid only with synchronous burst Flash memories.
mbed_official 489:119543c9f674 301 This parameter can be a value of @ref FSMC_Burst_Access_Mode */
mbed_official 489:119543c9f674 302
mbed_official 489:119543c9f674 303 uint32_t WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing
mbed_official 489:119543c9f674 304 the Flash memory in burst mode.
mbed_official 489:119543c9f674 305 This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */
mbed_official 489:119543c9f674 306
mbed_official 489:119543c9f674 307 uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash
mbed_official 489:119543c9f674 308 memory, valid only when accessing Flash memories in burst mode.
mbed_official 489:119543c9f674 309 This parameter can be a value of @ref FSMC_Wrap_Mode */
mbed_official 489:119543c9f674 310
mbed_official 489:119543c9f674 311 uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one
mbed_official 489:119543c9f674 312 clock cycle before the wait state or during the wait state,
mbed_official 489:119543c9f674 313 valid only when accessing memories in burst mode.
mbed_official 489:119543c9f674 314 This parameter can be a value of @ref FSMC_Wait_Timing */
mbed_official 489:119543c9f674 315
mbed_official 489:119543c9f674 316 uint32_t WriteOperation; /*!< Enables or disables the write operation in the selected device by the FSMC.
mbed_official 489:119543c9f674 317 This parameter can be a value of @ref FSMC_Write_Operation */
mbed_official 489:119543c9f674 318
mbed_official 489:119543c9f674 319 uint32_t WaitSignal; /*!< Enables or disables the wait state insertion via wait
mbed_official 489:119543c9f674 320 signal, valid for Flash memory access in burst mode.
mbed_official 489:119543c9f674 321 This parameter can be a value of @ref FSMC_Wait_Signal */
mbed_official 489:119543c9f674 322
mbed_official 489:119543c9f674 323 uint32_t ExtendedMode; /*!< Enables or disables the extended mode.
mbed_official 489:119543c9f674 324 This parameter can be a value of @ref FSMC_Extended_Mode */
mbed_official 489:119543c9f674 325
mbed_official 489:119543c9f674 326 uint32_t AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers,
mbed_official 489:119543c9f674 327 valid only with asynchronous Flash memories.
mbed_official 489:119543c9f674 328 This parameter can be a value of @ref FSMC_AsynchronousWait */
mbed_official 489:119543c9f674 329
mbed_official 489:119543c9f674 330 uint32_t WriteBurst; /*!< Enables or disables the write burst operation.
mbed_official 489:119543c9f674 331 This parameter can be a value of @ref FSMC_Write_Burst */
mbed_official 489:119543c9f674 332
mbed_official 489:119543c9f674 333 }FSMC_NORSRAM_InitTypeDef;
mbed_official 489:119543c9f674 334
mbed_official 489:119543c9f674 335
mbed_official 489:119543c9f674 336 /**
mbed_official 489:119543c9f674 337 * @brief FSMC_NORSRAM Timing parameters structure definition
mbed_official 489:119543c9f674 338 */
mbed_official 489:119543c9f674 339 typedef struct
mbed_official 489:119543c9f674 340 {
mbed_official 489:119543c9f674 341 uint32_t AddressSetupTime; /*!< Defines the number of HCLK cycles to configure
mbed_official 489:119543c9f674 342 the duration of the address setup time.
mbed_official 489:119543c9f674 343 This parameter can be a value between Min_Data = 0 and Max_Data = 15.
mbed_official 489:119543c9f674 344 @note This parameter is not used with synchronous NOR Flash memories. */
mbed_official 489:119543c9f674 345
mbed_official 489:119543c9f674 346 uint32_t AddressHoldTime; /*!< Defines the number of HCLK cycles to configure
mbed_official 489:119543c9f674 347 the duration of the address hold time.
mbed_official 489:119543c9f674 348 This parameter can be a value between Min_Data = 1 and Max_Data = 15.
mbed_official 489:119543c9f674 349 @note This parameter is not used with synchronous NOR Flash memories. */
mbed_official 489:119543c9f674 350
mbed_official 489:119543c9f674 351 uint32_t DataSetupTime; /*!< Defines the number of HCLK cycles to configure
mbed_official 489:119543c9f674 352 the duration of the data setup time.
mbed_official 489:119543c9f674 353 This parameter can be a value between Min_Data = 1 and Max_Data = 255.
mbed_official 489:119543c9f674 354 @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed
mbed_official 489:119543c9f674 355 NOR Flash memories. */
mbed_official 489:119543c9f674 356
mbed_official 489:119543c9f674 357 uint32_t BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure
mbed_official 489:119543c9f674 358 the duration of the bus turnaround.
mbed_official 489:119543c9f674 359 This parameter can be a value between Min_Data = 0 and Max_Data = 15.
mbed_official 489:119543c9f674 360 @note This parameter is only used for multiplexed NOR Flash memories. */
mbed_official 489:119543c9f674 361
mbed_official 489:119543c9f674 362 uint32_t CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of
mbed_official 489:119543c9f674 363 HCLK cycles. This parameter can be a value between Min_Data = 2 and Max_Data = 16.
mbed_official 489:119543c9f674 364 @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM
mbed_official 489:119543c9f674 365 accesses. */
mbed_official 489:119543c9f674 366
mbed_official 489:119543c9f674 367 uint32_t DataLatency; /*!< Defines the number of memory clock cycles to issue
mbed_official 489:119543c9f674 368 to the memory before getting the first data.
mbed_official 489:119543c9f674 369 The parameter value depends on the memory type as shown below:
mbed_official 489:119543c9f674 370 - It must be set to 0 in case of a CRAM
mbed_official 489:119543c9f674 371 - It is don't care in asynchronous NOR, SRAM or ROM accesses
mbed_official 489:119543c9f674 372 - It may assume a value between Min_Data = 2 and Max_Data = 17 in NOR Flash memories
mbed_official 489:119543c9f674 373 with synchronous burst mode enable */
mbed_official 489:119543c9f674 374
mbed_official 489:119543c9f674 375 uint32_t AccessMode; /*!< Specifies the asynchronous access mode.
mbed_official 489:119543c9f674 376 This parameter can be a value of @ref FSMC_Access_Mode */
mbed_official 489:119543c9f674 377
mbed_official 489:119543c9f674 378 }FSMC_NORSRAM_TimingTypeDef;
mbed_official 489:119543c9f674 379
mbed_official 489:119543c9f674 380 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG)
mbed_official 489:119543c9f674 381 /**
mbed_official 489:119543c9f674 382 * @brief FSMC_NAND Configuration Structure definition
mbed_official 489:119543c9f674 383 */
mbed_official 489:119543c9f674 384 typedef struct
mbed_official 489:119543c9f674 385 {
mbed_official 489:119543c9f674 386 uint32_t NandBank; /*!< Specifies the NAND memory device that will be used.
mbed_official 489:119543c9f674 387 This parameter can be a value of @ref FSMC_NAND_Bank */
mbed_official 489:119543c9f674 388
mbed_official 489:119543c9f674 389 uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory device.
mbed_official 489:119543c9f674 390 This parameter can be any value of @ref FSMC_Wait_feature */
mbed_official 489:119543c9f674 391
mbed_official 489:119543c9f674 392 uint32_t MemoryDataWidth; /*!< Specifies the external memory device width.
mbed_official 489:119543c9f674 393 This parameter can be any value of @ref FSMC_NAND_Data_Width */
mbed_official 489:119543c9f674 394
mbed_official 489:119543c9f674 395 uint32_t EccComputation; /*!< Enables or disables the ECC computation.
mbed_official 489:119543c9f674 396 This parameter can be any value of @ref FSMC_ECC */
mbed_official 489:119543c9f674 397
mbed_official 489:119543c9f674 398 uint32_t ECCPageSize; /*!< Defines the page size for the extended ECC.
mbed_official 489:119543c9f674 399 This parameter can be any value of @ref FSMC_ECC_Page_Size */
mbed_official 489:119543c9f674 400
mbed_official 489:119543c9f674 401 uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
mbed_official 489:119543c9f674 402 delay between CLE low and RE low.
mbed_official 489:119543c9f674 403 This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 404
mbed_official 489:119543c9f674 405 uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
mbed_official 489:119543c9f674 406 delay between ALE low and RE low.
mbed_official 489:119543c9f674 407 This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 408
mbed_official 489:119543c9f674 409 }FSMC_NAND_InitTypeDef;
mbed_official 489:119543c9f674 410
mbed_official 489:119543c9f674 411 /**
mbed_official 489:119543c9f674 412 * @brief FSMC_NAND_PCCARD Timing parameters structure definition
mbed_official 489:119543c9f674 413 */
mbed_official 489:119543c9f674 414 typedef struct
mbed_official 489:119543c9f674 415 {
mbed_official 489:119543c9f674 416 uint32_t SetupTime; /*!< Defines the number of HCLK cycles to setup address before
mbed_official 489:119543c9f674 417 the command assertion for NAND-Flash read or write access
mbed_official 489:119543c9f674 418 to common/Attribute or I/O memory space (depending on
mbed_official 489:119543c9f674 419 the memory space timing to be configured).
mbed_official 489:119543c9f674 420 This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 421
mbed_official 489:119543c9f674 422 uint32_t WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the
mbed_official 489:119543c9f674 423 command for NAND-Flash read or write access to
mbed_official 489:119543c9f674 424 common/Attribute or I/O memory space (depending on the
mbed_official 489:119543c9f674 425 memory space timing to be configured).
mbed_official 489:119543c9f674 426 This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 427
mbed_official 489:119543c9f674 428 uint32_t HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address
mbed_official 489:119543c9f674 429 (and data for write access) after the command de-assertion
mbed_official 489:119543c9f674 430 for NAND-Flash read or write access to common/Attribute
mbed_official 489:119543c9f674 431 or I/O memory space (depending on the memory space timing
mbed_official 489:119543c9f674 432 to be configured).
mbed_official 489:119543c9f674 433 This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 434
mbed_official 489:119543c9f674 435 uint32_t HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the
mbed_official 489:119543c9f674 436 data bus is kept in HiZ after the start of a NAND-Flash
mbed_official 489:119543c9f674 437 write access to common/Attribute or I/O memory space (depending
mbed_official 489:119543c9f674 438 on the memory space timing to be configured).
mbed_official 489:119543c9f674 439 This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 440
mbed_official 489:119543c9f674 441 }FSMC_NAND_PCC_TimingTypeDef;
mbed_official 489:119543c9f674 442
mbed_official 489:119543c9f674 443 /**
mbed_official 489:119543c9f674 444 * @brief FSMC_NAND Configuration Structure definition
mbed_official 489:119543c9f674 445 */
mbed_official 489:119543c9f674 446 typedef struct
mbed_official 489:119543c9f674 447 {
mbed_official 489:119543c9f674 448 uint32_t Waitfeature; /*!< Enables or disables the Wait feature for the PCCARD Memory device.
mbed_official 489:119543c9f674 449 This parameter can be any value of @ref FSMC_Wait_feature */
mbed_official 489:119543c9f674 450
mbed_official 489:119543c9f674 451 uint32_t TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
mbed_official 489:119543c9f674 452 delay between CLE low and RE low.
mbed_official 489:119543c9f674 453 This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 454
mbed_official 489:119543c9f674 455 uint32_t TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
mbed_official 489:119543c9f674 456 delay between ALE low and RE low.
mbed_official 489:119543c9f674 457 This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 458
mbed_official 489:119543c9f674 459 }FSMC_PCCARD_InitTypeDef;
mbed_official 489:119543c9f674 460
mbed_official 489:119543c9f674 461 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
mbed_official 489:119543c9f674 462 /**
mbed_official 489:119543c9f674 463 * @}
mbed_official 489:119543c9f674 464 */
mbed_official 489:119543c9f674 465
mbed_official 489:119543c9f674 466 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 467
mbed_official 489:119543c9f674 468 /** @defgroup FSMC_Exported_Constants FSMC Low Layer Exported Constants
mbed_official 489:119543c9f674 469 * @{
mbed_official 489:119543c9f674 470 */
mbed_official 489:119543c9f674 471
mbed_official 489:119543c9f674 472 /** @defgroup FSMC_NORSRAM_Exported_constants FSMC NOR/SRAM Exported constants
mbed_official 489:119543c9f674 473 * @{
mbed_official 489:119543c9f674 474 */
mbed_official 489:119543c9f674 475
mbed_official 489:119543c9f674 476 /** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank
mbed_official 489:119543c9f674 477 * @{
mbed_official 489:119543c9f674 478 */
mbed_official 489:119543c9f674 479 #define FSMC_NORSRAM_BANK1 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 480 #define FSMC_NORSRAM_BANK2 ((uint32_t)0x00000002)
mbed_official 489:119543c9f674 481 #define FSMC_NORSRAM_BANK3 ((uint32_t)0x00000004)
mbed_official 489:119543c9f674 482 #define FSMC_NORSRAM_BANK4 ((uint32_t)0x00000006)
mbed_official 489:119543c9f674 483
mbed_official 489:119543c9f674 484 /**
mbed_official 489:119543c9f674 485 * @}
mbed_official 489:119543c9f674 486 */
mbed_official 489:119543c9f674 487
mbed_official 489:119543c9f674 488 /** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing
mbed_official 489:119543c9f674 489 * @{
mbed_official 489:119543c9f674 490 */
mbed_official 489:119543c9f674 491
mbed_official 489:119543c9f674 492 #define FSMC_DATA_ADDRESS_MUX_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 493 #define FSMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)FSMC_BCRx_MUXEN)
mbed_official 489:119543c9f674 494
mbed_official 489:119543c9f674 495 /**
mbed_official 489:119543c9f674 496 * @}
mbed_official 489:119543c9f674 497 */
mbed_official 489:119543c9f674 498
mbed_official 489:119543c9f674 499 /** @defgroup FSMC_Memory_Type FSMC Memory Type
mbed_official 489:119543c9f674 500 * @{
mbed_official 489:119543c9f674 501 */
mbed_official 489:119543c9f674 502
mbed_official 489:119543c9f674 503 #define FSMC_MEMORY_TYPE_SRAM ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 504 #define FSMC_MEMORY_TYPE_PSRAM ((uint32_t)FSMC_BCRx_MTYP_0)
mbed_official 489:119543c9f674 505 #define FSMC_MEMORY_TYPE_NOR ((uint32_t)FSMC_BCRx_MTYP_1)
mbed_official 489:119543c9f674 506
mbed_official 489:119543c9f674 507
mbed_official 489:119543c9f674 508 /**
mbed_official 489:119543c9f674 509 * @}
mbed_official 489:119543c9f674 510 */
mbed_official 489:119543c9f674 511
mbed_official 489:119543c9f674 512 /** @defgroup FSMC_NORSRAM_Data_Width FSMC NOR/SRAM Data Width
mbed_official 489:119543c9f674 513 * @{
mbed_official 489:119543c9f674 514 */
mbed_official 489:119543c9f674 515
mbed_official 489:119543c9f674 516 #define FSMC_NORSRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 517 #define FSMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)FSMC_BCRx_MWID_0)
mbed_official 489:119543c9f674 518 #define FSMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)FSMC_BCRx_MWID_1)
mbed_official 489:119543c9f674 519
mbed_official 489:119543c9f674 520 /**
mbed_official 489:119543c9f674 521 * @}
mbed_official 489:119543c9f674 522 */
mbed_official 489:119543c9f674 523
mbed_official 489:119543c9f674 524 /** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access
mbed_official 489:119543c9f674 525 * @{
mbed_official 489:119543c9f674 526 */
mbed_official 489:119543c9f674 527
mbed_official 489:119543c9f674 528 #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)FSMC_BCRx_FACCEN)
mbed_official 489:119543c9f674 529 #define FSMC_NORSRAM_FLASH_ACCESS_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 530 /**
mbed_official 489:119543c9f674 531 * @}
mbed_official 489:119543c9f674 532 */
mbed_official 489:119543c9f674 533
mbed_official 489:119543c9f674 534 /** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode
mbed_official 489:119543c9f674 535 * @{
mbed_official 489:119543c9f674 536 */
mbed_official 489:119543c9f674 537
mbed_official 489:119543c9f674 538 #define FSMC_BURST_ACCESS_MODE_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 539 #define FSMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)FSMC_BCRx_BURSTEN)
mbed_official 489:119543c9f674 540
mbed_official 489:119543c9f674 541 /**
mbed_official 489:119543c9f674 542 * @}
mbed_official 489:119543c9f674 543 */
mbed_official 489:119543c9f674 544
mbed_official 489:119543c9f674 545
mbed_official 489:119543c9f674 546 /** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity
mbed_official 489:119543c9f674 547 * @{
mbed_official 489:119543c9f674 548 */
mbed_official 489:119543c9f674 549
mbed_official 489:119543c9f674 550 #define FSMC_WAIT_SIGNAL_POLARITY_LOW ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 551 #define FSMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)FSMC_BCRx_WAITPOL)
mbed_official 489:119543c9f674 552
mbed_official 489:119543c9f674 553 /**
mbed_official 489:119543c9f674 554 * @}
mbed_official 489:119543c9f674 555 */
mbed_official 489:119543c9f674 556
mbed_official 489:119543c9f674 557 /** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode
mbed_official 489:119543c9f674 558 * @{
mbed_official 489:119543c9f674 559 */
mbed_official 489:119543c9f674 560
mbed_official 489:119543c9f674 561 #define FSMC_WRAP_MODE_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 562 #define FSMC_WRAP_MODE_ENABLE ((uint32_t)FSMC_BCRx_WRAPMOD)
mbed_official 489:119543c9f674 563
mbed_official 489:119543c9f674 564 /**
mbed_official 489:119543c9f674 565 * @}
mbed_official 489:119543c9f674 566 */
mbed_official 489:119543c9f674 567
mbed_official 489:119543c9f674 568 /** @defgroup FSMC_Wait_Timing FSMC Wait Timing
mbed_official 489:119543c9f674 569 * @{
mbed_official 489:119543c9f674 570 */
mbed_official 489:119543c9f674 571
mbed_official 489:119543c9f674 572 #define FSMC_WAIT_TIMING_BEFORE_WS ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 573 #define FSMC_WAIT_TIMING_DURING_WS ((uint32_t)FSMC_BCRx_WAITCFG)
mbed_official 489:119543c9f674 574
mbed_official 489:119543c9f674 575 /**
mbed_official 489:119543c9f674 576 * @}
mbed_official 489:119543c9f674 577 */
mbed_official 489:119543c9f674 578
mbed_official 489:119543c9f674 579 /** @defgroup FSMC_Write_Operation FSMC Write Operation
mbed_official 489:119543c9f674 580 * @{
mbed_official 489:119543c9f674 581 */
mbed_official 489:119543c9f674 582
mbed_official 489:119543c9f674 583 #define FSMC_WRITE_OPERATION_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 584 #define FSMC_WRITE_OPERATION_ENABLE ((uint32_t)FSMC_BCRx_WREN)
mbed_official 489:119543c9f674 585
mbed_official 489:119543c9f674 586 /**
mbed_official 489:119543c9f674 587 * @}
mbed_official 489:119543c9f674 588 */
mbed_official 489:119543c9f674 589
mbed_official 489:119543c9f674 590 /** @defgroup FSMC_Wait_Signal FSMC Wait Signal
mbed_official 489:119543c9f674 591 * @{
mbed_official 489:119543c9f674 592 */
mbed_official 489:119543c9f674 593
mbed_official 489:119543c9f674 594 #define FSMC_WAIT_SIGNAL_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 595 #define FSMC_WAIT_SIGNAL_ENABLE ((uint32_t)FSMC_BCRx_WAITEN)
mbed_official 489:119543c9f674 596
mbed_official 489:119543c9f674 597 /**
mbed_official 489:119543c9f674 598 * @}
mbed_official 489:119543c9f674 599 */
mbed_official 489:119543c9f674 600
mbed_official 489:119543c9f674 601 /** @defgroup FSMC_Extended_Mode FSMC Extended Mode
mbed_official 489:119543c9f674 602 * @{
mbed_official 489:119543c9f674 603 */
mbed_official 489:119543c9f674 604
mbed_official 489:119543c9f674 605 #define FSMC_EXTENDED_MODE_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 606 #define FSMC_EXTENDED_MODE_ENABLE ((uint32_t)FSMC_BCRx_EXTMOD)
mbed_official 489:119543c9f674 607
mbed_official 489:119543c9f674 608 /**
mbed_official 489:119543c9f674 609 * @}
mbed_official 489:119543c9f674 610 */
mbed_official 489:119543c9f674 611
mbed_official 489:119543c9f674 612 /** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait
mbed_official 489:119543c9f674 613 * @{
mbed_official 489:119543c9f674 614 */
mbed_official 489:119543c9f674 615
mbed_official 489:119543c9f674 616 #define FSMC_ASYNCHRONOUS_WAIT_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 617 #define FSMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)FSMC_BCRx_ASYNCWAIT)
mbed_official 489:119543c9f674 618
mbed_official 489:119543c9f674 619 /**
mbed_official 489:119543c9f674 620 * @}
mbed_official 489:119543c9f674 621 */
mbed_official 489:119543c9f674 622
mbed_official 489:119543c9f674 623 /** @defgroup FSMC_Write_Burst FSMC Write Burst
mbed_official 489:119543c9f674 624 * @{
mbed_official 489:119543c9f674 625 */
mbed_official 489:119543c9f674 626
mbed_official 489:119543c9f674 627 #define FSMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 628 #define FSMC_WRITE_BURST_ENABLE ((uint32_t)FSMC_BCRx_CBURSTRW)
mbed_official 489:119543c9f674 629
mbed_official 489:119543c9f674 630 /**
mbed_official 489:119543c9f674 631 * @}
mbed_official 489:119543c9f674 632 */
mbed_official 489:119543c9f674 633
mbed_official 489:119543c9f674 634 /** @defgroup FSMC_Access_Mode FSMC Access Mode
mbed_official 489:119543c9f674 635 * @{
mbed_official 489:119543c9f674 636 */
mbed_official 489:119543c9f674 637
mbed_official 489:119543c9f674 638 #define FSMC_ACCESS_MODE_A ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 639 #define FSMC_ACCESS_MODE_B ((uint32_t)FSMC_BTRx_ACCMOD_0)
mbed_official 489:119543c9f674 640 #define FSMC_ACCESS_MODE_C ((uint32_t)FSMC_BTRx_ACCMOD_1)
mbed_official 489:119543c9f674 641 #define FSMC_ACCESS_MODE_D ((uint32_t)(FSMC_BTRx_ACCMOD_0 | FSMC_BTRx_ACCMOD_1))
mbed_official 489:119543c9f674 642
mbed_official 489:119543c9f674 643 /**
mbed_official 489:119543c9f674 644 * @}
mbed_official 489:119543c9f674 645 */
mbed_official 489:119543c9f674 646
mbed_official 489:119543c9f674 647
mbed_official 489:119543c9f674 648 /**
mbed_official 489:119543c9f674 649 * @}
mbed_official 489:119543c9f674 650 */
mbed_official 489:119543c9f674 651
mbed_official 489:119543c9f674 652 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG)
mbed_official 489:119543c9f674 653 /** @defgroup FSMC_NAND_Controller FSMC NAND and PCCARD Controller
mbed_official 489:119543c9f674 654 * @{
mbed_official 489:119543c9f674 655 */
mbed_official 489:119543c9f674 656
mbed_official 489:119543c9f674 657 /** @defgroup FSMC_NAND_Bank FSMC_NAND_Bank
mbed_official 489:119543c9f674 658 * @{
mbed_official 489:119543c9f674 659 */
mbed_official 489:119543c9f674 660 #define FSMC_NAND_BANK2 ((uint32_t)0x00000010)
mbed_official 489:119543c9f674 661 #define FSMC_NAND_BANK3 ((uint32_t)0x00000100)
mbed_official 489:119543c9f674 662
mbed_official 489:119543c9f674 663 /**
mbed_official 489:119543c9f674 664 * @}
mbed_official 489:119543c9f674 665 */
mbed_official 489:119543c9f674 666
mbed_official 489:119543c9f674 667 /** @defgroup FSMC_Wait_feature FSMC_Wait_feature
mbed_official 489:119543c9f674 668 * @{
mbed_official 489:119543c9f674 669 */
mbed_official 489:119543c9f674 670 #define FSMC_NAND_PCC_WAIT_FEATURE_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 671 #define FSMC_NAND_PCC_WAIT_FEATURE_ENABLE ((uint32_t)0x00000002)
mbed_official 489:119543c9f674 672
mbed_official 489:119543c9f674 673 /**
mbed_official 489:119543c9f674 674 * @}
mbed_official 489:119543c9f674 675 */
mbed_official 489:119543c9f674 676
mbed_official 489:119543c9f674 677 /** @defgroup FSMC_PCR_Memory_Type FSMC_PCR_Memory_Type
mbed_official 489:119543c9f674 678 * @{
mbed_official 489:119543c9f674 679 */
mbed_official 489:119543c9f674 680 #define FSMC_PCR_MEMORY_TYPE_PCCARD ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 681 #define FSMC_PCR_MEMORY_TYPE_NAND ((uint32_t)FSMC_PCRx_PTYP)
mbed_official 489:119543c9f674 682 /**
mbed_official 489:119543c9f674 683 * @}
mbed_official 489:119543c9f674 684 */
mbed_official 489:119543c9f674 685
mbed_official 489:119543c9f674 686 /** @defgroup FSMC_NAND_Data_Width FSMC_NAND_Data_Width
mbed_official 489:119543c9f674 687 * @{
mbed_official 489:119543c9f674 688 */
mbed_official 489:119543c9f674 689 #define FSMC_NAND_PCC_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 690 #define FSMC_NAND_PCC_MEM_BUS_WIDTH_16 ((uint32_t)FSMC_PCRx_PWID_0)
mbed_official 489:119543c9f674 691
mbed_official 489:119543c9f674 692 /**
mbed_official 489:119543c9f674 693 * @}
mbed_official 489:119543c9f674 694 */
mbed_official 489:119543c9f674 695
mbed_official 489:119543c9f674 696 /** @defgroup FSMC_ECC FSMC_ECC
mbed_official 489:119543c9f674 697 * @{
mbed_official 489:119543c9f674 698 */
mbed_official 489:119543c9f674 699 #define FSMC_NAND_ECC_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 700 #define FSMC_NAND_ECC_ENABLE ((uint32_t)FSMC_PCRx_ECCEN)
mbed_official 489:119543c9f674 701
mbed_official 489:119543c9f674 702 /**
mbed_official 489:119543c9f674 703 * @}
mbed_official 489:119543c9f674 704 */
mbed_official 489:119543c9f674 705
mbed_official 489:119543c9f674 706 /** @defgroup FSMC_ECC_Page_Size FSMC_ECC_Page_Size
mbed_official 489:119543c9f674 707 * @{
mbed_official 489:119543c9f674 708 */
mbed_official 489:119543c9f674 709 #define FSMC_NAND_ECC_PAGE_SIZE_256BYTE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 710 #define FSMC_NAND_ECC_PAGE_SIZE_512BYTE ((uint32_t)FSMC_PCRx_ECCPS_0)
mbed_official 489:119543c9f674 711 #define FSMC_NAND_ECC_PAGE_SIZE_1024BYTE ((uint32_t)FSMC_PCRx_ECCPS_1)
mbed_official 489:119543c9f674 712 #define FSMC_NAND_ECC_PAGE_SIZE_2048BYTE ((uint32_t)FSMC_PCRx_ECCPS_0|FSMC_PCRx_ECCPS_1)
mbed_official 489:119543c9f674 713 #define FSMC_NAND_ECC_PAGE_SIZE_4096BYTE ((uint32_t)FSMC_PCRx_ECCPS_2)
mbed_official 489:119543c9f674 714 #define FSMC_NAND_ECC_PAGE_SIZE_8192BYTE ((uint32_t)FSMC_PCRx_ECCPS_0|FSMC_PCRx_ECCPS_2)
mbed_official 489:119543c9f674 715
mbed_official 489:119543c9f674 716 /**
mbed_official 489:119543c9f674 717 * @}
mbed_official 489:119543c9f674 718 */
mbed_official 489:119543c9f674 719
mbed_official 489:119543c9f674 720 /** @defgroup FSMC_Interrupt_definition FSMC_Interrupt_definition
mbed_official 489:119543c9f674 721 * @brief FSMC Interrupt definition
mbed_official 489:119543c9f674 722 * @{
mbed_official 489:119543c9f674 723 */
mbed_official 489:119543c9f674 724 #define FSMC_IT_RISING_EDGE ((uint32_t)FSMC_SRx_IREN)
mbed_official 489:119543c9f674 725 #define FSMC_IT_LEVEL ((uint32_t)FSMC_SRx_ILEN)
mbed_official 489:119543c9f674 726 #define FSMC_IT_FALLING_EDGE ((uint32_t)FSMC_SRx_IFEN)
mbed_official 489:119543c9f674 727
mbed_official 489:119543c9f674 728 /**
mbed_official 489:119543c9f674 729 * @}
mbed_official 489:119543c9f674 730 */
mbed_official 489:119543c9f674 731
mbed_official 489:119543c9f674 732 /** @defgroup FSMC_Flag_definition FSMC_Flag_definition
mbed_official 489:119543c9f674 733 * @brief FSMC Flag definition
mbed_official 489:119543c9f674 734 * @{
mbed_official 489:119543c9f674 735 */
mbed_official 489:119543c9f674 736 #define FSMC_FLAG_RISING_EDGE ((uint32_t)FSMC_SRx_IRS)
mbed_official 489:119543c9f674 737 #define FSMC_FLAG_LEVEL ((uint32_t)FSMC_SRx_ILS)
mbed_official 489:119543c9f674 738 #define FSMC_FLAG_FALLING_EDGE ((uint32_t)FSMC_SRx_IFS)
mbed_official 489:119543c9f674 739 #define FSMC_FLAG_FEMPT ((uint32_t)FSMC_SRx_FEMPT)
mbed_official 489:119543c9f674 740
mbed_official 489:119543c9f674 741 /**
mbed_official 489:119543c9f674 742 * @}
mbed_official 489:119543c9f674 743 */
mbed_official 489:119543c9f674 744
mbed_official 489:119543c9f674 745 /**
mbed_official 489:119543c9f674 746 * @}
mbed_official 489:119543c9f674 747 */
mbed_official 489:119543c9f674 748 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
mbed_official 489:119543c9f674 749
mbed_official 489:119543c9f674 750 /**
mbed_official 489:119543c9f674 751 * @}
mbed_official 489:119543c9f674 752 */
mbed_official 489:119543c9f674 753
mbed_official 489:119543c9f674 754 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 755
mbed_official 489:119543c9f674 756 /** @defgroup FSMC_Exported_Macros FSMC Low Layer Exported Macros
mbed_official 489:119543c9f674 757 * @{
mbed_official 489:119543c9f674 758 */
mbed_official 489:119543c9f674 759
mbed_official 489:119543c9f674 760 /** @defgroup FSMC_NOR_Macros FSMC NOR/SRAM Exported Macros
mbed_official 489:119543c9f674 761 * @brief macros to handle NOR device enable/disable and read/write operations
mbed_official 489:119543c9f674 762 * @{
mbed_official 489:119543c9f674 763 */
mbed_official 489:119543c9f674 764
mbed_official 489:119543c9f674 765 /**
mbed_official 489:119543c9f674 766 * @brief Enable the NORSRAM device access.
mbed_official 489:119543c9f674 767 * @param __INSTANCE__: FSMC_NORSRAM Instance
mbed_official 489:119543c9f674 768 * @param __BANK__: FSMC_NORSRAM Bank
mbed_official 489:119543c9f674 769 * @retval none
mbed_official 489:119543c9f674 770 */
mbed_official 489:119543c9f674 771 #define __FSMC_NORSRAM_ENABLE(__INSTANCE__, __BANK__) SET_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN)
mbed_official 489:119543c9f674 772
mbed_official 489:119543c9f674 773 /**
mbed_official 489:119543c9f674 774 * @brief Disable the NORSRAM device access.
mbed_official 489:119543c9f674 775 * @param __INSTANCE__: FSMC_NORSRAM Instance
mbed_official 489:119543c9f674 776 * @param __BANK__: FSMC_NORSRAM Bank
mbed_official 489:119543c9f674 777 * @retval none
mbed_official 489:119543c9f674 778 */
mbed_official 489:119543c9f674 779 #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) CLEAR_BIT((__INSTANCE__)->BTCR[(__BANK__)], FSMC_BCRx_MBKEN)
mbed_official 489:119543c9f674 780
mbed_official 489:119543c9f674 781 /**
mbed_official 489:119543c9f674 782 * @}
mbed_official 489:119543c9f674 783 */
mbed_official 489:119543c9f674 784
mbed_official 489:119543c9f674 785 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG)
mbed_official 489:119543c9f674 786 /** @defgroup FSMC_NAND_Macros FSMC_NAND_Macros
mbed_official 489:119543c9f674 787 * @brief macros to handle NAND device enable/disable
mbed_official 489:119543c9f674 788 * @{
mbed_official 489:119543c9f674 789 */
mbed_official 489:119543c9f674 790
mbed_official 489:119543c9f674 791 /**
mbed_official 489:119543c9f674 792 * @brief Enable the NAND device access.
mbed_official 489:119543c9f674 793 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 794 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 795 * @retval None
mbed_official 489:119543c9f674 796 */
mbed_official 489:119543c9f674 797 #define __FSMC_NAND_ENABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? SET_BIT((__INSTANCE__)->PCR2, FSMC_PCRx_PBKEN): \
mbed_official 489:119543c9f674 798 SET_BIT((__INSTANCE__)->PCR3, FSMC_PCRx_PBKEN))
mbed_official 489:119543c9f674 799
mbed_official 489:119543c9f674 800 /**
mbed_official 489:119543c9f674 801 * @brief Disable the NAND device access.
mbed_official 489:119543c9f674 802 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 803 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 804 * @retval None
mbed_official 489:119543c9f674 805 */
mbed_official 489:119543c9f674 806 #define __FSMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->PCR2, FSMC_PCRx_PBKEN): \
mbed_official 489:119543c9f674 807 CLEAR_BIT((__INSTANCE__)->PCR3, FSMC_PCRx_PBKEN))
mbed_official 489:119543c9f674 808 /**
mbed_official 489:119543c9f674 809 * @}
mbed_official 489:119543c9f674 810 */
mbed_official 489:119543c9f674 811
mbed_official 489:119543c9f674 812 /** @defgroup FSMC_PCCARD_Macros FSMC_PCCARD_Macros
mbed_official 489:119543c9f674 813 * @brief macros to handle SRAM read/write operations
mbed_official 489:119543c9f674 814 * @{
mbed_official 489:119543c9f674 815 */
mbed_official 489:119543c9f674 816
mbed_official 489:119543c9f674 817 /**
mbed_official 489:119543c9f674 818 * @brief Enable the PCCARD device access.
mbed_official 489:119543c9f674 819 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 820 * @retval None
mbed_official 489:119543c9f674 821 */
mbed_official 489:119543c9f674 822 #define __FSMC_PCCARD_ENABLE(__INSTANCE__) SET_BIT((__INSTANCE__)->PCR4, FSMC_PCRx_PBKEN)
mbed_official 489:119543c9f674 823
mbed_official 489:119543c9f674 824 /**
mbed_official 489:119543c9f674 825 * @brief Disable the PCCARD device access.
mbed_official 489:119543c9f674 826 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 827 * @retval None
mbed_official 489:119543c9f674 828 */
mbed_official 489:119543c9f674 829 #define __FSMC_PCCARD_DISABLE(__INSTANCE__) CLEAR_BIT((__INSTANCE__)->PCR4, FSMC_PCRx_PBKEN)
mbed_official 489:119543c9f674 830 /**
mbed_official 489:119543c9f674 831 * @}
mbed_official 489:119543c9f674 832 */
mbed_official 489:119543c9f674 833
mbed_official 489:119543c9f674 834 /** @defgroup FSMC_Interrupt FSMC_Interrupt
mbed_official 489:119543c9f674 835 * @brief macros to handle FSMC interrupts
mbed_official 489:119543c9f674 836 * @{
mbed_official 489:119543c9f674 837 */
mbed_official 489:119543c9f674 838
mbed_official 489:119543c9f674 839 /**
mbed_official 489:119543c9f674 840 * @brief Enable the NAND device interrupt.
mbed_official 489:119543c9f674 841 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 842 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 843 * @param __INTERRUPT__: FSMC_NAND interrupt
mbed_official 489:119543c9f674 844 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 845 * @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
mbed_official 489:119543c9f674 846 * @arg FSMC_IT_LEVEL: Interrupt level.
mbed_official 489:119543c9f674 847 * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
mbed_official 489:119543c9f674 848 * @retval None
mbed_official 489:119543c9f674 849 */
mbed_official 489:119543c9f674 850 #define __FSMC_NAND_ENABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FSMC_NAND_BANK2)? SET_BIT((__INSTANCE__)->SR2, (__INTERRUPT__)): \
mbed_official 489:119543c9f674 851 SET_BIT((__INSTANCE__)->SR3, (__INTERRUPT__)))
mbed_official 489:119543c9f674 852
mbed_official 489:119543c9f674 853 /**
mbed_official 489:119543c9f674 854 * @brief Disable the NAND device interrupt.
mbed_official 489:119543c9f674 855 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 856 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 857 * @param __INTERRUPT__: FSMC_NAND interrupt
mbed_official 489:119543c9f674 858 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 859 * @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
mbed_official 489:119543c9f674 860 * @arg FSMC_IT_LEVEL: Interrupt level.
mbed_official 489:119543c9f674 861 * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
mbed_official 489:119543c9f674 862 * @retval None
mbed_official 489:119543c9f674 863 */
mbed_official 489:119543c9f674 864 #define __FSMC_NAND_DISABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->SR2, (__INTERRUPT__)): \
mbed_official 489:119543c9f674 865 CLEAR_BIT((__INSTANCE__)->SR3, (__INTERRUPT__)))
mbed_official 489:119543c9f674 866
mbed_official 489:119543c9f674 867 /**
mbed_official 489:119543c9f674 868 * @brief Get flag status of the NAND device.
mbed_official 489:119543c9f674 869 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 870 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 871 * @param __FLAG__: FSMC_NAND flag
mbed_official 489:119543c9f674 872 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 873 * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
mbed_official 489:119543c9f674 874 * @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
mbed_official 489:119543c9f674 875 * @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
mbed_official 489:119543c9f674 876 * @arg FSMC_FLAG_FEMPT: FIFO empty flag.
mbed_official 489:119543c9f674 877 * @retval The state of FLAG (SET or RESET).
mbed_official 489:119543c9f674 878 */
mbed_official 489:119543c9f674 879 #define __FSMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FSMC_NAND_BANK2)? (((__INSTANCE__)->SR2 &(__FLAG__)) == (__FLAG__)): \
mbed_official 489:119543c9f674 880 (((__INSTANCE__)->SR3 &(__FLAG__)) == (__FLAG__)))
mbed_official 489:119543c9f674 881 /**
mbed_official 489:119543c9f674 882 * @brief Clear flag status of the NAND device.
mbed_official 489:119543c9f674 883 * @param __INSTANCE__: FSMC_NAND Instance
mbed_official 489:119543c9f674 884 * @param __BANK__: FSMC_NAND Bank
mbed_official 489:119543c9f674 885 * @param __FLAG__: FSMC_NAND flag
mbed_official 489:119543c9f674 886 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 887 * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
mbed_official 489:119543c9f674 888 * @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
mbed_official 489:119543c9f674 889 * @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
mbed_official 489:119543c9f674 890 * @arg FSMC_FLAG_FEMPT: FIFO empty flag.
mbed_official 489:119543c9f674 891 * @retval None
mbed_official 489:119543c9f674 892 */
mbed_official 489:119543c9f674 893 #define __FSMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FSMC_NAND_BANK2)? CLEAR_BIT((__INSTANCE__)->SR2, (__FLAG__)): \
mbed_official 489:119543c9f674 894 CLEAR_BIT((__INSTANCE__)->SR3, (__FLAG__)))
mbed_official 489:119543c9f674 895 /**
mbed_official 489:119543c9f674 896 * @brief Enable the PCCARD device interrupt.
mbed_official 489:119543c9f674 897 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 898 * @param __INTERRUPT__: FSMC_PCCARD interrupt
mbed_official 489:119543c9f674 899 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 900 * @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
mbed_official 489:119543c9f674 901 * @arg FSMC_IT_LEVEL: Interrupt level.
mbed_official 489:119543c9f674 902 * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
mbed_official 489:119543c9f674 903 * @retval None
mbed_official 489:119543c9f674 904 */
mbed_official 489:119543c9f674 905 #define __FSMC_PCCARD_ENABLE_IT(__INSTANCE__, __INTERRUPT__) SET_BIT((__INSTANCE__)->SR4, (__INTERRUPT__))
mbed_official 489:119543c9f674 906
mbed_official 489:119543c9f674 907 /**
mbed_official 489:119543c9f674 908 * @brief Disable the PCCARD device interrupt.
mbed_official 489:119543c9f674 909 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 910 * @param __INTERRUPT__: FSMC_PCCARD interrupt
mbed_official 489:119543c9f674 911 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 912 * @arg FSMC_IT_RISING_EDGE: Interrupt rising edge.
mbed_official 489:119543c9f674 913 * @arg FSMC_IT_LEVEL: Interrupt level.
mbed_official 489:119543c9f674 914 * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge.
mbed_official 489:119543c9f674 915 * @retval None
mbed_official 489:119543c9f674 916 */
mbed_official 489:119543c9f674 917 #define __FSMC_PCCARD_DISABLE_IT(__INSTANCE__, __INTERRUPT__) CLEAR_BIT((__INSTANCE__)->SR4, (__INTERRUPT__))
mbed_official 489:119543c9f674 918
mbed_official 489:119543c9f674 919 /**
mbed_official 489:119543c9f674 920 * @brief Get flag status of the PCCARD device.
mbed_official 489:119543c9f674 921 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 922 * @param __FLAG__: FSMC_PCCARD flag
mbed_official 489:119543c9f674 923 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 924 * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
mbed_official 489:119543c9f674 925 * @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
mbed_official 489:119543c9f674 926 * @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
mbed_official 489:119543c9f674 927 * @arg FSMC_FLAG_FEMPT: FIFO empty flag.
mbed_official 489:119543c9f674 928 * @retval The state of FLAG (SET or RESET).
mbed_official 489:119543c9f674 929 */
mbed_official 489:119543c9f674 930 #define __FSMC_PCCARD_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->SR4 &(__FLAG__)) == (__FLAG__))
mbed_official 489:119543c9f674 931
mbed_official 489:119543c9f674 932 /**
mbed_official 489:119543c9f674 933 * @brief Clear flag status of the PCCARD device.
mbed_official 489:119543c9f674 934 * @param __INSTANCE__: FSMC_PCCARD Instance
mbed_official 489:119543c9f674 935 * @param __FLAG__: FSMC_PCCARD flag
mbed_official 489:119543c9f674 936 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 937 * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag.
mbed_official 489:119543c9f674 938 * @arg FSMC_FLAG_LEVEL: Interrupt level edge flag.
mbed_official 489:119543c9f674 939 * @arg FSMC_FLAG_FALLING_EDGE: Interrupt falling edge flag.
mbed_official 489:119543c9f674 940 * @arg FSMC_FLAG_FEMPT: FIFO empty flag.
mbed_official 489:119543c9f674 941 * @retval None
mbed_official 489:119543c9f674 942 */
mbed_official 489:119543c9f674 943 #define __FSMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__) CLEAR_BIT((__INSTANCE__)->SR4, (__FLAG__))
mbed_official 489:119543c9f674 944
mbed_official 489:119543c9f674 945 /**
mbed_official 489:119543c9f674 946 * @}
mbed_official 489:119543c9f674 947 */
mbed_official 489:119543c9f674 948
mbed_official 489:119543c9f674 949 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
mbed_official 489:119543c9f674 950
mbed_official 489:119543c9f674 951 /**
mbed_official 489:119543c9f674 952 * @}
mbed_official 489:119543c9f674 953 */
mbed_official 489:119543c9f674 954
mbed_official 489:119543c9f674 955 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 956
mbed_official 489:119543c9f674 957 /** @addtogroup FSMC_LL_Exported_Functions
mbed_official 489:119543c9f674 958 * @{
mbed_official 489:119543c9f674 959 */
mbed_official 489:119543c9f674 960
mbed_official 489:119543c9f674 961 /** @addtogroup FSMC_NORSRAM
mbed_official 489:119543c9f674 962 * @{
mbed_official 489:119543c9f674 963 */
mbed_official 489:119543c9f674 964
mbed_official 489:119543c9f674 965 /** @addtogroup FSMC_NORSRAM_Group1
mbed_official 489:119543c9f674 966 * @{
mbed_official 489:119543c9f674 967 */
mbed_official 489:119543c9f674 968
mbed_official 489:119543c9f674 969 /* FSMC_NORSRAM Controller functions ******************************************/
mbed_official 489:119543c9f674 970 /* Initialization/de-initialization functions */
mbed_official 489:119543c9f674 971 HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef *Init);
mbed_official 489:119543c9f674 972 HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank);
mbed_official 489:119543c9f674 973 HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode);
mbed_official 489:119543c9f674 974 HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank);
mbed_official 489:119543c9f674 975
mbed_official 489:119543c9f674 976 /**
mbed_official 489:119543c9f674 977 * @}
mbed_official 489:119543c9f674 978 */
mbed_official 489:119543c9f674 979
mbed_official 489:119543c9f674 980 /** @addtogroup FSMC_NORSRAM_Group2
mbed_official 489:119543c9f674 981 * @{
mbed_official 489:119543c9f674 982 */
mbed_official 489:119543c9f674 983
mbed_official 489:119543c9f674 984 /* FSMC_NORSRAM Control functions */
mbed_official 489:119543c9f674 985 HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
mbed_official 489:119543c9f674 986 HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank);
mbed_official 489:119543c9f674 987
mbed_official 489:119543c9f674 988 /**
mbed_official 489:119543c9f674 989 * @}
mbed_official 489:119543c9f674 990 */
mbed_official 489:119543c9f674 991
mbed_official 489:119543c9f674 992 /**
mbed_official 489:119543c9f674 993 * @}
mbed_official 489:119543c9f674 994 */
mbed_official 489:119543c9f674 995
mbed_official 489:119543c9f674 996 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG)
mbed_official 489:119543c9f674 997 /** @addtogroup FSMC_NAND
mbed_official 489:119543c9f674 998 * @{
mbed_official 489:119543c9f674 999 */
mbed_official 489:119543c9f674 1000
mbed_official 489:119543c9f674 1001 /* FSMC_NAND Controller functions **********************************************/
mbed_official 489:119543c9f674 1002 /* Initialization/de-initialization functions */
mbed_official 489:119543c9f674 1003 /** @addtogroup FSMC_NAND_Exported_Functions_Group1
mbed_official 489:119543c9f674 1004 * @{
mbed_official 489:119543c9f674 1005 */
mbed_official 489:119543c9f674 1006
mbed_official 489:119543c9f674 1007 HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init);
mbed_official 489:119543c9f674 1008 HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
mbed_official 489:119543c9f674 1009 HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank);
mbed_official 489:119543c9f674 1010 HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank);
mbed_official 489:119543c9f674 1011
mbed_official 489:119543c9f674 1012 /**
mbed_official 489:119543c9f674 1013 * @}
mbed_official 489:119543c9f674 1014 */
mbed_official 489:119543c9f674 1015
mbed_official 489:119543c9f674 1016 /* FSMC_NAND Control functions */
mbed_official 489:119543c9f674 1017 /** @addtogroup FSMC_NAND_Exported_Functions_Group2
mbed_official 489:119543c9f674 1018 * @{
mbed_official 489:119543c9f674 1019 */
mbed_official 489:119543c9f674 1020
mbed_official 489:119543c9f674 1021 HAL_StatusTypeDef FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
mbed_official 489:119543c9f674 1022 HAL_StatusTypeDef FSMC_NAND_ECC_Disable(FSMC_NAND_TypeDef *Device, uint32_t Bank);
mbed_official 489:119543c9f674 1023 HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout);
mbed_official 489:119543c9f674 1024
mbed_official 489:119543c9f674 1025 /**
mbed_official 489:119543c9f674 1026 * @}
mbed_official 489:119543c9f674 1027 */
mbed_official 489:119543c9f674 1028
mbed_official 489:119543c9f674 1029 /**
mbed_official 489:119543c9f674 1030 * @}
mbed_official 489:119543c9f674 1031 */
mbed_official 489:119543c9f674 1032
mbed_official 489:119543c9f674 1033 /** @addtogroup FSMC_PCCARD
mbed_official 489:119543c9f674 1034 * @{
mbed_official 489:119543c9f674 1035 */
mbed_official 489:119543c9f674 1036
mbed_official 489:119543c9f674 1037 /* FSMC_PCCARD Controller functions ********************************************/
mbed_official 489:119543c9f674 1038 /* Initialization/de-initialization functions */
mbed_official 489:119543c9f674 1039 /** @addtogroup FSMC_PCCARD_Exported_Functions_Group1
mbed_official 489:119543c9f674 1040 * @{
mbed_official 489:119543c9f674 1041 */
mbed_official 489:119543c9f674 1042
mbed_official 489:119543c9f674 1043 HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init);
mbed_official 489:119543c9f674 1044 HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
mbed_official 489:119543c9f674 1045 HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
mbed_official 489:119543c9f674 1046 HAL_StatusTypeDef FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing);
mbed_official 489:119543c9f674 1047 HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device);
mbed_official 489:119543c9f674 1048
mbed_official 489:119543c9f674 1049 /**
mbed_official 489:119543c9f674 1050 * @}
mbed_official 489:119543c9f674 1051 */
mbed_official 489:119543c9f674 1052
mbed_official 489:119543c9f674 1053 /**
mbed_official 489:119543c9f674 1054 * @}
mbed_official 489:119543c9f674 1055 */
mbed_official 489:119543c9f674 1056
mbed_official 489:119543c9f674 1057 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
mbed_official 489:119543c9f674 1058
mbed_official 489:119543c9f674 1059 /**
mbed_official 489:119543c9f674 1060 * @}
mbed_official 489:119543c9f674 1061 */
mbed_official 489:119543c9f674 1062
mbed_official 489:119543c9f674 1063 /**
mbed_official 489:119543c9f674 1064 * @}
mbed_official 489:119543c9f674 1065 */
mbed_official 489:119543c9f674 1066
mbed_official 489:119543c9f674 1067 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG || STM32F100xE */
mbed_official 489:119543c9f674 1068
mbed_official 489:119543c9f674 1069 /**
mbed_official 489:119543c9f674 1070 * @}
mbed_official 489:119543c9f674 1071 */
mbed_official 489:119543c9f674 1072
mbed_official 489:119543c9f674 1073 #ifdef __cplusplus
mbed_official 489:119543c9f674 1074 }
mbed_official 489:119543c9f674 1075 #endif
mbed_official 489:119543c9f674 1076
mbed_official 489:119543c9f674 1077 #endif /* __STM32F1xx_LL_FSMC_H */
mbed_official 489:119543c9f674 1078
mbed_official 489:119543c9f674 1079 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
mbed_official 489:119543c9f674 1080