/************************************************************************ * Function: void GfxTconInit(void) * * Overview: Initialize the IOs to implement Bitbanged SPI interface * to connect to the Timing Controller through SPI. * * Input: none * * Output: none * ************************************************************************/ void GfxTconInit(void) { InitBitBangedIO(); DelayMs(20); GPIO_TCON(0x0006, 0x2020); DelayMs(20); }
void TCON_Init(void) { SetReg(0xA8, CS | SDO | SCL); TCON_CTRL(CS, 1); TCON_CTRL(SDO, 1); TCON_CTRL(SCL, 1); DelayMs(20); GPIO_TCON(0x0001, 0x6300); //Driver Output Control GPIO_TCON(0x0002, 0x0200); //LCD-Driving-Waveform Control:N-line inversion,N=0 GPIO_TCON(0x0003, 0x7184); //Power control 1:Set the step-up cycle of the step-up circuit for 262k-color mode DelayMs(100); GPIO_TCON(0x0004, 0x0447); //Input Data and Color Filter Control GPIO_TCON(0x0005, 0xb854); //Function Control GPIO_TCON(0X000a, 0x4008); //Contrast/Brightness Control // GPIO_TCON(0X000a,0xff18);//Contrast/Brightness Control DelayMs(40); GPIO_TCON(0x000b, 0xd400); //Frame Cycle Control GPIO_TCON(0x000d, 0x123a); //Power Control 2 DelayMs(200); GPIO_TCON(0x000e, 0x3000); //Power Control 3 DelayMs(200); GPIO_TCON(0x000f, 0x0000); //Gate Scan Position GPIO_TCON(0x0016, 0x9f80); //Horizontal Porch GPIO_TCON(0x0017, 0x2212); //Vertical Porch DelayMs(200); GPIO_TCON(0x001e, 0x00ef); //Set the VCOMH voltage DelayMs(200); GPIO_TCON(0x0030, 0x0507); //Gamma Control GPIO_TCON(0x0031, 0x0004); //Gamma Control GPIO_TCON(0x0032, 0x0707); //Gamma Control GPIO_TCON(0x0033, 0x0000); //Gamma Control GPIO_TCON(0x0034, 0x0000); //Gamma Control GPIO_TCON(0x0035, 0x0307); //Gamma Control GPIO_TCON(0x0036, 0x0700); //Gamma Control GPIO_TCON(0x0037, 0x0000); //Gamma Control GPIO_TCON(0x003a, 0x140b); //Gamma Control GPIO_TCON(0x003b, 0x140b); //Gamma Control }