acidportal

- 😈 Worlds smallest Evil Portal on a LilyGo T-QT
git clone git://git.acid.vegas/acidportal.git
Log | Files | Refs | Archive | README | LICENSE

ILI9486_Init.h (2377B)

      1 
      2 // This is the command sequence that initialises the ILI9486 driver
      3 //
      4 // This setup information uses simple 8 bit SPI writecommand() and writedata() functions
      5 //
      6 // See ST7735_Setup.h file for an alternative format
      7 
      8 {
      9 // From https://github.com/notro/fbtft/blob/master/fb_ili9486.c
     10 
     11     writecommand(0x01); // SW reset
     12     delay(120);
     13 
     14     writecommand(0x11); // Sleep out, also SW reset
     15     delay(120);
     16 
     17     writecommand(0x3A);
     18     #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
     19       writedata(0x55);           // 16 bit colour interface
     20     #else
     21       writedata(0x66);           // 18 bit colour interface
     22     #endif
     23 
     24     writecommand(0xC0); //                          1100.0000 Power Control 1
     25     writedata(0x0E);    //                          0001.0111   ... VRH1
     26     writedata(0x0E);    //                          0001.0101   ... VRH2
     27     writecommand(0xC1); //                          1100.0001 Power Control 2
     28     writedata(0x41);    //                          0100.0001   . SAP BT
     29     writedata(0x00);    //                          0000.0000   ..... VC
     30     writecommand(0xC2); //                          1100.0010 Power Control 3
     31     writedata(0x55);    //     nb. was 0x44         0101.0101   . DCA1 . DCA0
     32 
     33     writecommand(0xC5);
     34     writedata(0x00);
     35     writedata(0x00);
     36     writedata(0x00);
     37     writedata(0x00);
     38 
     39     writecommand(0xE0);
     40     writedata(0x0F);
     41     writedata(0x1F);
     42     writedata(0x1C);
     43     writedata(0x0C);
     44     writedata(0x0F);
     45     writedata(0x08);
     46     writedata(0x48);
     47     writedata(0x98);
     48     writedata(0x37);
     49     writedata(0x0A);
     50     writedata(0x13);
     51     writedata(0x04);
     52     writedata(0x11);
     53     writedata(0x0D);
     54     writedata(0x00);
     55  
     56     writecommand(0xE1);
     57     writedata(0x0F);
     58     writedata(0x32);
     59     writedata(0x2E);
     60     writedata(0x0B);
     61     writedata(0x0D);
     62     writedata(0x05);
     63     writedata(0x47);
     64     writedata(0x75);
     65     writedata(0x37);
     66     writedata(0x06);
     67     writedata(0x10);
     68     writedata(0x03);
     69     writedata(0x24);
     70     writedata(0x20);
     71     writedata(0x00);
     72  
     73     #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE)
     74       writecommand(TFT_INVOFF);
     75     #else
     76       writecommand(TFT_INVON);
     77     #endif
     78  
     79     writecommand(0x36);
     80     writedata(0x48);
     81 
     82     writecommand(0x29);                     // display on
     83     delay(150);
     84 }