示例#1
0
文件: drv_lcd.c 项目: biglai/STM32F0
void LCD_Initial(void)
{
 LCD_InitPort();  
 Delay_us(45000);
 //LCD_PSB(1);   //并口方式
 LCD_RST(1);
 Delay_us(100);
 LCD_RST(0);   //液晶复位	低电平有效
 Delay_us(60000);                  
 LCD_RST(1);  	//置高电平等待复位
// Delay_us(10000);   
   
 Delay_us(60000);
 WriteCommandLCD(0x30); //显示模式设置,开始要求每次检测忙信号
 Delay_us(1000);
 WriteCommandLCD(0x30); //显示模式设置,开始要求每次检测忙信号
 Delay_us(1000);
// WriteCommandLCD(0x02); //显示清屏
 WriteCommandLCD(0x01); // 显示开及光标设置
 Delay_us(15000);
 WriteCommandLCD(0x06); // 显示光标移动设置
 Delay_us(10000);
 WriteCommandLCD(0x0C); // 显示开及光标设置
 Delay_us(1000);
 //WriteCommandLCD(0x80); // 显示开及光标设置
}
示例#2
0
static void ili9325sim_init(void)
{
	pr_info("%s +++\n", __func__);

	LCD_CS(1);
	LCD_SCL(1);
	LCD_SI(1);
	LCD_RST(1);
	
	mdelay(1);
	// Reset LCD
	LCD_RST(0);
	mdelay(10);
	LCD_RST(1);
	mdelay(100);

	//************* Start Initial Sequence **********//
	LCD_ILI9481_CMD(0x11);

	LCD_ILI9481_CMD(0xD0);
	LCD_ILI9481_INDEX(0x07);
	LCD_ILI9481_INDEX(0x41);
	LCD_ILI9481_INDEX(0x15);

	LCD_ILI9481_CMD(0xD1);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x13);
	LCD_ILI9481_INDEX(0x11);

	LCD_ILI9481_CMD(0xD2);
	LCD_ILI9481_INDEX(0x01);
	LCD_ILI9481_INDEX(0x11);

	LCD_ILI9481_CMD(0xC0);
	LCD_ILI9481_INDEX(0x10);
	LCD_ILI9481_INDEX(0x3B);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x02);
	LCD_ILI9481_INDEX(0x11);
	LCD_ILI9481_INDEX(0x00);
	
	LCD_ILI9481_CMD(0xC5);
	LCD_ILI9481_INDEX(0x03);
	
	LCD_ILI9481_CMD(0xB4);
	LCD_ILI9481_INDEX(0x10);//rgb interface

	LCD_ILI9481_CMD(0xB3);
	LCD_ILI9481_INDEX(0x02);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x20);

