delay_ms(10); // Delayms 10ms // This delay time is necessary
LCD_SetRst();
delay_ms(120); // Delayms 120 ms
}
void ST7789_Init(void)
{
int n;
LCD_Pins_Config();
ST7789_Reset();
ST7789_WriteCommand(0x0011); //exit SLEEP mode
delay_ms(120);
ST7789_WriteCommand(0x0036);
ST7789_WriteData(0x0060); //MADCTL: memory data access control
ST7789_WriteCommand(0x003A);
ST7789_WriteData(0x0005); //COLMOD: Interface Pixel format *** I use 262K-colors in 18bit/pixel format when using 8-bit interface to allow 3-bytes per pixel
// TFT_24_7789_Write_Command(0x003A);TFT_24_7789_Write_Data(0x0055);//COLMOD: Interface Pixel format *** I use 65K-colors in 16bit/pixel (5-6-5) format when using 16-bit interface to allow 1-byte per pixel