PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

initlcd.h 2.7KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. case ILI9341_S5P:
  2. LCD_Write_COM(0xCB);
  3. LCD_Write_DATA(0x39);
  4. LCD_Write_DATA(0x2C);
  5. LCD_Write_DATA(0x00);
  6. LCD_Write_DATA(0x34);
  7. LCD_Write_DATA(0x02);
  8. LCD_Write_COM(0xCF);
  9. LCD_Write_DATA(0x00);
  10. LCD_Write_DATA(0XC1);
  11. LCD_Write_DATA(0X30);
  12. LCD_Write_COM(0xE8);
  13. LCD_Write_DATA(0x85);
  14. LCD_Write_DATA(0x00);
  15. LCD_Write_DATA(0x78);
  16. LCD_Write_COM(0xEA);
  17. LCD_Write_DATA(0x00);
  18. LCD_Write_DATA(0x00);
  19. LCD_Write_COM(0xED);
  20. LCD_Write_DATA(0x64);
  21. LCD_Write_DATA(0x03);
  22. LCD_Write_DATA(0X12);
  23. LCD_Write_DATA(0X81);
  24. LCD_Write_COM(0xF7);
  25. LCD_Write_DATA(0x20);
  26. LCD_Write_COM(0xC0); //Power control
  27. LCD_Write_DATA(0x23); //VRH[5:0]
  28. LCD_Write_COM(0xC1); //Power control
  29. LCD_Write_DATA(0x10); //SAP[2:0];BT[3:0]
  30. LCD_Write_COM(0xC5); //VCM control
  31. LCD_Write_DATA(0x3e); //Contrast
  32. LCD_Write_DATA(0x28);
  33. LCD_Write_COM(0xC7); //VCM control2
  34. LCD_Write_DATA(0x86); //--
  35. LCD_Write_COM(0x36); // Memory Access Control
  36. LCD_Write_DATA(0x48);
  37. LCD_Write_COM(0x3A);
  38. LCD_Write_DATA(0x55);
  39. LCD_Write_COM(0xB1);
  40. LCD_Write_DATA(0x00);
  41. LCD_Write_DATA(0x18);
  42. LCD_Write_COM(0xB6); // Display Function Control
  43. LCD_Write_DATA(0x08);
  44. LCD_Write_DATA(0x82);
  45. LCD_Write_DATA(0x27);
  46. /*
  47. LCD_Write_COM(0xF2); // 3Gamma Function Disable
  48. LCD_Write_DATA(0x00);
  49. LCD_Write_COM(0x26); //Gamma curve selected
  50. LCD_Write_DATA(0x01);
  51. LCD_Write_COM(0xE0); //Set Gamma
  52. LCD_Write_DATA(0x0F);
  53. LCD_Write_DATA(0x31);
  54. LCD_Write_DATA(0x2B);
  55. LCD_Write_DATA(0x0C);
  56. LCD_Write_DATA(0x0E);
  57. LCD_Write_DATA(0x08);
  58. LCD_Write_DATA(0x4E);
  59. LCD_Write_DATA(0xF1);
  60. LCD_Write_DATA(0x37);
  61. LCD_Write_DATA(0x07);
  62. LCD_Write_DATA(0x10);
  63. LCD_Write_DATA(0x03);
  64. LCD_Write_DATA(0x0E);
  65. LCD_Write_DATA(0x09);
  66. LCD_Write_DATA(0x00);
  67. LCD_Write_COM(0XE1); //Set Gamma
  68. LCD_Write_DATA(0x00);
  69. LCD_Write_DATA(0x0E);
  70. LCD_Write_DATA(0x14);
  71. LCD_Write_DATA(0x03);
  72. LCD_Write_DATA(0x11);
  73. LCD_Write_DATA(0x07);
  74. LCD_Write_DATA(0x31);
  75. LCD_Write_DATA(0xC1);
  76. LCD_Write_DATA(0x48);
  77. LCD_Write_DATA(0x08);
  78. LCD_Write_DATA(0x0F);
  79. LCD_Write_DATA(0x0C);
  80. LCD_Write_DATA(0x31);
  81. LCD_Write_DATA(0x36);
  82. LCD_Write_DATA(0x0F);
  83. */
  84. LCD_Write_COM(0x11); //Exit Sleep
  85. delay(120);
  86. LCD_Write_COM(0x29); //Display on
  87. LCD_Write_COM(0x2c);
  88. break;