//DJN Co.,LTD.
//LCM operation code
//Driver IC: NT39102
//Panel: AUO 1.77
/********************************************************************************
DESCRIPTION:
LCM initialization sequence.
PARAMETERS:
RETURNS:
REMARKS:
*********************************************************************************/
void NT39102_AUO177_Initial(void)
{
/*
请显示动画前请加REG[FDH]=01H,
动画结束之后请加REG[FDH]=00H,另外初始化请用以下代码,以上请知悉,谢谢!!
----贺翔华
*/
LCD_WRITE_CMD(0x01);
Delayms(50);
LCD_WRITE_CMD(0x11);
Delayms(100);
LCD_WRITE_CMD(0x36);LCD_WRITE_DATA(0x00);
LCD_WRITE_CMD(0x3a);LCD_WRITE_DATA(0x05);
LCD_WRITE_CMD(0x26);LCD_WRITE_DATA(0x02);
LCD_WRITE_CMD(0xE0);
LCD_WRITE_DATA(0x40);
LCD_WRITE_DATA(0x75);
LCD_WRITE_DATA(0x74);
LCD_WRITE_DATA(0x01);
LCD_WRITE_DATA(0x9a);
LCD_WRITE_DATA(0x06);
LCD_WRITE_DATA(0x17);
LCD_WRITE_DATA(0xe1);
LCD_WRITE_CMD(0xE1);
LCD_WRITE_DATA(0x77);
LCD_WRITE_DATA(0x70);
LCD_WRITE_DATA(0x73);
LCD_WRITE_DATA(0x0e);
LCD_WRITE_DATA(0x15);
LCD_WRITE_DATA(0x02);
LCD_WRITE_DATA(0x03);
LCD_WRITE_DATA(0x29);
LCD_WRITE_CMD(0xc7);LCD_WRITE_DATA(0xbf);
LCD_WRITE_CMD(0xc0);LCD_WRITE_DATA(0x05);LCD_WRITE_DATA(0x05);
LCD_WRITE_CMD(0xc5); LCD_WRITE_DATA(0x58); LCD_WRITE_DATA(0x4d);
LCD_WRITE_CMD(0xc6); LCD_WRITE_DATA(0x07);
LCD_WRITE_CMD(0xfa);LCD_WRITE_DATA(0x00);
LCD_WRITE_CMD(0xfb);LCD_WRITE_DATA(0x00);
LCD_WRITE_CMD(0xfc);LCD_WRITE_DATA(0x07);
LCD_WRITE_CMD(0x29);
}
/********************************************************************************
DESCRIPTION:
LCM display window setting.
PARAMETERS:
xs: Horizontal Address Start Position
xe: Horizontal Address End Position
ys: Vertical Address Start Position
ye: Vertical Address End Position
RETURNS:
REMARKS:
*********************************************************************************/
void LCD_set_Window_NT39102(int xs,int xe,int ys,int ye)
{
LCD_WRITE_CMD(0x36); //scan mode
LCD_WRITE_DATA(0x00);
LCD_WRITE_CMD(0x2a);
LCD_WRITE_DATA(xs>>8); //X start High
LCD_WRITE_DATA(xs); //X start Low
LCD_WRITE_DATA(xe>>8); //X end High
LCD_WRITE_DATA(xe); //X end Low
LCD_WRITE_CMD(0x2b);
LCD_WRITE_DATA(ys>>8); //Y start High
LCD_WRITE_DATA(ys); //Y start Low
LCD_WRITE_DATA(ye>>8); //Y end High
LCD_WRITE_DATA(ye); //Y end Low
LCD_WRITE_CMD(0x2C);
}
/********************************************************************************
DESCRIPTION:
LCM enter_sleep_mode sequence.
PARAMETERS:
RETURNS:
REMARKS:
1) This command has no effect when module is already in sleep in mode.
Sleep In Mode can only be exit by the Sleep Out Command (11h).
2) It will be necessary to wait 5msec before sending next command,
this is to allow time for the supply voltages and clock circuits to stabilize.
3) It will be necessary to wait 120msec after sending Sleep Out command
(when in Sleep In Mode) before Sleep In command can be sent.
*********************************************************************************/
void LCD_EnterSleep_NT39102(void)
{
write_command(0x10);
Delay_ms(120);
}
/********************************************************************************
DESCRIPTION:
LCM exit_sleep_mode sequence.
PARAMETERS:
RETURNS:
REMARKS:
1) This command has no effect when module is already in sleep out mode.
Sleep Out Mode can only be exit by the Sleep In Command (10h).
2) It will be necessary to wait 5msec before sending next command.
*********************************************************************************/
void LCD_ExitSleep_NT39102(void)
{
write_command(0x11);
Delay_ms(20);
}
阅读(1324) | 评论(0) | 转发(0) |