Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

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