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.

116 lines
2.5 KiB

9 months ago
  1. // This is the command sequence that initialises the HX8357C driver
  2. //
  3. // This setup information uses simple 8 bit SPI writecommand() and writedata() functions
  4. //
  5. // See ST7735_Setup.h file for an alternative format
  6. // Configure HX8357C display
  7. writecommand(0xB9); // Enable extension command
  8. writedata(0xFF);
  9. writedata(0x83);
  10. writedata(0x57);
  11. delay(50);
  12. writecommand(0xB6); //Set VCOM voltage
  13. writedata(0x2C); //0x52 for HSD 3.0"
  14. writecommand(0x11); // Sleep off
  15. delay(200);
  16. writecommand(0x35); // Tearing effect on
  17. writedata(0x00); // Added parameter
  18. writecommand(0x3A); // Interface pixel format
  19. writedata(0x55); // 16 bits per pixel
  20. //writecommand(0xCC); // Set panel characteristic
  21. //writedata(0x09); // S960>S1, G1>G480, R-G-B, normally black
  22. //writecommand(0xB3); // RGB interface
  23. //writedata(0x43);
  24. //writedata(0x00);
  25. //writedata(0x06);
  26. //writedata(0x06);
  27. writecommand(0xB1); // Power control
  28. writedata(0x00);
  29. writedata(0x15);
  30. writedata(0x0D);
  31. writedata(0x0D);
  32. writedata(0x83);
  33. writedata(0x48);
  34. writecommand(0xC0); // Does this do anything?
  35. writedata(0x24);
  36. writedata(0x24);
  37. writedata(0x01);
  38. writedata(0x3C);
  39. writedata(0xC8);
  40. writedata(0x08);
  41. writecommand(0xB4); // Display cycle
  42. writedata(0x02);
  43. writedata(0x40);
  44. writedata(0x00);
  45. writedata(0x2A);
  46. writedata(0x2A);
  47. writedata(0x0D);
  48. writedata(0x4F);
  49. writecommand(0xE0); // Gamma curve
  50. writedata(0x00);
  51. writedata(0x15);
  52. writedata(0x1D);
  53. writedata(0x2A);
  54. writedata(0x31);
  55. writedata(0x42);
  56. writedata(0x4C);
  57. writedata(0x53);
  58. writedata(0x45);
  59. writedata(0x40);
  60. writedata(0x3B);
  61. writedata(0x32);
  62. writedata(0x2E);
  63. writedata(0x28);
  64. writedata(0x24);
  65. writedata(0x03);
  66. writedata(0x00);
  67. writedata(0x15);
  68. writedata(0x1D);
  69. writedata(0x2A);
  70. writedata(0x31);
  71. writedata(0x42);
  72. writedata(0x4C);
  73. writedata(0x53);
  74. writedata(0x45);
  75. writedata(0x40);
  76. writedata(0x3B);
  77. writedata(0x32);
  78. writedata(0x2E);
  79. writedata(0x28);
  80. writedata(0x24);
  81. writedata(0x03);
  82. writedata(0x00);
  83. writedata(0x01);
  84. writecommand(0x36); // MADCTL Memory access control
  85. writedata(0x48);
  86. delay(20);
  87. writecommand(0x21); //Display inversion on
  88. delay(20);
  89. writecommand(0x29); // Display on
  90. delay(120);
  91. // End of HX8357C display configuration