//	LCD_ILI9481_CMD(0xC6);
//	LCD_ILI9481_INDEX(0x80);


	LCD_ILI9481_CMD(0x3A);
	LCD_ILI9481_INDEX(0x66);


	LCD_ILI9481_CMD(0xC8);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x66);
	LCD_ILI9481_INDEX(0x15);
	LCD_ILI9481_INDEX(0x24);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x08);
	LCD_ILI9481_INDEX(0x26);
	LCD_ILI9481_INDEX(0x11);
	LCD_ILI9481_INDEX(0x77);
	LCD_ILI9481_INDEX(0x42);
	LCD_ILI9481_INDEX(0x08);
	LCD_ILI9481_INDEX(0x00);

	LCD_ILI9481_CMD(0x0B);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x80);

	

	LCD_ILI9481_CMD(0xF0);
	LCD_ILI9481_INDEX(0x08);

	LCD_ILI9481_CMD(0xF6);
	LCD_ILI9481_INDEX(0x84);
	
	LCD_ILI9481_CMD(0xF3);
	LCD_ILI9481_INDEX(0x00);
	LCD_ILI9481_INDEX(0x2A);
	

	LCD_ILI9481_CMD(0x36);
	LCD_ILI9481_INDEX(0x0A);

	mdelay(10);

	LCD_ILI9481_CMD(0x29);
	LCD_ILI9481_CMD(0x2C);

	pr_info("%s ---\n", __func__);
}
示例#3
0
文件: LCD.c 项目: vpcola/LPC1769_NYP
// LCD Reset Sequence is copied from
// internet sources. There are a number of
// command registers needed to be set, some of
// which I wonder what they are being used for?
void LCD_Reset()
{
    //int i;
    LCD_CS(1);        // cs high
    LCD_DC(1);        // dc high
    LCD_RST(0);       // display reset

    // wait_us(50);
    Delay(1);         // Delay 1 ms
    LCD_RST(1);       // end hardware reset
    Delay(5);

    LCD_Cmd(0x01);    // SW reset
    Delay(5);
    LCD_Cmd(0x28);    // display off

    /* Start Initial Sequence */
    LCD_Cmd(0xCF);
    SSP0_Write(0x00);
    SSP0_Write(0x83);
    SSP0_Write(0x30);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xED);
    SSP0_Write(0x64);
    SSP0_Write(0x03);
    SSP0_Write(0x12);
    SSP0_Write(0x81);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xE8);
    SSP0_Write(0x85);
    SSP0_Write(0x01);
    SSP0_Write(0x79);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xCB);
    SSP0_Write(0x39);
    SSP0_Write(0x2C);
    SSP0_Write(0x00);
    SSP0_Write(0x34);
    SSP0_Write(0x02);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xF7);
    SSP0_Write(0x20);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xEA);
    SSP0_Write(0x00);
    SSP0_Write(0x00);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xC0);          // POWER_CONTROL_1
    SSP0_Write(0x26);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xC1);          // POWER_CONTROL_2
    SSP0_Write(0x11);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xC5);          // VCOM_CONTROL_1
    SSP0_Write(0x35);
    SSP0_Write(0x3E);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xC7);          // VCOM_CONTROL_2
    SSP0_Write(0xBE);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0x36);          // MEMORY_ACCESS_CONTROL
    SSP0_Write(0x48);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0x3A);          // COLMOD_PIXEL_FORMAT_SET
    SSP0_Write(0x55);        // 16 bit pixel
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xB1);          // Frame Rate
    SSP0_Write(0x00);
    SSP0_Write(0x1B);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xF2);          // Gamma Function Disable
    SSP0_Write(0x08);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0x26);
    SSP0_Write(0x01);        // gamma set for curve 01/2/04/08
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xE0);          // positive gamma correction
    SSP0_Write(0x1F);
    SSP0_Write(0x1A);
    SSP0_Write(0x18);
    SSP0_Write(0x0A);
    SSP0_Write(0x0F);
    SSP0_Write(0x06);
    SSP0_Write(0x45);
    SSP0_Write(0x87);
    SSP0_Write(0x32);
    SSP0_Write(0x0A);
    SSP0_Write(0x07);
    SSP0_Write(0x02);
    SSP0_Write(0x07);
    SSP0_Write(0x05);
    SSP0_Write(0x00);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xE1);          // negativ gamma correction
    SSP0_Write(0x00);
    SSP0_Write(0x25);
    SSP0_Write(0x27);
    SSP0_Write(0x05);
    SSP0_Write(0x10);
    SSP0_Write(0x09);
    SSP0_Write(0x3A);
    SSP0_Write(0x78);
    SSP0_Write(0x4D);
    SSP0_Write(0x05);
    SSP0_Write(0x18);
    SSP0_Write(0x0D);
    SSP0_Write(0x38);
    SSP0_Write(0x3A);
    SSP0_Write(0x1F);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_WindowMax();

    //LCD_Cmd(0x34);        // tearing effect off
    //LCD_CS(1);

    //LCD_Cmd(0x35);        // tearing effect on
    //LCD_CS(1);

    LCD_Cmd(0xB7);          // entry mode
    SSP0_Write(0x07);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0xB6);          // display function control
    SSP0_Write(0x0A);
    SSP0_Write(0x82);
    SSP0_Write(0x27);
    SSP0_Write(0x00);
    SSP0_WaitBusy();
    LCD_CS(1);

    LCD_Cmd(0x11);          // sleep out
    SSP0_WaitBusy();
    LCD_CS(1);

    // wait_ms(100);
    Delay(100);

    LCD_Cmd(0x29);          // display on
    SSP0_WaitBusy();
    LCD_CS(1);

    // wait_ms(100);
    Delay(100);


}