PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

initlcd.h 2.4KB

3 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. case ST7735:
  2. LCD_Write_COM(0x11);//Sleep exit
  3. delay(12);
  4. //ST7735R Frame Rate
  5. LCD_Write_COM(0xB1);
  6. LCD_Write_DATA(0x01);
  7. LCD_Write_DATA(0x2C);
  8. LCD_Write_DATA(0x2D);
  9. LCD_Write_COM(0xB2);
  10. LCD_Write_DATA(0x01);
  11. LCD_Write_DATA(0x2C);
  12. LCD_Write_DATA(0x2D);
  13. LCD_Write_COM(0xB3);
  14. LCD_Write_DATA(0x01);
  15. LCD_Write_DATA(0x2C);
  16. LCD_Write_DATA(0x2D);
  17. LCD_Write_DATA(0x01);
  18. LCD_Write_DATA(0x2C);
  19. LCD_Write_DATA(0x2D);
  20. LCD_Write_COM(0xB4); //Column inversion
  21. LCD_Write_DATA(0x07);
  22. //ST7735R Power Sequence
  23. LCD_Write_COM(0xC0);
  24. LCD_Write_DATA(0xA2);
  25. LCD_Write_DATA(0x02);
  26. LCD_Write_DATA(0x84);
  27. LCD_Write_COM(0xC1);
  28. LCD_Write_DATA(0xC5);
  29. LCD_Write_COM(0xC2);
  30. LCD_Write_DATA(0x0A);
  31. LCD_Write_DATA(0x00);
  32. LCD_Write_COM(0xC3);
  33. LCD_Write_DATA(0x8A);
  34. LCD_Write_DATA(0x2A);
  35. LCD_Write_COM(0xC4);
  36. LCD_Write_DATA(0x8A);
  37. LCD_Write_DATA(0xEE);
  38. LCD_Write_COM(0xC5); //VCOM
  39. LCD_Write_DATA(0x0E);
  40. LCD_Write_COM(0x36); //MX, MY, RGB mode
  41. LCD_Write_DATA(0xC8);
  42. //ST7735R Gamma Sequence
  43. LCD_Write_COM(0xe0);
  44. LCD_Write_DATA(0x0f);
  45. LCD_Write_DATA(0x1a);
  46. LCD_Write_DATA(0x0f);
  47. LCD_Write_DATA(0x18);
  48. LCD_Write_DATA(0x2f);
  49. LCD_Write_DATA(0x28);
  50. LCD_Write_DATA(0x20);
  51. LCD_Write_DATA(0x22);
  52. LCD_Write_DATA(0x1f);
  53. LCD_Write_DATA(0x1b);
  54. LCD_Write_DATA(0x23);
  55. LCD_Write_DATA(0x37);
  56. LCD_Write_DATA(0x00);
  57. LCD_Write_DATA(0x07);
  58. LCD_Write_DATA(0x02);
  59. LCD_Write_DATA(0x10);
  60. LCD_Write_COM(0xe1);
  61. LCD_Write_DATA(0x0f);
  62. LCD_Write_DATA(0x1b);
  63. LCD_Write_DATA(0x0f);
  64. LCD_Write_DATA(0x17);
  65. LCD_Write_DATA(0x33);
  66. LCD_Write_DATA(0x2c);
  67. LCD_Write_DATA(0x29);
  68. LCD_Write_DATA(0x2e);
  69. LCD_Write_DATA(0x30);
  70. LCD_Write_DATA(0x30);
  71. LCD_Write_DATA(0x39);
  72. LCD_Write_DATA(0x3f);
  73. LCD_Write_DATA(0x00);
  74. LCD_Write_DATA(0x07);
  75. LCD_Write_DATA(0x03);
  76. LCD_Write_DATA(0x10);
  77. LCD_Write_COM(0x2a);
  78. LCD_Write_DATA(0x00);
  79. LCD_Write_DATA(0x00);
  80. LCD_Write_DATA(0x00);
  81. LCD_Write_DATA(0x7f);
  82. LCD_Write_COM(0x2b);
  83. LCD_Write_DATA(0x00);
  84. LCD_Write_DATA(0x00);
  85. LCD_Write_DATA(0x00);
  86. LCD_Write_DATA(0x9f);
  87. LCD_Write_COM(0xF0); //Enable test command
  88. LCD_Write_DATA(0x01);
  89. LCD_Write_COM(0xF6); //Disable ram power save mode
  90. LCD_Write_DATA(0x00);
  91. LCD_Write_COM(0x3A); //65k mode
  92. LCD_Write_DATA(0x05);
  93. LCD_Write_COM(0x29);//Display on
  94. break;