1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135 |
- #ifndef __STM32F4xx_FMC_H
- #define __STM32F4xx_FMC_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "stm32f4xx.h"
-
- typedef struct
- {
- uint32_t FMC_AddressSetupTime;
- uint32_t FMC_AddressHoldTime;
- uint32_t FMC_DataSetupTime;
- uint32_t FMC_BusTurnAroundDuration;
- uint32_t FMC_CLKDivision;
- uint32_t FMC_DataLatency;
- uint32_t FMC_AccessMode;
- }FMC_NORSRAMTimingInitTypeDef;
- typedef struct
- {
- uint32_t FMC_Bank;
- uint32_t FMC_DataAddressMux;
- uint32_t FMC_MemoryType;
- uint32_t FMC_MemoryDataWidth;
- uint32_t FMC_BurstAccessMode;
-
- uint32_t FMC_WaitSignalPolarity;
- uint32_t FMC_WrapMode;
- uint32_t FMC_WaitSignalActive;
- uint32_t FMC_WriteOperation;
- uint32_t FMC_WaitSignal;
- uint32_t FMC_ExtendedMode;
-
- uint32_t FMC_AsynchronousWait;
-
- uint32_t FMC_WriteBurst;
-
- uint32_t FMC_ContinousClock;
-
-
- FMC_NORSRAMTimingInitTypeDef* FMC_ReadWriteTimingStruct;
- FMC_NORSRAMTimingInitTypeDef* FMC_WriteTimingStruct;
- }FMC_NORSRAMInitTypeDef;
- typedef struct
- {
- uint32_t FMC_SetupTime;
- uint32_t FMC_WaitSetupTime;
- uint32_t FMC_HoldSetupTime;
- uint32_t FMC_HiZSetupTime;
- }FMC_NAND_PCCARDTimingInitTypeDef;
- typedef struct
- {
- uint32_t FMC_Bank;
- uint32_t FMC_Waitfeature;
- uint32_t FMC_MemoryDataWidth;
- uint32_t FMC_ECC;
- uint32_t FMC_ECCPageSize;
- uint32_t FMC_TCLRSetupTime;
- uint32_t FMC_TARSetupTime;
-
- FMC_NAND_PCCARDTimingInitTypeDef* FMC_CommonSpaceTimingStruct;
- FMC_NAND_PCCARDTimingInitTypeDef* FMC_AttributeSpaceTimingStruct;
- }FMC_NANDInitTypeDef;
- typedef struct
- {
- uint32_t FMC_Waitfeature;
- uint32_t FMC_TCLRSetupTime;
- uint32_t FMC_TARSetupTime;
-
-
- FMC_NAND_PCCARDTimingInitTypeDef* FMC_CommonSpaceTimingStruct;
- FMC_NAND_PCCARDTimingInitTypeDef* FMC_AttributeSpaceTimingStruct;
-
- FMC_NAND_PCCARDTimingInitTypeDef* FMC_IOSpaceTimingStruct;
- }FMC_PCCARDInitTypeDef;
-
- typedef struct
- {
- uint32_t FMC_LoadToActiveDelay;
-
- uint32_t FMC_ExitSelfRefreshDelay;
-
- uint32_t FMC_SelfRefreshTime;
-
- uint32_t FMC_RowCycleDelay;
-
- uint32_t FMC_WriteRecoveryTime;
-
- uint32_t FMC_RPDelay;
-
- uint32_t FMC_RCDDelay;
-
- }FMC_SDRAMTimingInitTypeDef;
- typedef struct
- {
- uint32_t FMC_CommandMode;
-
- uint32_t FMC_CommandTarget;
-
- uint32_t FMC_AutoRefreshNumber;
-
-
- uint32_t FMC_ModeRegisterDefinition;
-
- }FMC_SDRAMCommandTypeDef;
- typedef struct
- {
- uint32_t FMC_Bank;
- uint32_t FMC_ColumnBitsNumber;
-
- uint32_t FMC_RowBitsNumber;
-
- uint32_t FMC_SDMemoryDataWidth;
-
- uint32_t FMC_InternalBankNumber;
-
- uint32_t FMC_CASLatency;
-
- uint32_t FMC_WriteProtection;
-
- uint32_t FMC_SDClockPeriod;
-
- uint32_t FMC_ReadBurst;
-
- uint32_t FMC_ReadPipeDelay;
-
- FMC_SDRAMTimingInitTypeDef* FMC_SDRAMTimingStruct;
-
- }FMC_SDRAMInitTypeDef;
-
- #define FMC_Bank1_NORSRAM1 ((uint32_t)0x00000000)
- #define FMC_Bank1_NORSRAM2 ((uint32_t)0x00000002)
- #define FMC_Bank1_NORSRAM3 ((uint32_t)0x00000004)
- #define FMC_Bank1_NORSRAM4 ((uint32_t)0x00000006)
- #define IS_FMC_NORSRAM_BANK(BANK) (((BANK) == FMC_Bank1_NORSRAM1) || \
- ((BANK) == FMC_Bank1_NORSRAM2) || \
- ((BANK) == FMC_Bank1_NORSRAM3) || \
- ((BANK) == FMC_Bank1_NORSRAM4))
-
- #define FMC_Bank2_NAND ((uint32_t)0x00000010)
- #define FMC_Bank3_NAND ((uint32_t)0x00000100)
- #define IS_FMC_NAND_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
- ((BANK) == FMC_Bank3_NAND))
-
- #define FMC_Bank4_PCCARD ((uint32_t)0x00001000)
- #define FMC_Bank1_SDRAM ((uint32_t)0x00000000)
- #define FMC_Bank2_SDRAM ((uint32_t)0x00000001)
- #define IS_FMC_SDRAM_BANK(BANK) (((BANK) == FMC_Bank1_SDRAM) || \
- ((BANK) == FMC_Bank2_SDRAM))
-
-
- #define FMC_DataAddressMux_Disable ((uint32_t)0x00000000)
- #define FMC_DataAddressMux_Enable ((uint32_t)0x00000002)
- #define IS_FMC_MUX(MUX) (((MUX) == FMC_DataAddressMux_Disable) || \
- ((MUX) == FMC_DataAddressMux_Enable))
- #define FMC_MemoryType_SRAM ((uint32_t)0x00000000)
- #define FMC_MemoryType_PSRAM ((uint32_t)0x00000004)
- #define FMC_MemoryType_NOR ((uint32_t)0x00000008)
- #define IS_FMC_MEMORY(MEMORY) (((MEMORY) == FMC_MemoryType_SRAM) || \
- ((MEMORY) == FMC_MemoryType_PSRAM)|| \
- ((MEMORY) == FMC_MemoryType_NOR))
- #define FMC_NORSRAM_MemoryDataWidth_8b ((uint32_t)0x00000000)
- #define FMC_NORSRAM_MemoryDataWidth_16b ((uint32_t)0x00000010)
- #define FMC_NORSRAM_MemoryDataWidth_32b ((uint32_t)0x00000020)
- #define IS_FMC_NORSRAM_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NORSRAM_MemoryDataWidth_8b) || \
- ((WIDTH) == FMC_NORSRAM_MemoryDataWidth_16b) || \
- ((WIDTH) == FMC_NORSRAM_MemoryDataWidth_32b))
- #define FMC_BurstAccessMode_Disable ((uint32_t)0x00000000)
- #define FMC_BurstAccessMode_Enable ((uint32_t)0x00000100)
- #define IS_FMC_BURSTMODE(STATE) (((STATE) == FMC_BurstAccessMode_Disable) || \
- ((STATE) == FMC_BurstAccessMode_Enable))
-
- #define FMC_AsynchronousWait_Disable ((uint32_t)0x00000000)
- #define FMC_AsynchronousWait_Enable ((uint32_t)0x00008000)
- #define IS_FMC_ASYNWAIT(STATE) (((STATE) == FMC_AsynchronousWait_Disable) || \
- ((STATE) == FMC_AsynchronousWait_Enable))
- #define FMC_WaitSignalPolarity_Low ((uint32_t)0x00000000)
- #define FMC_WaitSignalPolarity_High ((uint32_t)0x00000200)
- #define IS_FMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FMC_WaitSignalPolarity_Low) || \
- ((POLARITY) == FMC_WaitSignalPolarity_High))
- #define FMC_WrapMode_Disable ((uint32_t)0x00000000)
- #define FMC_WrapMode_Enable ((uint32_t)0x00000400)
- #define IS_FMC_WRAP_MODE(MODE) (((MODE) == FMC_WrapMode_Disable) || \
- ((MODE) == FMC_WrapMode_Enable))
- #define FMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000)
- #define FMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800)
- #define IS_FMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FMC_WaitSignalActive_BeforeWaitState) || \
- ((ACTIVE) == FMC_WaitSignalActive_DuringWaitState))
- #define FMC_WriteOperation_Disable ((uint32_t)0x00000000)
- #define FMC_WriteOperation_Enable ((uint32_t)0x00001000)
- #define IS_FMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FMC_WriteOperation_Disable) || \
- ((OPERATION) == FMC_WriteOperation_Enable))
- #define FMC_WaitSignal_Disable ((uint32_t)0x00000000)
- #define FMC_WaitSignal_Enable ((uint32_t)0x00002000)
- #define IS_FMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FMC_WaitSignal_Disable) || \
- ((SIGNAL) == FMC_WaitSignal_Enable))
- #define FMC_ExtendedMode_Disable ((uint32_t)0x00000000)
- #define FMC_ExtendedMode_Enable ((uint32_t)0x00004000)
- #define IS_FMC_EXTENDED_MODE(MODE) (((MODE) == FMC_ExtendedMode_Disable) || \
- ((MODE) == FMC_ExtendedMode_Enable))
- #define FMC_WriteBurst_Disable ((uint32_t)0x00000000)
- #define FMC_WriteBurst_Enable ((uint32_t)0x00080000)
- #define IS_FMC_WRITE_BURST(BURST) (((BURST) == FMC_WriteBurst_Disable) || \
- ((BURST) == FMC_WriteBurst_Enable))
-
- #define FMC_CClock_SyncOnly ((uint32_t)0x00000000)
- #define FMC_CClock_SyncAsync ((uint32_t)0x00100000)
- #define IS_FMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FMC_CClock_SyncOnly) || \
- ((CCLOCK) == FMC_CClock_SyncAsync))
-
- #define IS_FMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 15)
- #define IS_FMC_ADDRESS_HOLD_TIME(TIME) (((TIME) > 0) && ((TIME) <= 15))
- #define IS_FMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 255))
- #define IS_FMC_TURNAROUND_TIME(TIME) ((TIME) <= 15)
- #define IS_FMC_CLK_DIV(DIV) (((DIV) > 0) && ((DIV) <= 15))
- #define IS_FMC_DATA_LATENCY(LATENCY) ((LATENCY) <= 15)
- #define FMC_AccessMode_A ((uint32_t)0x00000000)
- #define FMC_AccessMode_B ((uint32_t)0x10000000)
- #define FMC_AccessMode_C ((uint32_t)0x20000000)
- #define FMC_AccessMode_D ((uint32_t)0x30000000)
- #define IS_FMC_ACCESS_MODE(MODE) (((MODE) == FMC_AccessMode_A) || \
- ((MODE) == FMC_AccessMode_B) || \
- ((MODE) == FMC_AccessMode_C) || \
- ((MODE) == FMC_AccessMode_D))
-
- #define FMC_Waitfeature_Disable ((uint32_t)0x00000000)
- #define FMC_Waitfeature_Enable ((uint32_t)0x00000002)
- #define IS_FMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FMC_Waitfeature_Disable) || \
- ((FEATURE) == FMC_Waitfeature_Enable))
- #define FMC_NAND_MemoryDataWidth_8b ((uint32_t)0x00000000)
- #define FMC_NAND_MemoryDataWidth_16b ((uint32_t)0x00000010)
- #define IS_FMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NAND_MemoryDataWidth_8b) || \
- ((WIDTH) == FMC_NAND_MemoryDataWidth_16b))
- #define FMC_ECC_Disable ((uint32_t)0x00000000)
- #define FMC_ECC_Enable ((uint32_t)0x00000040)
- #define IS_FMC_ECC_STATE(STATE) (((STATE) == FMC_ECC_Disable) || \
- ((STATE) == FMC_ECC_Enable))
- #define FMC_ECCPageSize_256Bytes ((uint32_t)0x00000000)
- #define FMC_ECCPageSize_512Bytes ((uint32_t)0x00020000)
- #define FMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000)
- #define FMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000)
- #define FMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000)
- #define FMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000)
- #define IS_FMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FMC_ECCPageSize_256Bytes) || \
- ((SIZE) == FMC_ECCPageSize_512Bytes) || \
- ((SIZE) == FMC_ECCPageSize_1024Bytes) || \
- ((SIZE) == FMC_ECCPageSize_2048Bytes) || \
- ((SIZE) == FMC_ECCPageSize_4096Bytes) || \
- ((SIZE) == FMC_ECCPageSize_8192Bytes))
- #define IS_FMC_TCLR_TIME(TIME) ((TIME) <= 255)
- #define IS_FMC_TAR_TIME(TIME) ((TIME) <= 255)
- #define IS_FMC_SETUP_TIME(TIME) ((TIME) <= 255)
- #define IS_FMC_WAIT_TIME(TIME) ((TIME) <= 255)
- #define IS_FMC_HOLD_TIME(TIME) ((TIME) <= 255)
- #define IS_FMC_HIZ_TIME(TIME) ((TIME) <= 255)
-
-
- #define FMC_ColumnBits_Number_8b ((uint32_t)0x00000000)
- #define FMC_ColumnBits_Number_9b ((uint32_t)0x00000001)
- #define FMC_ColumnBits_Number_10b ((uint32_t)0x00000002)
- #define FMC_ColumnBits_Number_11b ((uint32_t)0x00000003)
- #define IS_FMC_COLUMNBITS_NUMBER(COLUMN) (((COLUMN) == FMC_ColumnBits_Number_8b) || \
- ((COLUMN) == FMC_ColumnBits_Number_9b) || \
- ((COLUMN) == FMC_ColumnBits_Number_10b) || \
- ((COLUMN) == FMC_ColumnBits_Number_11b))
-
- #define FMC_RowBits_Number_11b ((uint32_t)0x00000000)
- #define FMC_RowBits_Number_12b ((uint32_t)0x00000004)
- #define FMC_RowBits_Number_13b ((uint32_t)0x00000008)
- #define IS_FMC_ROWBITS_NUMBER(ROW) (((ROW) == FMC_RowBits_Number_11b) || \
- ((ROW) == FMC_RowBits_Number_12b) || \
- ((ROW) == FMC_RowBits_Number_13b))
-
- #define FMC_SDMemory_Width_8b ((uint32_t)0x00000000)
- #define FMC_SDMemory_Width_16b ((uint32_t)0x00000010)
- #define FMC_SDMemory_Width_32b ((uint32_t)0x00000020)
- #define IS_FMC_SDMEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_SDMemory_Width_8b) || \
- ((WIDTH) == FMC_SDMemory_Width_16b) || \
- ((WIDTH) == FMC_SDMemory_Width_32b))
-
- #define FMC_InternalBank_Number_2 ((uint32_t)0x00000000)
- #define FMC_InternalBank_Number_4 ((uint32_t)0x00000040)
- #define IS_FMC_INTERNALBANK_NUMBER(NUMBER) (((NUMBER) == FMC_InternalBank_Number_2) || \
- ((NUMBER) == FMC_InternalBank_Number_4))
-
-
-
- #define FMC_CAS_Latency_1 ((uint32_t)0x00000080)
- #define FMC_CAS_Latency_2 ((uint32_t)0x00000100)
- #define FMC_CAS_Latency_3 ((uint32_t)0x00000180)
- #define IS_FMC_CAS_LATENCY(LATENCY) (((LATENCY) == FMC_CAS_Latency_1) || \
- ((LATENCY) == FMC_CAS_Latency_2) || \
- ((LATENCY) == FMC_CAS_Latency_3))
-
- #define FMC_Write_Protection_Disable ((uint32_t)0x00000000)
- #define FMC_Write_Protection_Enable ((uint32_t)0x00000200)
- #define IS_FMC_WRITE_PROTECTION(WRITE) (((WRITE) == FMC_Write_Protection_Disable) || \
- ((WRITE) == FMC_Write_Protection_Enable))
-
-
- #define FMC_SDClock_Disable ((uint32_t)0x00000000)
- #define FMC_SDClock_Period_2 ((uint32_t)0x00000800)
- #define FMC_SDClock_Period_3 ((uint32_t)0x00000C00)
- #define IS_FMC_SDCLOCK_PERIOD(PERIOD) (((PERIOD) == FMC_SDClock_Disable) || \
- ((PERIOD) == FMC_SDClock_Period_2) || \
- ((PERIOD) == FMC_SDClock_Period_3))
-
-
- #define FMC_Read_Burst_Disable ((uint32_t)0x00000000)
- #define FMC_Read_Burst_Enable ((uint32_t)0x00001000)
- #define IS_FMC_READ_BURST(RBURST) (((RBURST) == FMC_Read_Burst_Disable) || \
- ((RBURST) == FMC_Read_Burst_Enable))
- #define FMC_ReadPipe_Delay_0 ((uint32_t)0x00000000)
- #define FMC_ReadPipe_Delay_1 ((uint32_t)0x00002000)
- #define FMC_ReadPipe_Delay_2 ((uint32_t)0x00004000)
- #define IS_FMC_READPIPE_DELAY(DELAY) (((DELAY) == FMC_ReadPipe_Delay_0) || \
- ((DELAY) == FMC_ReadPipe_Delay_1) || \
- ((DELAY) == FMC_ReadPipe_Delay_2))
-
- #define IS_FMC_LOADTOACTIVE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
-
- #define IS_FMC_EXITSELFREFRESH_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
-
-
-
- #define IS_FMC_SELFREFRESH_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16))
-
-
- #define IS_FMC_ROWCYCLE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
-
-
-
- #define IS_FMC_WRITE_RECOVERY_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16))
-
-
-
- #define IS_FMC_RP_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
-
-
-
- #define IS_FMC_RCD_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16))
-
-
- #define FMC_Command_Mode_normal ((uint32_t)0x00000000)
- #define FMC_Command_Mode_CLK_Enabled ((uint32_t)0x00000001)
- #define FMC_Command_Mode_PALL ((uint32_t)0x00000002)
- #define FMC_Command_Mode_AutoRefresh ((uint32_t)0x00000003)
- #define FMC_Command_Mode_LoadMode ((uint32_t)0x00000004)
- #define FMC_Command_Mode_Selfrefresh ((uint32_t)0x00000005)
- #define FMC_Command_Mode_PowerDown ((uint32_t)0x00000006)
- #define IS_FMC_COMMAND_MODE(COMMAND) (((COMMAND) == FMC_Command_Mode_normal) || \
- ((COMMAND) == FMC_Command_Mode_CLK_Enabled) || \
- ((COMMAND) == FMC_Command_Mode_PALL) || \
- ((COMMAND) == FMC_Command_Mode_AutoRefresh) || \
- ((COMMAND) == FMC_Command_Mode_LoadMode) || \
- ((COMMAND) == FMC_Command_Mode_Selfrefresh) || \
- ((COMMAND) == FMC_Command_Mode_PowerDown))
- #define FMC_Command_Target_bank2 ((uint32_t)0x00000008)
- #define FMC_Command_Target_bank1 ((uint32_t)0x00000010)
- #define FMC_Command_Target_bank1_2 ((uint32_t)0x00000018)
- #define IS_FMC_COMMAND_TARGET(TARGET) (((TARGET) == FMC_Command_Target_bank1) || \
- ((TARGET) == FMC_Command_Target_bank2) || \
- ((TARGET) == FMC_Command_Target_bank1_2))
-
-
-
- #define IS_FMC_AUTOREFRESH_NUMBER(NUMBER) (((NUMBER) > 0) && ((NUMBER) <= 16))
- #define IS_FMC_MODE_REGISTER(CONTENT) ((CONTENT) <= 8191)
-
- #define FMC_NormalMode_Status ((uint32_t)0x00000000)
- #define FMC_SelfRefreshMode_Status FMC_SDSR_MODES1_0
- #define FMC_PowerDownMode_Status FMC_SDSR_MODES1_1
- #define IS_FMC_MODE_STATUS(STATUS) (((STATUS) == FMC_NormalMode_Status) || \
- ((STATUS) == FMC_SelfRefreshMode_Status) || \
- ((STATUS) == FMC_PowerDownMode_Status))
-
-
- #define FMC_IT_RisingEdge ((uint32_t)0x00000008)
- #define FMC_IT_Level ((uint32_t)0x00000010)
- #define FMC_IT_FallingEdge ((uint32_t)0x00000020)
- #define FMC_IT_Refresh ((uint32_t)0x00004000)
- #define IS_FMC_IT(IT) ((((IT) & (uint32_t)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000))
- #define IS_FMC_GET_IT(IT) (((IT) == FMC_IT_RisingEdge) || \
- ((IT) == FMC_IT_Level) || \
- ((IT) == FMC_IT_FallingEdge) || \
- ((IT) == FMC_IT_Refresh))
-
- #define IS_FMC_IT_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
- ((BANK) == FMC_Bank3_NAND) || \
- ((BANK) == FMC_Bank4_PCCARD) || \
- ((BANK) == FMC_Bank1_SDRAM) || \
- ((BANK) == FMC_Bank2_SDRAM))
- #define FMC_FLAG_RisingEdge ((uint32_t)0x00000001)
- #define FMC_FLAG_Level ((uint32_t)0x00000002)
- #define FMC_FLAG_FallingEdge ((uint32_t)0x00000004)
- #define FMC_FLAG_FEMPT ((uint32_t)0x00000040)
- #define FMC_FLAG_Refresh FMC_SDSR_RE
- #define FMC_FLAG_Busy FMC_SDSR_BUSY
- #define IS_FMC_GET_FLAG(FLAG) (((FLAG) == FMC_FLAG_RisingEdge) || \
- ((FLAG) == FMC_FLAG_Level) || \
- ((FLAG) == FMC_FLAG_FallingEdge) || \
- ((FLAG) == FMC_FLAG_FEMPT) || \
- ((FLAG) == FMC_FLAG_Refresh) || \
- ((FLAG) == FMC_SDSR_BUSY))
- #define IS_FMC_GETFLAG_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \
- ((BANK) == FMC_Bank3_NAND) || \
- ((BANK) == FMC_Bank4_PCCARD) || \
- ((BANK) == FMC_Bank1_SDRAM) || \
- ((BANK) == FMC_Bank2_SDRAM) || \
- ((BANK) == (FMC_Bank1_SDRAM | FMC_Bank2_SDRAM)))
-
- #define IS_FMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000))
- #define IS_FMC_REFRESH_COUNT(COUNT) ((COUNT) <= 8191)
-
- void FMC_NORSRAMDeInit(uint32_t FMC_Bank);
- void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct);
- void FMC_NORSRAMStructInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct);
- void FMC_NORSRAMCmd(uint32_t FMC_Bank, FunctionalState NewState);
- void FMC_NANDDeInit(uint32_t FMC_Bank);
- void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct);
- void FMC_NANDStructInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct);
- void FMC_NANDCmd(uint32_t FMC_Bank, FunctionalState NewState);
- void FMC_NANDECCCmd(uint32_t FMC_Bank, FunctionalState NewState);
- uint32_t FMC_GetECC(uint32_t FMC_Bank);
- void FMC_PCCARDDeInit(void);
- void FMC_PCCARDInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct);
- void FMC_PCCARDStructInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct);
- void FMC_PCCARDCmd(FunctionalState NewState);
- void FMC_SDRAMDeInit(uint32_t FMC_Bank);
- void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct);
- void FMC_SDRAMStructInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct);
- void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct);
- uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank);
- void FMC_SetRefreshCount(uint32_t FMC_Count);
- void FMC_SetAutoRefresh_Number(uint32_t FMC_Number);
- void FMC_SDRAMWriteProtectionConfig(uint32_t SDRAM_Bank, FunctionalState NewState);
- void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState);
- FlagStatus FMC_GetFlagStatus(uint32_t FMC_Bank, uint32_t FMC_FLAG);
- void FMC_ClearFlag(uint32_t FMC_Bank, uint32_t FMC_FLAG);
- ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT);
- void FMC_ClearITPendingBit(uint32_t FMC_Bank, uint32_t FMC_IT);
- #ifdef __cplusplus
- }
- #endif
- #endif
-
|