void HX8347_Init_CMO32(void) { RESET(); DelayX1ms(150); // After Inter-MicroP Program (load OTP) // Gamma for CMO 3.2Ħħ Set_LCD_8B_REG(0x0046,0x00A4); Set_LCD_8B_REG(0x0047,0x0053); Set_LCD_8B_REG(0x0048,0x0000); Set_LCD_8B_REG(0x0049,0x0044); Set_LCD_8B_REG(0x004A,0x0004); Set_LCD_8B_REG(0x004B,0x0067); Set_LCD_8B_REG(0x004C,0x0033); Set_LCD_8B_REG(0x004D,0x0077); Set_LCD_8B_REG(0x004E,0x0012); Set_LCD_8B_REG(0x004F,0x004C); Set_LCD_8B_REG(0x0050,0x0046); Set_LCD_8B_REG(0x0051,0x0044); //240x320 window setting Set_LCD_8B_REG(0x0002,0x0000); // Column address start2 Set_LCD_8B_REG(0x0003,0x0000); // Column address start1 Set_LCD_8B_REG(0x0004,0x0000); // Column address end2 Set_LCD_8B_REG(0x0005,0x00EF); // Column address end1 Set_LCD_8B_REG(0x0006,0x0000); // Row address start2 Set_LCD_8B_REG(0x0007,0x0000); // Row address start1 Set_LCD_8B_REG(0x0008,0x0001); // Row address end2 Set_LCD_8B_REG(0x0009,0x003F); // Row address end1 // Display Setting Set_LCD_8B_REG(0x0001,0x0006); // IDMON=0, INVON=1, NORON= Set_LCD_8B_REG(0x0016,0x0048); // MY=0, MX=0, MV=0, ML=1, BG Set_LCD_8B_REG(0x0023,0x0095); // N_DC=1001 0101 Set_LCD_8B_REG(0x0024,0x0095); // PI_DC=1001 0101 Set_LCD_8B_REG(0x0025,0x00FF); // I_DC=1111 1111 Set_LCD_8B_REG(0x0027,0x0002); // N_BP=0000 0010 Set_LCD_8B_REG(0x0028,0x0002); // N_FP=0000 0010 Set_LCD_8B_REG(0x0029,0x0002); // PI_BP=0000 0010 Set_LCD_8B_REG(0x002A,0x0002); // PI_FP=0000 0010 Set_LCD_8B_REG(0x002C,0x0002); // I_BP=0000 0010 Set_LCD_8B_REG(0x002D,0x0002); // I_FP=0000 0010 Set_LCD_8B_REG(0x003A,0x0001); // N_RTN=0000, N_NW=001 Set_LCD_8B_REG(0x003B,0x0001); // PI_RTN=0000, PI_NW=001 Set_LCD_8B_REG(0x003C,0x00F0); // I_RTN=1111, I_NW=000 Set_LCD_8B_REG(0x003D,0x0000); // DIV=00 DelayX1ms(20); Set_LCD_8B_REG(0x0035,0x0038); // EQS=38h Set_LCD_8B_REG(0x0036,0x0078); // EQP=78h Set_LCD_8B_REG(0x003E,0x0038); // SON=38h Set_LCD_8B_REG(0x0040,0x000F); // GDON=0Fh Set_LCD_8B_REG(0x0041,0x00F0); // GDOFF // Power Supply Setting Set_LCD_8B_REG(0x0019,0x0049); // CADJ=0100, CUADJ=100(FR:60Hz),, OSD_EN=1 Set_LCD_8B_REG(0x0093,0x000F); // RADJ=1111, 100% DelayX1ms(10); Set_LCD_8B_REG(0x0020,0x0040); // BT=0100 Set_LCD_8B_REG(0x001D,0x0007); // VC1=111 Set_LCD_8B_REG(0x001E,0x0000); // VC3=000 Set_LCD_8B_REG(0x001F,0x0004); // VRH=0100 // VCOM Setting for CMO 3.2Ħħ Panel Set_LCD_8B_REG(0x0044,0x004D); // VCM=100 1101 Set_LCD_8B_REG(0x0045,0x0011); // VDV=1 0001 DelayX1ms(10); Set_LCD_8B_REG(0x001C,0x0004); // AP=100 DelayX1ms(20); Set_LCD_8B_REG(0x0043,0x0080); //set VCOMG=1 DelayX1ms(5); Set_LCD_8B_REG(0x001B,0x0008); // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0 DelayX1ms(40); Set_LCD_8B_REG(0x001B,0x0010); // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0 DelayX1ms(40); // Display ON Setting Set_LCD_8B_REG(0x0090,0x007F); // SAP=0111 1111 Set_LCD_8B_REG(0x0026,0x0004); //GON=0, DTE=0, D=01 DelayX1ms(40); Set_LCD_8B_REG(0x0026,0x0024); //GON=1, DTE=0, D=01 Set_LCD_8B_REG(0x0026,0x002C); //GON=1, DTE=0, D=11 DelayX1ms(40); Set_LCD_8B_REG(0x0026,0x003C); //GON=1, DTE=1, D=11 // Set internal VDDD voltage Set_LCD_8B_REG(0x0057,0x0002); //Test_Mode Enable Set_LCD_8B_REG(0x0055,0x0000); //VDC_SEL=000, VDDD=1.95V Set_LCD_8B_REG(0x0057,0x0000); // Test_Mode Disable } void HX8347A_STB_INTO (void) { // Display Off Set_LCD_8B_REG(0x0026,0x0038); //GON=1, DTE=1, D=10 DelayX1ms (40); Set_LCD_8B_REG(0x0026,0x0028); //GON=1, DTE=0, D=10 DelayX1ms (40); Set_LCD_8B_REG(0x0026,0x0000); //GON=0, DTE=0, D=00 // Power Off Set_LCD_8B_REG(0x0043,0x0000); // VCOMG=0 DelayX1ms(10); Set_LCD_8B_REG(0x001B,0x0000); // GASENB=0, PON=0, DK=0, XDK=0, // VLCD_TRI=0, STB=0 DelayX1ms(10); Set_LCD_8B_REG(0x001B,0x0008); // GASENB=0, PON=0, DK=1, XDK=0, // VLCD_TRI=0, STB=0 DelayX1ms(10); Set_LCD_8B_REG(0x001C,0x0000); // AP=000 DelayX1ms(10); Set_LCD_8B_REG(0x0090,0x0000); // SAP=00000000 DelayX1ms(10); // Into STB mode Set_LCD_8B_REG(0x001B,00009); // GASSENB=0, PON=0, DK=1, XDK=0, // VLCD_TRI=0, STB=1 DelayX1ms(10); // Stop Oscillation Set_LCD_8B_REG(0x0019,0x0048); // CADJ=0100, CUADJ=100, OSD_EN=0 } void HX8347A_STB_EXIT (void) { // Start Oscillation Set_LCD_8B_REG(0x0019,0x0049); // OSCADJ=100 010(FR:60Hz), OSD_E DelayX1ms(10); // Exit STB mode Set_LCD_8B_REG(0x001B,0x0008); // NIDSENB=0, PON=0, DK=1, XDK=0, // VLCD_TRI=0, STB=0 // Power Supply Setting Set_LCD_8B_REG(0x0020,0x0040); // BT=0100 Set_LCD_8B_REG(0x001D,0x0007); // VC1=111 Set_LCD_8B_REG(0x001E,0x0000); // VC3=000 Set_LCD_8B_REG(0x001F,0x0003); // VRH=0011 Set_LCD_8B_REG(0x0044,0x0020); // VCM=010 0000 Set_LCD_8B_REG(0x0045,0x000E); // VDV=0 1110 DelayX1ms(10); Set_LCD_8B_REG(0x001C,0x0004); // AP=100 DelayX1ms(20); Set_LCD_8B_REG(0x001B,0x0000); // NIDSENB=0, PON=0, DK=0, XDK=0, // VLCD_TRI=0, STB=0 DelayX1ms(40); Set_LCD_8B_REG(0x001B,0x0010); // NIDSENB=0, PON=1, DK=0, XDK=0, // VLCD_TRI=1, STB=0 DelayX1ms(40); Set_LCD_8B_REG(0x0043,0x0080); // VCOMG=1 DelayX1ms(100); // Display ON Setting Set_LCD_8B_REG(0x0090,0x007F); // SAP=01111111 DelayX1ms(40); Set_LCD_8B_REG(0x0026,0x0004); //GON=0, DTE=0, D=01 DelayX1ms(40); Set_LCD_8B_REG(0x0026,0x0024); //GON=1, DTE=0, D=01 Set_LCD_8B_REG(0x0026,0x002C); //GON=1, DTE=0, D=11 DelayX1ms(40); Set_LCD_8B_REG(0x0026,0x003C); //GON=1, DTE=1, D=11 }