本文整理汇总了C++中FSMC_NORSRAMInit函数的典型用法代码示例。如果您正苦于以下问题:C++ FSMC_NORSRAMInit函数的具体用法?C++ FSMC_NORSRAMInit怎么用?C++ FSMC_NORSRAMInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FSMC_NORSRAMInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lcd_fsmc_nor_mux_config
static void lcd_fsmc_nor_mux_config(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef Timing_read,Timing_write;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &Timing_read;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &Timing_write;
FSMC_NORSRAMStructInit(&FSMC_NORSRAMInitStructure);
#if 0
/* ssd1289 */
Timing_read.FSMC_AddressSetupTime = 8; /* 地址建立时间 */
Timing_read.FSMC_AddressHoldTime = 8; /* 地址保持时间 */
Timing_read.FSMC_DataSetupTime = 8; /* 数据建立时间 */
Timing_read.FSMC_AccessMode = FSMC_AccessMode_A; /* FSMC 访问模式 */
Timing_write.FSMC_AddressSetupTime = 8; /* 地址建立时间 */
Timing_write.FSMC_AddressHoldTime = 8; /* 地址保持时间 */
Timing_write.FSMC_DataSetupTime = 8; /* 数据建立时间 */
Timing_write.FSMC_AccessMode = FSMC_AccessMode_A; /* FSMC 访问模式 */
#else
/* ili9320 */
Timing_read.FSMC_AddressSetupTime = 3; /* 地址建立时间 */
Timing_read.FSMC_AddressHoldTime = 8; /* 地址保持时间 */
Timing_read.FSMC_DataSetupTime = 4; /* 数据建立时间 */
Timing_read.FSMC_AccessMode = FSMC_AccessMode_A; /* FSMC 访问模式 */
Timing_write.FSMC_AddressSetupTime = 2; /* 地址建立时间 */
Timing_write.FSMC_AddressHoldTime = 8; /* 地址保持时间 */
Timing_write.FSMC_DataSetupTime = 3; /* 数据建立时间 */
Timing_write.FSMC_AccessMode = FSMC_AccessMode_A; /* FSMC 访问模式 */
#endif
/* Color LCD configuration ------------------------------------
LCD configured as follow:
- Data/Address MUX = Disable
- Memory Type = SRAM
- Data Width = 16bit
- Write Operation = Enable
- Extended Mode = Enable
- Asynchronous Wait = Disable */
/* Bank1 4*64MiB 0x60000000 -- 0x6fffffff
* ne1 -- 0x60000000 -- 0x63ffffff
*/
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Enable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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_Enable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例2: LCD_FSMCConf
void LCD_FSMCConf(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
p.FSMC_AddressSetupTime = 5;
p.FSMC_AddressHoldTime = 0;
p.FSMC_DataSetupTime = 9;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_A;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例3: LCD_FSMC_Config
void LCD_FSMC_Config(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
p.FSMC_AddressSetupTime = 0x04; //地址建立时间
p.FSMC_AddressHoldTime = 0x04; //地址保持时间
p.FSMC_DataSetupTime = 0x04; //数据建立时间
p.FSMC_BusTurnAroundDuration = 0x00;
p.FSMC_CLKDivision = 0x00;
p.FSMC_DataLatency = 0x00;
p.FSMC_AccessMode = FSMC_AccessMode_B; // 一般使用模式B来控制LCD
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
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);
}
示例4: FSMC_LCD_Init
void FSMC_LCD_Init(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure ;
FSMC_NORSRAMTimingInitTypeDef p ;
/* Configure FSMC Bank1 NOR/PSRAM */
p.FSMC_AddressSetupTime = 0x02 ;
p.FSMC_AddressHoldTime = 0x00 ;
p.FSMC_DataSetupTime = 0x05 ;
p.FSMC_BusTurnAroundDuration = 0x00 ;
p.FSMC_CLKDivision = 0x00 ;
p.FSMC_DataLatency = 0x00 ;
p.FSMC_AccessMode = FSMC_AccessMode_B ;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1 ;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable ;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR ;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b ;
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) ;
}
示例5: lcd_fsmc_initialize
static void lcd_fsmc_initialize(void){
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructure;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM4;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
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_AsynchronousWait = FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
//FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
/* FSMC Write Timing */
FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime = 15; /* Address Setup Time */
FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime = 0;
FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime = 15; /* Data Setup Time */
FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0x00;
FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision = 0x00;
FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency = 0x00;
FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode = FSMC_AccessMode_A; /* FSMC Access Mode */
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
/* Enable FSMC Bank4_SRAM Bank */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE);
}
示例6: SRAM_FSMC_Config
void SRAM_FSMC_Config(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
p.FSMC_AddressSetupTime = 1; //这里我尝试改成5 6 也不对。
p.FSMC_AddressHoldTime = 1;
p.FSMC_DataSetupTime = 0;
p.FSMC_BusTurnAroundDuration = 0; //这里我尝试不用扩展模式也不行
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_A;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM3;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM3, ENABLE); // 使能BANK3
}
示例7: FSMC_Configuration
/*** FSMC配置函数 ***/
static void FSMC_Configuration(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructure;
/*** FSMC Configuration:FSMC_Bank1_NORSRAM1 Configuration ***/
FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime = 0x02; //地址建立时间(1 ~ 16个HCLK)
FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime = 0x00; //地址保存时间(1 ~ 16个HCLK)
FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime = 0x05; //数据建立时间(0:保留,1:2个HCLK,0xFF:256个HCLK)
FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0x00; //总线恢复时间(1 ~ 16个HCLK)
FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision = 0x00; //时钟分频比(定义CLK时钟输出信号的周期,0:保留,1-15表示1个CLK相当于2-16个HCLK)
FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency = 0x00; //数据保持时间(2 - 17个周期)
FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode = FSMC_AccessMode_B; //模式B(一共有4种模式:A,B,C,D)
/*** Color LCD configuration ***/
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; //Bank1_NORSRAM1
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; //地址和数据复用失能
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR; //连接到相应存储块的外部存储器类型
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b; //存储器数据总线宽度16bit
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable; //使能或关闭同步NOR闪存存储器的突发访问模式设置是否使用迸发访问模式
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; //设置WAIT信号的有效电平
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable; //设置是否使用环回模式
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState; //设置WAIT信号有效时机
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable; //设定是否使能写操作
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; //设定是否使用WAIT信号
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; //使能或关闭扩展模式,扩展模式用于访问具有不同读写操作时序的存储器,设定是否使用单独的写时序
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; //设定是否使用迸发写模式
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &FSMC_NORSRAMTimingInitStructure; //设定读写时序
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &FSMC_NORSRAMTimingInitStructure; //设定读写时序
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
/*** Enable FSMC Bank1_SRAM Bank ****/
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例8: Dm9000a_FSMCConfig
void Dm9000a_FSMCConfig()
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
// DM9000A使用的地址(BANK1,BANK1有4个片选,DM9000A使用第4条片选)
// 时序设置
p.FSMC_AddressSetupTime = 1;
p.FSMC_AddressHoldTime = 1;
p.FSMC_DataSetupTime = 2;
p.FSMC_BusTurnAroundDuration = 1;
p.FSMC_CLKDivision = 1;
p.FSMC_DataLatency = 1;
p.FSMC_AccessMode = FSMC_AccessMode_A;
// 工作模式
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM4;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_PSRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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);
// 使能DM9000A的FSMC访问
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE);
}
示例9: RCC_AHB3PeriphClockCmd
void ILI9341::fsmcSetup()
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructureRead;
FSMC_NORSRAMTimingInitTypeDef FSMC_NORSRAMTimingInitStructureWrite;
/* Enable FSMC Clock */
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
/* Define Read timing parameters */
FSMC_NORSRAMTimingInitStructureRead.FSMC_AddressSetupTime = 1;
FSMC_NORSRAMTimingInitStructureRead.FSMC_AddressHoldTime = 0;
FSMC_NORSRAMTimingInitStructureRead.FSMC_DataSetupTime = 15;
FSMC_NORSRAMTimingInitStructureRead.FSMC_BusTurnAroundDuration = 0;
FSMC_NORSRAMTimingInitStructureRead.FSMC_CLKDivision = 1;
FSMC_NORSRAMTimingInitStructureRead.FSMC_DataLatency = 0;
FSMC_NORSRAMTimingInitStructureRead.FSMC_AccessMode = FSMC_AccessMode_A;
/* Define Write Timing parameters */
FSMC_NORSRAMTimingInitStructureWrite.FSMC_AddressSetupTime = 2; // 2
FSMC_NORSRAMTimingInitStructureWrite.FSMC_AddressHoldTime = 0; // 0
FSMC_NORSRAMTimingInitStructureWrite.FSMC_DataSetupTime = 5; // 5
FSMC_NORSRAMTimingInitStructureWrite.FSMC_BusTurnAroundDuration = 0;
FSMC_NORSRAMTimingInitStructureWrite.FSMC_CLKDivision = 1;
FSMC_NORSRAMTimingInitStructureWrite.FSMC_DataLatency = 0;
FSMC_NORSRAMTimingInitStructureWrite.FSMC_AccessMode = FSMC_AccessMode_A;
/* Define protocol type */
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; //Bank1
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; //No mux
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM; //SRAM type
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b; //16 bits wide
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode =
FSMC_BurstAccessMode_Disable; //No Burst
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait =
FSMC_AsynchronousWait_Disable; // No wait
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity =
FSMC_WaitSignalPolarity_Low; //Don'tcare
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable; //No wrap mode
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive =
FSMC_WaitSignalActive_BeforeWaitState; //Don't care
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable; //Don't care
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable; //Allow distinct Read/Write parameters
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable; //Don't care
// Set read timing structure
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct =
&FSMC_NORSRAMTimingInitStructureRead;
// Set write timing structure
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct =
&FSMC_NORSRAMTimingInitStructureWrite;
// Initialize FSMC for read and write
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
// Enable FSMC
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例10: LCD_init_hardware
void LCD_init_hardware() {
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE); /* Enable the FSMC Clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC |
RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE , ENABLE);
/* Enable the FSMC pins for LCD control */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5 |
GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_14 |
GPIO_Pin_15 | GPIO_Pin_7 /*NE1*/ | GPIO_Pin_11/*RS*/;
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |
GPIO_Pin_15;
GPIO_Init(GPIOE, &GPIO_InitStructure);
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
p.FSMC_AddressSetupTime = 0x02;
p.FSMC_AddressHoldTime = 0x00;
p.FSMC_DataSetupTime = 0x05;
p.FSMC_BusTurnAroundDuration = 0x00;
p.FSMC_CLKDivision = 0x00;
p.FSMC_DataLatency = 0x00;
p.FSMC_AccessMode = FSMC_AccessMode_B;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
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);
// Toggle LCD reset pin
#ifdef LCD_RESET
jshPinSetState(LCD_RESET, JSHPINSTATE_GPIO_OUT);
jshPinSetValue(LCD_RESET, 0); //RESET=0
LCD_DELAY(DELAY_LONG);
jshPinSetValue(LCD_RESET, 1); //RESET=1
#endif
}
示例11: LCD_FSMCConfig
static void LCD_FSMCConfig(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef Timing_read,Timing_write;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &Timing_read;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &Timing_write;
FSMC_NORSRAMStructInit(&FSMC_NORSRAMInitStructure);
/*--------------------- read timings configuration ---------------------*/
Timing_read.FSMC_AddressSetupTime = 3; /* [3:0] F2/F4 1~15 HCLK */
Timing_read.FSMC_AddressHoldTime = 0; /* [7:4] keep 0x00 in SRAM mode */
Timing_read.FSMC_DataSetupTime = 4; /* [15:8] F2/F4 0~255 HCLK */
/* [19:16] Time between NEx high to NEx low (BUSTURN HCLK) */
Timing_read.FSMC_BusTurnAroundDuration = 1;
Timing_read.FSMC_CLKDivision = 0; /* [24:20] keep 0x00 in SRAM mode */
Timing_read.FSMC_DataLatency = 0; /* [27:25] keep 0x00 in SRAM mode */
Timing_read.FSMC_AccessMode = FSMC_AccessMode_A;
/*--------------------- write timings configuration ---------------------*/
Timing_write.FSMC_AddressSetupTime = 2; /* [3:0] F2/F4 1~15 HCLK */
Timing_write.FSMC_AddressHoldTime = 0; /* [7:4] keep 0x00 in SRAM mode */
Timing_write.FSMC_DataSetupTime = 3; /* [15:8] F2/F4 0~255 HCLK */
/* [19:16] Time between NEx high to NEx low (BUSTURN HCLK) */
Timing_write.FSMC_BusTurnAroundDuration = 1;
Timing_write.FSMC_CLKDivision = 0; /* [24:20] keep 0x00 in SRAM mode */
Timing_write.FSMC_DataLatency = 0; /* [27:25] keep 0x00 in SRAM mode */
Timing_write.FSMC_AccessMode = FSMC_AccessMode_A;
/* Color LCD configuration ------------------------------------
LCD configured as follow:
- Data/Address MUX = Disable
- Memory Type = SRAM
- Data Width = 16bit
- Write Operation = Enable
- Extended Mode = Enable
- Asynchronous Wait = Disable */
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM4;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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_Enable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE);
}
示例12: AD7606_FSMCConfig
/*
*********************************************************************************************************
* 函 数 名: AD7606_FSMCConfig
* 功能说明: 配置FSMC并口访问时序
* 形 参: 无
* 返 回 值: 无
*********************************************************************************************************
*/
static void AD7606_FSMCConfig(void)
{
FSMC_NORSRAMInitTypeDef init;
FSMC_NORSRAMTimingInitTypeDef timing;
/*
AD7606规格书要求(3.3V时):RD读信号低电平脉冲宽度最短21ns,高电平脉冲最短宽度15ns。
按照如下配置 读数均正常。为了和同BANK的LCD配置相同,选择3-0-6-1-0-0
3-0-5-1-0-0 : RD高持续75ns, 低电平持续50ns. 1us以内可读取8路样本数据到内存。
1-0-1-1-0-0 : RD高75ns,低电平执行12ns左右,下降沿差不多也12ns. 数据读取正确。
*/
/* FSMC_Bank1_NORSRAM4 configuration */
timing.FSMC_AddressSetupTime = 3;
timing.FSMC_AddressHoldTime = 0;
timing.FSMC_DataSetupTime = 6;
timing.FSMC_BusTurnAroundDuration = 1;
timing.FSMC_CLKDivision = 0;
timing.FSMC_DataLatency = 0;
timing.FSMC_AccessMode = FSMC_AccessMode_A;
/*
LCD configured as follow:
- Data/Address MUX = Disable
- Memory Type = SRAM
- Data Width = 16bit
- Write Operation = Enable
- Extended Mode = Enable
- Asynchronous Wait = Disable
*/
init.FSMC_Bank = FSMC_Bank1_NORSRAM4;
init.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
init.FSMC_MemoryType = FSMC_MemoryType_SRAM;
init.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
init.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
init.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
init.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
init.FSMC_WrapMode = FSMC_WrapMode_Disable;
init.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
init.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
init.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
init.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
init.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
init.FSMC_ReadWriteTimingStruct = &timing;
init.FSMC_WriteTimingStruct = &timing;
FSMC_NORSRAMInit(&init);
/* - BANK 1 (of NOR/SRAM Bank 1~4) is enabled */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE);
}
示例13: fsmc_for_sram_configration
static void fsmc_for_sram_configration(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef timing;
FSMC_NORSRAMDeInit(FSMC_Bank1_NORSRAM1);
/*
* ---- 初期调试用参数
* p.FSMC_AddressSetupTime = 15;
* p.FSMC_AddressHoldTime = 15;
* p.FSMC_DataSetupTime = 15;
* p.FSMC_BusTurnAroundDuration = 15;
* p.FSMC_CLKDivision = 8;
* p.FSMC_DataLatency = 15;
*/
timing.FSMC_AddressSetupTime = 0x01; /* It is not used with synchronous NOR Flash memories. */
timing.FSMC_AddressHoldTime = 0x01; /* It is not used with synchronous NOR Flash memories.*/
timing.FSMC_DataSetupTime = 0x01; /* It is used for SRAMs, ROMs and asynchronous multiplexed NOR Flash memories. */
timing.FSMC_BusTurnAroundDuration = 0x00; /* It is only used for multiplexed NOR Flash memories. */
timing.FSMC_CLKDivision = 0x00; /* It is not used for asynchronous NOR Flash, SRAM or ROM accesses. */
timing.FSMC_DataLatency = 0x00; /* It must be set to 0 in case of a CRAM */
timing.FSMC_AccessMode = FSMC_AccessMode_B;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
#if RT_EXT_SRAM_MULTIPLEXED
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Enable;
#else
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
#endif
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_PSRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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 = &timing;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &timing;
/* FSMC_NORSRAMStructInit(&FSMC_NORSRAMInitStructure); */
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
/* Enable FSMC Bank1_SRAM Bank */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例14: UiLcdHy28_FSMCConfig
//*----------------------------------------------------------------------------
//* Function Name : UiLcdHy28_FSMCConfig
//* Object :
//* Input Parameters :
//* Output Parameters :
//* Functions called :
//*----------------------------------------------------------------------------
void UiLcdHy28_FSMCConfig(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
// Enable FSMC clock
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
//-- FSMC Configuration ------------------------------------------------------
//----------------------- SRAM Bank 3 ----------------------------------------
// FSMC_Bank1_NORSRAM4 configuration
p.FSMC_AddressSetupTime = 3;
p.FSMC_AddressHoldTime = 0;
p.FSMC_DataSetupTime = 9;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_A;
// Color LCD configuration ------------------------------------
// LCD configured as follow:
// - Data/Address MUX = Disable
// - Memory Type = SRAM
// - Data Width = 16bit
// - Write Operation = Enable
// - Extended Mode = Enable
// - Asynchronous Wait = Disable
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}
示例15: FSMC_Configuration
/**
* @brief Configures the Parallel interface (FSMC) for LCD(Parallel mode)
* @param None
* @retval None
*/
static void FSMC_Configuration(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;
/* Enable FSMC clock */
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
/* FSMC_Bank1_NORSRAM1 configuration */
p.FSMC_AddressSetupTime = 3;
p.FSMC_AddressHoldTime = 0;
p.FSMC_DataSetupTime = 4;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_B;
/* Color LCD configuration ------------------------------------
LCD configured as follow:
- Data/Address MUX = Disable
- Memory Type = SRAM
- Data Width = 16bit
- Write Operation = Enable
- Extended Mode = Enable
- Asynchronous Wait = Disable */
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_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 NOR/SRAM Bank1 */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
}