24 #ifndef __STM32F4xx_FSMC_H
25 #define __STM32F4xx_FSMC_H
241 #define FSMC_Bank1_NORSRAM1 ((uint32_t)0x00000000)
242 #define FSMC_Bank1_NORSRAM2 ((uint32_t)0x00000002)
243 #define FSMC_Bank1_NORSRAM3 ((uint32_t)0x00000004)
244 #define FSMC_Bank1_NORSRAM4 ((uint32_t)0x00000006)
252 #define FSMC_Bank2_NAND ((uint32_t)0x00000010)
253 #define FSMC_Bank3_NAND ((uint32_t)0x00000100)
261 #define FSMC_Bank4_PCCARD ((uint32_t)0x00001000)
266 #define IS_FSMC_NORSRAM_BANK(BANK) (((BANK) == FSMC_Bank1_NORSRAM1) || \
267 ((BANK) == FSMC_Bank1_NORSRAM2) || \
268 ((BANK) == FSMC_Bank1_NORSRAM3) || \
269 ((BANK) == FSMC_Bank1_NORSRAM4))
271 #define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \
272 ((BANK) == FSMC_Bank3_NAND))
274 #define IS_FSMC_GETFLAG_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \
275 ((BANK) == FSMC_Bank3_NAND) || \
276 ((BANK) == FSMC_Bank4_PCCARD))
278 #define IS_FSMC_IT_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \
279 ((BANK) == FSMC_Bank3_NAND) || \
280 ((BANK) == FSMC_Bank4_PCCARD))
290 #define FSMC_DataAddressMux_Disable ((uint32_t)0x00000000)
291 #define FSMC_DataAddressMux_Enable ((uint32_t)0x00000002)
292 #define IS_FSMC_MUX(MUX) (((MUX) == FSMC_DataAddressMux_Disable) || \
293 ((MUX) == FSMC_DataAddressMux_Enable))
302 #define FSMC_MemoryType_SRAM ((uint32_t)0x00000000)
303 #define FSMC_MemoryType_PSRAM ((uint32_t)0x00000004)
304 #define FSMC_MemoryType_NOR ((uint32_t)0x00000008)
305 #define IS_FSMC_MEMORY(MEMORY) (((MEMORY) == FSMC_MemoryType_SRAM) || \
306 ((MEMORY) == FSMC_MemoryType_PSRAM)|| \
307 ((MEMORY) == FSMC_MemoryType_NOR))
316 #define FSMC_MemoryDataWidth_8b ((uint32_t)0x00000000)
317 #define FSMC_MemoryDataWidth_16b ((uint32_t)0x00000010)
318 #define IS_FSMC_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_MemoryDataWidth_8b) || \
319 ((WIDTH) == FSMC_MemoryDataWidth_16b))
328 #define FSMC_BurstAccessMode_Disable ((uint32_t)0x00000000)
329 #define FSMC_BurstAccessMode_Enable ((uint32_t)0x00000100)
330 #define IS_FSMC_BURSTMODE(STATE) (((STATE) == FSMC_BurstAccessMode_Disable) || \
331 ((STATE) == FSMC_BurstAccessMode_Enable))
339 #define FSMC_AsynchronousWait_Disable ((uint32_t)0x00000000)
340 #define FSMC_AsynchronousWait_Enable ((uint32_t)0x00008000)
341 #define IS_FSMC_ASYNWAIT(STATE) (((STATE) == FSMC_AsynchronousWait_Disable) || \
342 ((STATE) == FSMC_AsynchronousWait_Enable))
350 #define FSMC_WaitSignalPolarity_Low ((uint32_t)0x00000000)
351 #define FSMC_WaitSignalPolarity_High ((uint32_t)0x00000200)
352 #define IS_FSMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FSMC_WaitSignalPolarity_Low) || \
353 ((POLARITY) == FSMC_WaitSignalPolarity_High))
361 #define FSMC_WrapMode_Disable ((uint32_t)0x00000000)
362 #define FSMC_WrapMode_Enable ((uint32_t)0x00000400)
363 #define IS_FSMC_WRAP_MODE(MODE) (((MODE) == FSMC_WrapMode_Disable) || \
364 ((MODE) == FSMC_WrapMode_Enable))
372 #define FSMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000)
373 #define FSMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800)
374 #define IS_FSMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FSMC_WaitSignalActive_BeforeWaitState) || \
375 ((ACTIVE) == FSMC_WaitSignalActive_DuringWaitState))
383 #define FSMC_WriteOperation_Disable ((uint32_t)0x00000000)
384 #define FSMC_WriteOperation_Enable ((uint32_t)0x00001000)
385 #define IS_FSMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FSMC_WriteOperation_Disable) || \
386 ((OPERATION) == FSMC_WriteOperation_Enable))
394 #define FSMC_WaitSignal_Disable ((uint32_t)0x00000000)
395 #define FSMC_WaitSignal_Enable ((uint32_t)0x00002000)
396 #define IS_FSMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FSMC_WaitSignal_Disable) || \
397 ((SIGNAL) == FSMC_WaitSignal_Enable))
405 #define FSMC_ExtendedMode_Disable ((uint32_t)0x00000000)
406 #define FSMC_ExtendedMode_Enable ((uint32_t)0x00004000)
408 #define IS_FSMC_EXTENDED_MODE(MODE) (((MODE) == FSMC_ExtendedMode_Disable) || \
409 ((MODE) == FSMC_ExtendedMode_Enable))
418 #define FSMC_WriteBurst_Disable ((uint32_t)0x00000000)
419 #define FSMC_WriteBurst_Enable ((uint32_t)0x00080000)
420 #define IS_FSMC_WRITE_BURST(BURST) (((BURST) == FSMC_WriteBurst_Disable) || \
421 ((BURST) == FSMC_WriteBurst_Enable))
429 #define IS_FSMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 0xF)
437 #define IS_FSMC_ADDRESS_HOLD_TIME(TIME) ((TIME) <= 0xF)
445 #define IS_FSMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 0xFF))
453 #define IS_FSMC_TURNAROUND_TIME(TIME) ((TIME) <= 0xF)
461 #define IS_FSMC_CLK_DIV(DIV) ((DIV) <= 0xF)
469 #define IS_FSMC_DATA_LATENCY(LATENCY) ((LATENCY) <= 0xF)
477 #define FSMC_AccessMode_A ((uint32_t)0x00000000)
478 #define FSMC_AccessMode_B ((uint32_t)0x10000000)
479 #define FSMC_AccessMode_C ((uint32_t)0x20000000)
480 #define FSMC_AccessMode_D ((uint32_t)0x30000000)
481 #define IS_FSMC_ACCESS_MODE(MODE) (((MODE) == FSMC_AccessMode_A) || \
482 ((MODE) == FSMC_AccessMode_B) || \
483 ((MODE) == FSMC_AccessMode_C) || \
484 ((MODE) == FSMC_AccessMode_D))
500 #define FSMC_Waitfeature_Disable ((uint32_t)0x00000000)
501 #define FSMC_Waitfeature_Enable ((uint32_t)0x00000002)
502 #define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_Waitfeature_Disable) || \
503 ((FEATURE) == FSMC_Waitfeature_Enable))
512 #define FSMC_ECC_Disable ((uint32_t)0x00000000)
513 #define FSMC_ECC_Enable ((uint32_t)0x00000040)
514 #define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_ECC_Disable) || \
515 ((STATE) == FSMC_ECC_Enable))
523 #define FSMC_ECCPageSize_256Bytes ((uint32_t)0x00000000)
524 #define FSMC_ECCPageSize_512Bytes ((uint32_t)0x00020000)
525 #define FSMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000)
526 #define FSMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000)
527 #define FSMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000)
528 #define FSMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000)
529 #define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_ECCPageSize_256Bytes) || \
530 ((SIZE) == FSMC_ECCPageSize_512Bytes) || \
531 ((SIZE) == FSMC_ECCPageSize_1024Bytes) || \
532 ((SIZE) == FSMC_ECCPageSize_2048Bytes) || \
533 ((SIZE) == FSMC_ECCPageSize_4096Bytes) || \
534 ((SIZE) == FSMC_ECCPageSize_8192Bytes))
542 #define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 0xFF)
550 #define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 0xFF)
558 #define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 0xFF)
566 #define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 0xFF)
574 #define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 0xFF)
582 #define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 0xFF)
590 #define FSMC_IT_RisingEdge ((uint32_t)0x00000008)
591 #define FSMC_IT_Level ((uint32_t)0x00000010)
592 #define FSMC_IT_FallingEdge ((uint32_t)0x00000020)
593 #define IS_FSMC_IT(IT) ((((IT) & (uint32_t)0xFFFFFFC7) == 0x00000000) && ((IT) != 0x00000000))
594 #define IS_FSMC_GET_IT(IT) (((IT) == FSMC_IT_RisingEdge) || \
595 ((IT) == FSMC_IT_Level) || \
596 ((IT) == FSMC_IT_FallingEdge))
604 #define FSMC_FLAG_RisingEdge ((uint32_t)0x00000001)
605 #define FSMC_FLAG_Level ((uint32_t)0x00000002)
606 #define FSMC_FLAG_FallingEdge ((uint32_t)0x00000004)
607 #define FSMC_FLAG_FEMPT ((uint32_t)0x00000040)
608 #define IS_FSMC_GET_FLAG(FLAG) (((FLAG) == FSMC_FLAG_RisingEdge) || \
609 ((FLAG) == FSMC_FLAG_Level) || \
610 ((FLAG) == FSMC_FLAG_FallingEdge) || \
611 ((FLAG) == FSMC_FLAG_FEMPT))
613 #define IS_FSMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000))
630 void FSMC_NORSRAMDeInit(uint32_t FSMC_Bank);
633 void FSMC_NORSRAMCmd(uint32_t FSMC_Bank, FunctionalState NewState);
636 void FSMC_NANDDeInit(uint32_t FSMC_Bank);
639 void FSMC_NANDCmd(uint32_t FSMC_Bank, FunctionalState NewState);
640 void FSMC_NANDECCCmd(uint32_t FSMC_Bank, FunctionalState NewState);
641 uint32_t FSMC_GetECC(uint32_t FSMC_Bank);
644 void FSMC_PCCARDDeInit(
void);
647 void FSMC_PCCARDCmd(FunctionalState NewState);
650 void FSMC_ITConfig(uint32_t FSMC_Bank, uint32_t FSMC_IT, FunctionalState NewState);
651 FlagStatus FSMC_GetFlagStatus(uint32_t FSMC_Bank, uint32_t FSMC_FLAG);
652 void FSMC_ClearFlag(uint32_t FSMC_Bank, uint32_t FSMC_FLAG);
653 ITStatus FSMC_GetITStatus(uint32_t FSMC_Bank, uint32_t FSMC_IT);
654 void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT);
uint32_t FSMC_DataSetupTime
uint32_t FSMC_WriteOperation
uint32_t FSMC_DataAddressMux
uint32_t FSMC_WaitSignalActive
uint32_t FSMC_TARSetupTime
Timing parameters For NOR/SRAM Banks.
uint32_t FSMC_ECCPageSize
uint32_t FSMC_AsynchronousWait
FSMC NOR/SRAM Init structure definition.
CMSIS Cortex-M4 Device Peripheral Access Layer Header File. This file contains all the peripheral reg...
uint32_t FSMC_Waitfeature
FSMC_NORSRAMTimingInitTypeDef * FSMC_WriteTimingStruct
FSMC_NAND_PCCARDTimingInitTypeDef * FSMC_IOSpaceTimingStruct
FSMC NAND Init structure definition.
Timing parameters For FSMC NAND and PCCARD Banks.
uint32_t FSMC_TCLRSetupTime
uint32_t FSMC_TCLRSetupTime
FSMC_NAND_PCCARDTimingInitTypeDef * FSMC_AttributeSpaceTimingStruct
uint32_t FSMC_AddressHoldTime
FSMC_NAND_PCCARDTimingInitTypeDef * FSMC_AttributeSpaceTimingStruct
FSMC PCCARD Init structure definition.
uint32_t FSMC_TARSetupTime
uint32_t FSMC_WaitSignalPolarity
FSMC_NORSRAMTimingInitTypeDef * FSMC_ReadWriteTimingStruct
uint32_t FSMC_CLKDivision
FSMC_NAND_PCCARDTimingInitTypeDef * FSMC_CommonSpaceTimingStruct
uint32_t FSMC_DataLatency
uint32_t FSMC_HoldSetupTime
uint32_t FSMC_AddressSetupTime
uint32_t FSMC_BurstAccessMode
uint32_t FSMC_BusTurnAroundDuration
FSMC_NAND_PCCARDTimingInitTypeDef * FSMC_CommonSpaceTimingStruct
uint32_t FSMC_MemoryDataWidth
uint32_t FSMC_Waitfeature
uint32_t FSMC_ExtendedMode
uint32_t FSMC_WaitSetupTime
uint32_t FSMC_HiZSetupTime
uint32_t FSMC_MemoryDataWidth