使用FSMC来刷新LCD,在使用bank1.sector4已经能成功刷屏,想要修改为使用bank1.sector1,修改下面的地方却不能实现刷屏,麻烦帮忙看看是有那里没设置好。
typedef struct{
u16 CMD;
u16 DATA;
}LCDType;
#define AHDDR_BASE (u32)(0x60000000) //#define AHDDR_BASE (u32)(0x6C000000)
#define LCD ((LCDType *)(AHDDR_BASE | ((0x01 << 11) - 2)))
static void LCD_FSMCInit(void)
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStruct;
FSMC_NORSRAMTimingInitTypeDef FSMC_ReadWriteTimingStruct;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
FSMC_ReadWriteTimingStruct.FSMC_AddressHoldTime = 0x00;
FSMC_ReadWriteTimingStruct.FSMC_AddressSetupTime = 0x01;
FSMC_ReadWriteTimingStruct.FSMC_BusTurnAroundDuration = 0x00;
FSMC_ReadWriteTimingStruct.FSMC_CLKDivision = 0x00;
FSMC_ReadWriteTimingStruct.FSMC_DataLatency = 0x00;
FSMC_ReadWriteTimingStruct.FSMC_DataSetupTime = 0x01;
FSMC_ReadWriteTimingStruct.FSMC_AccessMode = FSMC_AccessMode_B;
FSMC_NORSRAMInitStruct.FSMC_Bank = FSMC_Bank1_NORSRAM1; //FSMC_NORSRAMInitStruct.FSMC_Bank = FSMC_Bank1_NORSRAM4;
FSMC_NORSRAMInitStruct.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStruct.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable;
FSMC_NORSRAMInitStruct.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStruct.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStruct.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStruct.FSMC_ReadWriteTimingStruct = &FSMC_ReadWriteTimingStruct;
FSMC_NORSRAMInitStruct.FSMC_WriteTimingStruct = &FSMC_ReadWriteTimingStruct;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStruct);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1,ENABLE); //FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4,ENABLE);
}
PS:注释部分是原来使用bank1.sector4可以实现刷屏的,红 {MOD}部分是打算使用bank1.sector1而做出的修改,但改修改不能刷屏成功。
麻烦各位大神指点一下是哪里没修改好从而导致使用bank1.sector1刷屏失败。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>