acidportal

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

ILI9225_Init.h (3214B)

      1 // This is the command sequence that initialises the ILI9225 driver
      2 
      3 {
      4 	writecommand(ILI9225_POWER_CTRL1);
      5 	writedata(0x00);writedata(0x00);
      6 	writecommand(ILI9225_POWER_CTRL2);
      7 	writedata(0x00);writedata(0x00);
      8 	writecommand(ILI9225_POWER_CTRL3);
      9 	writedata(0x00);writedata(0x00);
     10 	writecommand(ILI9225_POWER_CTRL4);
     11 	writedata(0x00);writedata(0x00);
     12 	writecommand(ILI9225_POWER_CTRL5);
     13 	writedata(0x00);writedata(0x00);
     14 
     15 	delay(40);
     16 
     17 	writecommand(ILI9225_POWER_CTRL2);
     18 	writedata(0x00);writedata(0x18);
     19 	writecommand(ILI9225_POWER_CTRL3);
     20 	writedata(0x61);writedata(0x21);
     21 	writecommand(ILI9225_POWER_CTRL4);
     22 	writedata(0x00);writedata(0x6F);
     23 	writecommand(ILI9225_POWER_CTRL5);
     24 	writedata(0x49);writedata(0x5F);
     25 	writecommand(ILI9225_POWER_CTRL1);
     26 	writedata(0x08);writedata(0x00);
     27 
     28 	delay(10);
     29 
     30 	writecommand(ILI9225_POWER_CTRL2);
     31 	writedata(0x10);writedata(0x3B);
     32 
     33 	delay(50);
     34 
     35 	writecommand(ILI9225_LCD_AC_DRIVING_CTRL);
     36 	writedata(0x01);writedata(0x00);
     37 	writecommand(ILI9225_DISP_CTRL1);
     38 	writedata(0x00);writedata(0x00);
     39 	writecommand(ILI9225_BLANK_PERIOD_CTRL1);
     40 	writedata(0x08);writedata(0x08);
     41 	writecommand(ILI9225_FRAME_CYCLE_CTRL);
     42 	writedata(0x11);writedata(0x00);
     43 	writecommand(ILI9225_INTERFACE_CTRL);
     44 	writedata(0x00);writedata(0x00);
     45 	writecommand(ILI9225_OSC_CTRL);
     46 	writedata(0x0D);writedata(0x01);
     47 	writecommand(ILI9225_VCI_RECYCLING);
     48 	writedata(0x00);writedata(0x20);
     49 	writecommand(ILI9225_RAM_ADDR_SET1);
     50 	writedata(0x00);writedata(0x00);
     51 	writecommand(ILI9225_RAM_ADDR_SET2);
     52 	writedata(0x00);writedata(0x00);
     53 
     54 	writecommand(ILI9225_GATE_SCAN_CTRL);
     55 	writedata(0x00);writedata(0x00);
     56 	writecommand(ILI9225_VERTICAL_SCROLL_CTRL1);
     57 	writedata(0x00);writedata(0xDB);
     58 	writecommand(ILI9225_VERTICAL_SCROLL_CTRL2);
     59 	writedata(0x00);writedata(0x00);
     60 	writecommand(ILI9225_VERTICAL_SCROLL_CTRL3);
     61 	writedata(0x00);writedata(0x00);
     62 	writecommand(ILI9225_PARTIAL_DRIVING_POS1);
     63 	writedata(0x00);writedata(0xDB);
     64 	writecommand(ILI9225_PARTIAL_DRIVING_POS2);
     65 	writedata(0x00);writedata(0x00);
     66 	writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR1);
     67 	writedata(0x00);writedata(0xAF);
     68 	writecommand(ILI9225_HORIZONTAL_WINDOW_ADDR2);
     69 	writedata(0x00);writedata(0x00);
     70 	writecommand(ILI9225_VERTICAL_WINDOW_ADDR1);
     71 	writedata(0x00);writedata(0xDB);
     72 	writecommand(ILI9225_VERTICAL_WINDOW_ADDR2);
     73 	writedata(0x00);writedata(0x00);
     74 
     75 	/* Set GAMMA curve */
     76 	writecommand(ILI9225_GAMMA_CTRL1);
     77 	writedata(0x00);writedata(0x00);
     78 	writecommand(ILI9225_GAMMA_CTRL2);
     79 	writedata(0x08);writedata(0x08);
     80 	writecommand(ILI9225_GAMMA_CTRL3);
     81 	writedata(0x08);writedata(0x0A);
     82 	writecommand(ILI9225_GAMMA_CTRL4);
     83 	writedata(0x00);writedata(0x0A);
     84 	writecommand(ILI9225_GAMMA_CTRL5);
     85 	writedata(0x0A);writedata(0x08);
     86 	writecommand(ILI9225_GAMMA_CTRL6);
     87 	writedata(0x08);writedata(0x08);
     88 	writecommand(ILI9225_GAMMA_CTRL7);
     89 	writedata(0x00);writedata(0x00);
     90 	writecommand(ILI9225_GAMMA_CTRL8);
     91 	writedata(0x0A);writedata(0x00);
     92 	writecommand(ILI9225_GAMMA_CTRL9);
     93 	writedata(0x07);writedata(0x10);
     94 	writecommand(ILI9225_GAMMA_CTRL10);
     95 	writedata(0x07);writedata(0x10);
     96 
     97 	writecommand(ILI9225_DISP_CTRL1);
     98 	writedata(0x00);writedata(0x12);
     99 
    100 	delay(50);
    101 
    102 	writecommand(ILI9225_DISP_CTRL1);
    103 	writedata(0x10);writedata(0x17);
    104 
    105 }