关于stm32 fsmc 模式1和模式D的疑问

2019-07-14 20:03发布

各位好:
在做项目时,网上找了一段FSMC的初始化代码,放在工程当中可以使用,但我百思不解这段代码初始化之后STM32的FSMC最终是什么模式:
代码如下:
p.FSMC_AddressSetuptime = 1;       
        p.FSMC_AddressHoldTime =  1;       
        p.FSMC_DataSetupTime = 5;//8;       
        p.FSMC_BusTurnAroundDuration = 1;//0;                //CPUÖÐmin=1HCLK(14ns)£»VPC3ÐèÒª10ns       
        p.FSMC_CLKDivision = 0;
        p.FSMC_DataLatency = 0;
        p.FSMC_AccessMode = FSMC_AccessMode_D;                //ÔÚÀ©Õ¹Ä£Ê½Ï²ÅÓÐЧ
                                                                                       
        FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
        FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Enable;
        FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR;//FSMC_MemoryType_SRAM;//FSMC_MemoryType_CRAM;
        FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b;
       
        FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
        FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
        FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
        FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
        FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
        FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
        FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
        FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
        FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
        FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
       
        FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
       
        //Enable FSMC Bank1_SRAM Bank
        FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);

我的理解是:p.FSMC_AccessMode = FSMC_AccessMode_D;                //ÔÚÀ©Õ¹Ä£Ê½Ï²ÅÓÐЧ按道理应该说为D模式但后面的程序段里有        FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; ,所以最终FSMC的模式应该为模式1,不知道我的理解对不对,困扰我很久,请指导!
0条回答

一周热门 更多>