mcufriend 2.4" TFT - How to initialize the display?

Hello,

I have the mcufriend 2.4" TFT display shield, run on ILI9335 driver on 8-bit parallel transmission.

I'm excited to learn how initialize TFTs. I read the datasheet and it has quite a lot of configuration registers.

I found a simple direct code for this display but I don't know if it's the this particular driver or not but it's working with my display.

I want to move to controlling the pixels and display images .. etc.

But the important part now is the proper way to initialize it.

The code I found has a lot of configurations:

void InitializeTFT(){
int i=0,j=0;

char IR_Command[270]={     //Partial Image display commands are not included in this initialization
0x00,0x01,0x01,0x00,    
0x00,0x02,0x07,0x00,    
0x00,0x03,0x10,0x30,//Sets the direction of display    
0x00,0x08,0x03,0x02,    
0x00,0x09,0x00,0x00,   
0x00,0x0A,0x00,0x08,    
//*******POWER CONTROL REGISTER INITIAL*******//    
0x00,0x10,0x07,0x90,    
0x00,0x11,0x00,0x05,    
0x00,0x12,0x00,0x00,   
0x00,0x13,0x00,0x00,     
//********POWER SUPPPLY STARTUP 1 SETTING*******//    
0x00,0x10,0x12,0xB0,    
0x00,0x11,0x00,0x07,      
//********POWER SUPPLY STARTUP 2 SETTING******//    
0x00,0x12,0x00,0x8C,    
0x00,0x13,0x17,0x00,    
0x00,0x29,0x00,0x22,       
//******GAMMA CLUSTER SETTING******//    
0x00,0x30,0x00,0x00,    
0x00,0x31,0x05,0x05,    
0x00,0x32,0x02,0x05,    
0x00,0x35,0x02,0x06,    
0x00,0x36,0x04,0x08,    
0x00,0x37,0x00,0x00,    
0x00,0x38,0x05,0x04,
0x00,0x39,0x02,0x06,    
0x00,0x3C,0x02,0x06,    
0x00,0x3D,0x04,0x08, 
// -----------DISPLAY WINDOWS 240*320-------------//    
0x00,0x50,0x00,0x00,
0x00,0x51,0x00,0xEF,   
0x00,0x52,0x00,0x01,   
0x00,0x53,0x01,0x3F,   
//-----FRAME RATE SETTING-------//    
0x00,0x60,0xA7,0x00,   
0x00,0x61,0x00,0x01,   
0x00,0x90,0x00,0x33, //RTNI setting
//-------DISPLAY ON------//    
0x00,0x07,0x01,0x33,  0x00,0x01,0x01,0x00,      
0x00,0x02,0x07,0x00,    
0x00,0x03,0x10,0x30,    
0x00,0x08,0x03,0x02,    
0x00,0x09,0x00,0x00,   
0x00,0x0A,0x00,0x08,    
//*******POWER CONTROL REGISTER INITIAL*******//    
0x00,0x10,0x07,0x90,    
0x00,0x11,0x00,0x05,    
0x00,0x12,0x00,0x00,   
0x00,0x13,0x00,0x00,   
//********POWER SUPPPLY STARTUP 1 SETTING*******//    
0x00,0x10,0x12,0xB0,      
0x00,0x11,0x00,0x07,     
//********POWER SUPPLY STARTUP 2 SETTING******//    
0x00,0x12,0x00,0x8C,    
0x00,0x13,0x17,0x00,    
0x00,0x29,0x00,0x22,       
//******GAMMA CLUSTER SETTING******//    
0x00,0x30,0x00,0x00,    
0x00,0x31,0x05,0x05,    
0x00,0x32,0x02,0x05,    
0x00,0x35,0x02,0x06,    
0x00,0x36,0x04,0x08,    
0x00,0x37,0x00,0x00,    
0x00,0x38,0x05,0x04,
0x00,0x39,0x02,0x06,    
0x00,0x3C,0x02,0x06,    
0x00,0x3D,0x04,0x08,     
// -----------DISPLAY WINDOWS 240*320-------------//    
0x00,0x50,0x00,0x00,//Start of Horizontal adress area
0x00,0x51,0x00,0xEF,//Ends Horizontal adress area   
0x00,0x52,0x00,0x01,//Start of Vertical adress area   
0x00,0x53,0x01,0x3F,//Ends Vertical adress area   
//-----FRAME RATE SETTING-------//    
0x00,0x60,0xA7,0x00,   
0x00,0x61,0x00,0x01,   
0x00,0x90,0x00,0x33, //RTNI setting
//-------DISPLAY ON------//    
0x00,0x07,0x01,0x33
};

So does the TFT has to run all these configurations to run properly?
I think there are some duplicated sections in the array.

My most important question now is that what are the short way to the most necessary registers to configure to run the display?

UP IN CASE NO ONE NOTICED THE TOPIC