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