横屏显示
寄存器R0 R60 设置SS=0,GS=0,或者SS=1,GS=1,效果为起始坐标不一样 ;
R3寄存器也很重要,横竖屏重要参数靠它
seng_cmd_dat(0x00e7,0x0010);
//seng_cmd_dat(0x0001, 0x0100); // set SS and SM bit
#if USE_HORIZONTAL == 1
seng_cmd_dat(0x0001,HORIZONTAL_R01);//SM=0
#else //竖屏
seng_cmd_dat(0x0001,(Vertical_R01));//SM=0
#endif
//seng_cmd_dat(0x0002,0x0200); // set 1 line inversion
seng_cmd_dat(0x0002,0x0700);//电源开启
//seng_cmd_dat(0x0003,0x1028); // set GRAM write direction and BGR=1.
//seng_cmd_dat(0x0003,HORIZONTAL_MODE1); // set GRAM write direction and BGR=1.
#if USE_HORIZONTAL == 1 //BGR HWM ORG ID AM
seng_cmd_dat(0x0003,HORIZONTAL_MODE);
#else //竖屏
seng_cmd_dat(0x0003,Vertical_MODE);
#endif
seng_cmd_dat(0x0004,0x0000); // Resize register
seng_cmd_dat(0x0008,0x0202); // set theback porch and front porch
seng_cmd_dat(0x0009,0x0000); // set non-display area refresh cycle ISC[3:0]
seng_cmd_dat(0x000A,0x0000); // FMARK function
seng_cmd_dat(0x000C,0x0000); // RGB interface setting
seng_cmd_dat(0x000D,0x0000); // Frame marker Position
seng_cmd_dat(0x000F,0x0000); // RGB int erface polarity
//*************Power On sequence **************** //
seng_cmd_dat(0x0010,0x0000); // SAP,BT[3:0],AP,DSTB,SLP,STB
seng_cmd_dat(0x0011,0x0007); // DC1[2:0 ],DC0[2:0],VC[2:0]
seng_cmd_dat(0x0012,0x0000); // VREG1OUT voltage
seng_cmd_dat(0x0013,0x0000); // VDV[4:0] for VCOM amplitude
Delayms(200); // Dis-charge capacitor power voltage
seng_cmd_dat(0x0010,0x1690); // SAP,BT[3:0],AP,DSTB,SLP,STB
seng_cmd_dat(0x0011,0x021a); // R11h=0x 0221 at VCI=3.3V,DC1[2:0],DC0[2:0],VC[2:0]
Delayms(50); // drv_msec_wait 50ms
seng_cmd_dat(0x0012,0x008a); // External reference voltage= Vci;
Delayms(50); // drv_msec_wait 50ms
seng_cmd_dat(0x0013,0x1f00); // VDV[4:0] for VCOM amplitude
seng_cmd_dat(0x0029,0x0021); // VCM[5:0] for VCOMH
seng_cmd_dat(0x002B,0x000d); // Frame Rate = 91Hz
Delayms(50); // drv_msec_wait 50ms
seng_cmd_dat(0x0020,0x0000); // GRAM horizontal Address
seng_cmd_dat(0x0021,0x0000); // GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
//a-Si TFT LCD Single Chip Driver
//240RGBx320 Resolution and 262K color ILI9325D
//The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed,reproduced,or disclosed in
//whole or in part without prior written permission of ILI Technology Corp.
//Page 24 of 26 V0.14
seng_cmd_dat(0x0030,0x0000);
seng_cmd_dat(0x0031,0x0303);
seng_cmd_dat(0x0032,0x0103);
seng_cmd_dat(0x0035,0x0103);
seng_cmd_dat(0x0036,0x0004);
seng_cmd_dat(0x0037,0x0406);
seng_cmd_dat(0x0038,0x0404);
seng_cmd_dat(0x0039,0x0707);
seng_cmd_dat(0x003C,0x0301);
seng_cmd_dat(0x003D,0x0004);
//------------------ Set GRAM area ---------------//
seng_cmd_dat(0x0050,0x0000); // Horizontal GRAM Start Address
seng_cmd_dat(0x0051,0x00EF); // Horizontal GRAM End Address
seng_cmd_dat(0x0052,0x0000); // Vertical GRAM Start Address
seng_cmd_dat(0x0053,0x013F); // Vertical GRAM Start Address
//seng_cmd_dat(0x0060,0xA700); // Gate Sc an Line
#if USE_HORIZONTAL == 1
seng_cmd_dat(0x0060,HORIZONTAL_R60);
#else //竖屏
seng_cmd_dat(0x0060,Vertical_R60);
#endif
seng_cmd_dat(0x0061,0x0001); // NDL,VLE,REV
seng_cmd_dat(0x006A,0x0000); // set scrolling line
//-------------- Partial Display Control ---------//
seng_cmd_dat(0x0080,0x0000);
seng_cmd_dat(0x0081,0x0000);
seng_cmd_dat(0x0082,0x0000);
seng_cmd_dat(0x0083,0x0000);
seng_cmd_dat(0x0084,0x0000);
seng_cmd_dat(0x0085,0x0000);
//-------------- Panel Control -------------------//
seng_cmd_dat(0x0090,0x0010);
seng_cmd_dat(0x0092,0x0600);
seng_cmd_dat(0x0007,0x0133); // 262K color and display ON
seng_cmd_dat(0x0020,0x0000);
seng_cmd_dat(0x0021,0x013f);
Delayms(10);
LEDK=0;
dsp_single_colour(RED);