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 3.9KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. case S1D19122:
  2. //************* Start Initial Sequence **********//
  3. int i,R,G,B;
  4. LCD_Write_COM(0x11);
  5. LCD_Write_COM(0x13);
  6. LCD_Write_COM(0x29);
  7. //-------------- Display Control ---------//
  8. LCD_Write_COM(0xB0);
  9. LCD_Write_DATA(0x05);
  10. LCD_Write_DATA(0x00);
  11. LCD_Write_DATA(0xF0);
  12. LCD_Write_DATA(0x0A);
  13. LCD_Write_DATA(0x41);
  14. LCD_Write_DATA(0x02);
  15. LCD_Write_DATA(0x0A);
  16. LCD_Write_DATA(0x30);
  17. LCD_Write_DATA(0x31);
  18. LCD_Write_DATA(0x36);
  19. LCD_Write_DATA(0x37);
  20. LCD_Write_DATA(0x40);
  21. LCD_Write_DATA(0x02);
  22. LCD_Write_DATA(0x3F);
  23. LCD_Write_DATA(0x40);
  24. LCD_Write_DATA(0x02);
  25. LCD_Write_DATA(0x81);
  26. LCD_Write_DATA(0x04);
  27. LCD_Write_DATA(0x05);
  28. LCD_Write_DATA(0x64);
  29. // ----------- Gamma Curve Set3 Postive----------//
  30. LCD_Write_COM(0xFC);
  31. LCD_Write_DATA(0x88);
  32. LCD_Write_DATA(0x00);
  33. LCD_Write_DATA(0x10);
  34. LCD_Write_DATA(0x01);
  35. LCD_Write_DATA(0x01);
  36. LCD_Write_DATA(0x10);
  37. LCD_Write_DATA(0x42);
  38. LCD_Write_DATA(0x42);
  39. LCD_Write_DATA(0x22);
  40. LCD_Write_DATA(0x11);
  41. LCD_Write_DATA(0x11);
  42. LCD_Write_DATA(0x22);
  43. LCD_Write_DATA(0x99);
  44. LCD_Write_DATA(0xAA);
  45. LCD_Write_DATA(0xAA);
  46. LCD_Write_DATA(0xAA);
  47. LCD_Write_DATA(0xBB);
  48. LCD_Write_DATA(0xBB);
  49. LCD_Write_DATA(0xAA);
  50. LCD_Write_DATA(0x33);
  51. LCD_Write_DATA(0x33);
  52. LCD_Write_DATA(0x11);
  53. LCD_Write_DATA(0x01);
  54. LCD_Write_DATA(0x01);
  55. LCD_Write_DATA(0x01);
  56. LCD_Write_DATA(0x00);
  57. LCD_Write_DATA(0x00);
  58. LCD_Write_DATA(0xC0);
  59. LCD_Write_DATA(0x00);
  60. LCD_Write_DATA(0x00);
  61. LCD_Write_DATA(0x00);
  62. LCD_Write_DATA(0x00);
  63. // ----------- Gamma Curve Set3 Negative----------//
  64. LCD_Write_COM(0xFD);
  65. LCD_Write_DATA(0x88);
  66. LCD_Write_DATA(0x00);
  67. LCD_Write_DATA(0x10);
  68. LCD_Write_DATA(0x01);
  69. LCD_Write_DATA(0x01);
  70. LCD_Write_DATA(0x10);
  71. LCD_Write_DATA(0x42);
  72. LCD_Write_DATA(0x42);
  73. LCD_Write_DATA(0x22);
  74. LCD_Write_DATA(0x11);
  75. LCD_Write_DATA(0x11);
  76. LCD_Write_DATA(0x22);
  77. LCD_Write_DATA(0x99);
  78. LCD_Write_DATA(0xAA);
  79. LCD_Write_DATA(0xAA);
  80. LCD_Write_DATA(0xAA);
  81. LCD_Write_DATA(0xBB);
  82. LCD_Write_DATA(0xBB);
  83. LCD_Write_DATA(0xAA);
  84. LCD_Write_DATA(0x33);
  85. LCD_Write_DATA(0x33);
  86. LCD_Write_DATA(0x11);
  87. LCD_Write_DATA(0x01);
  88. LCD_Write_DATA(0x01);
  89. LCD_Write_DATA(0x01);
  90. LCD_Write_DATA(0x00);
  91. LCD_Write_DATA(0x00);
  92. LCD_Write_DATA(0x00);
  93. LCD_Write_DATA(0x00);
  94. LCD_Write_DATA(0x00);
  95. LCD_Write_DATA(0x00);
  96. LCD_Write_DATA(0x03);
  97. // ----------- EVRSER Regulator Voltage Setting---------//
  98. LCD_Write_COM(0xBE);
  99. LCD_Write_DATA(0x00);
  100. LCD_Write_DATA(0x15);
  101. LCD_Write_DATA(0x16);
  102. LCD_Write_DATA(0x08);
  103. LCD_Write_DATA(0x09);
  104. LCD_Write_DATA(0x15);
  105. LCD_Write_DATA(0x10);
  106. LCD_Write_DATA(0x00);
  107. LCD_Write_DATA(0x00);
  108. LCD_Write_DATA(0x00);
  109. // -----------Module Definiton Setting---------//
  110. LCD_Write_COM(0xC0);
  111. LCD_Write_DATA(0x0E);
  112. LCD_Write_DATA(0x01);
  113. LCD_Write_DATA(0x00);
  114. LCD_Write_DATA(0x00);
  115. LCD_Write_DATA(0x00);
  116. // -----------PWRDEF Power Ability Ddfinition----------//
  117. LCD_Write_COM(0xC1);
  118. LCD_Write_DATA(0x2F);
  119. LCD_Write_DATA(0x23);
  120. LCD_Write_DATA(0xB4);
  121. LCD_Write_DATA(0xFF);
  122. LCD_Write_DATA(0x24);
  123. LCD_Write_DATA(0x03);
  124. LCD_Write_DATA(0x20);
  125. LCD_Write_DATA(0x02);
  126. LCD_Write_DATA(0x02);
  127. LCD_Write_DATA(0x02);
  128. LCD_Write_DATA(0x20);
  129. LCD_Write_DATA(0x20);
  130. LCD_Write_DATA(0x00);
  131. // -----------Other Setting----------//
  132. LCD_Write_COM(0xC2);
  133. LCD_Write_DATA(0x03);
  134. LCD_Write_COM(0x26);
  135. LCD_Write_DATA(0x08);
  136. LCD_Write_COM(0x35);
  137. LCD_Write_COM(0x36);
  138. LCD_Write_DATA(0x64);
  139. LCD_Write_COM(0x3A);
  140. LCD_Write_DATA(0x05);
  141. LCD_Write_COM(0x2A);
  142. LCD_Write_DATA(0x01,0x3f);
  143. LCD_Write_COM(0x2B);
  144. LCD_Write_DATA(0xEF);
  145. LCD_Write_COM(0x2c);
  146. // -----------RGB Setting----------//
  147. LCD_Write_COM(0x2D);
  148. R=0;
  149. G=0;
  150. B=0;
  151. for(i=0;i<32;i++)
  152. {
  153. LCD_Write_DATA(R);
  154. R=R+2;
  155. }
  156. for(i=0;i<64;i++)
  157. {
  158. LCD_Write_DATA(G);
  159. G=G+1;
  160. }
  161. for(i=0;i<32;i++)
  162. {
  163. LCD_Write_DATA(B);
  164. B=B+2;
  165. }
  166. break;