p.FSMC_DataLatency = 1;
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_NORSRAM4; FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
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; /* BANK 4 (of NOR/SRAM Bank 1~4 is enabled */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE; #endif }
/******************************************************************** ***********
* Function Name : STM3210E_LCD_Init * Description : Initializes the LCD. * Input : None * Output : None * Return : None
********************************************************************* **********/
void STM3210E_LCD_Init(void {
#ifndef NO_LCD
/* Configure the LCD Control pins --------------------------------------------*/ LCD_IOConfig(;
/* Configure the FSMC Parallel interface -------------------------------------*/ LCD_FSMCConfig(;
LCD_Command = Display_Off; //
delay(;
LCD_Command = LCD_Reset; // reset_delay(;
LCD_Command = Set_LCD_Bias_9; delay(;
LCD_Command = Set_ADC_Normal; delay(;
LCD_Command = COM_Scan_Dir_Reverse; delay(;
LCD_Command = Set_Start_Line_X|0x0; delay(;
LCD_Command = 0x2c; power_delay(; // 50ms requried LCD_Command = 0x2e; power_delay(; // 50ms LCD_Command = 0x2f; power_delay(; // 50ms
LCD_Command = Set_Ref_Vol_Reg|0x05; delay(;
相关推荐: