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.5KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. case ILI9320_8:
  2. case ILI9320_16:
  3. LCD_Write_COM_DATA(0xe5, 0x8000);
  4. LCD_Write_COM_DATA(0x00, 0x0001);
  5. LCD_Write_COM_DATA(0x01, 0x0100);
  6. LCD_Write_COM_DATA(0x02, 0x0700);
  7. LCD_Write_COM_DATA(0x03, 0x1030);
  8. LCD_Write_COM_DATA(0x04, 0x0000);
  9. LCD_Write_COM_DATA(0x08, 0x0202);
  10. LCD_Write_COM_DATA(0x09, 0x0000);
  11. LCD_Write_COM_DATA(0x0A, 0x0000);
  12. LCD_Write_COM_DATA(0x0C, 0x0000);
  13. LCD_Write_COM_DATA(0x0D, 0x0000);
  14. LCD_Write_COM_DATA(0x0F, 0x0000);
  15. //-----Power On sequence-----------------------
  16. LCD_Write_COM_DATA(0x10, 0x0000);
  17. LCD_Write_COM_DATA(0x11, 0x0007);
  18. LCD_Write_COM_DATA(0x12, 0x0000);
  19. LCD_Write_COM_DATA(0x13, 0x0000);
  20. delay(50);
  21. LCD_Write_COM_DATA(0x10, 0x17B0);
  22. LCD_Write_COM_DATA(0x11, 0x0007);
  23. delay(10);
  24. LCD_Write_COM_DATA(0x12, 0x013A);
  25. delay(10);
  26. LCD_Write_COM_DATA(0x13, 0x1A00);
  27. LCD_Write_COM_DATA(0x29, 0x000c);
  28. delay(10);
  29. //-----Gamma control-----------------------
  30. LCD_Write_COM_DATA(0x30, 0x0000);
  31. LCD_Write_COM_DATA(0x31, 0x0505);
  32. LCD_Write_COM_DATA(0x32, 0x0004);
  33. LCD_Write_COM_DATA(0x35, 0x0006);
  34. LCD_Write_COM_DATA(0x36, 0x0707);
  35. LCD_Write_COM_DATA(0x37, 0x0105);
  36. LCD_Write_COM_DATA(0x38, 0x0002);
  37. LCD_Write_COM_DATA(0x39, 0x0707);
  38. LCD_Write_COM_DATA(0x3C, 0x0704);
  39. LCD_Write_COM_DATA(0x3D, 0x0807);
  40. //-----Set RAM area-----------------------
  41. LCD_Write_COM_DATA(0x50, 0x0000);
  42. LCD_Write_COM_DATA(0x51, 0x00EF);
  43. LCD_Write_COM_DATA(0x52, 0x0000);
  44. LCD_Write_COM_DATA(0x53, 0x013F);
  45. LCD_Write_COM_DATA(0x60, 0x2700);
  46. LCD_Write_COM_DATA(0x61, 0x0001);
  47. LCD_Write_COM_DATA(0x6A, 0x0000);
  48. LCD_Write_COM_DATA(0x21, 0x0000);
  49. LCD_Write_COM_DATA(0x20, 0x0000);
  50. //-----Partial Display Control------------
  51. LCD_Write_COM_DATA(0x80, 0x0000);
  52. LCD_Write_COM_DATA(0x81, 0x0000);
  53. LCD_Write_COM_DATA(0x82, 0x0000);
  54. LCD_Write_COM_DATA(0x83, 0x0000);
  55. LCD_Write_COM_DATA(0x84, 0x0000);
  56. LCD_Write_COM_DATA(0x85, 0x0000);
  57. //-----Panel Control----------------------
  58. LCD_Write_COM_DATA(0x90, 0x0010);
  59. LCD_Write_COM_DATA(0x92, 0x0000);
  60. LCD_Write_COM_DATA(0x93, 0x0003);
  61. LCD_Write_COM_DATA(0x95, 0x0110);
  62. LCD_Write_COM_DATA(0x97, 0x0000);
  63. LCD_Write_COM_DATA(0x98, 0x0000);
  64. //-----Display on-----------------------
  65. LCD_Write_COM_DATA(0x07, 0x0173);
  66. delay(50);
  67. break;