mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Mar 24 17:45:07 2014 +0000
Revision:
133:d4dda5c437f0
Child:
242:7074e42da0b2
Synchronized with git revision 47b961246bed973fe4cb8932781ffc8025b78a61

Full URL: https://github.com/mbedmicro/mbed/commit/47b961246bed973fe4cb8932781ffc8025b78a61/

[STM32F4-Discovery (STM32F407VG)] initial port

Who changed what in which revision?

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