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

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. case SSD1963_800ALT:
  2. LCD_Write_COM(0xE2); //PLL multiplier, set PLL clock to 120M
  3. LCD_Write_DATA(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
  4. LCD_Write_DATA(0x02);
  5. LCD_Write_DATA(0x04);
  6. LCD_Write_COM(0xE0); // PLL enable
  7. LCD_Write_DATA(0x01);
  8. delay(10);
  9. LCD_Write_COM(0xE0);
  10. LCD_Write_DATA(0x03);
  11. delay(10);
  12. LCD_Write_COM(0x01); // software reset
  13. delay(100);
  14. LCD_Write_COM(0xE6); //PLL setting for PCLK, depends on resolution
  15. LCD_Write_DATA(0x04);
  16. LCD_Write_DATA(0x93);
  17. LCD_Write_DATA(0xE0);
  18. LCD_Write_COM(0xB0); //LCD SPECIFICATION
  19. LCD_Write_DATA(0x00); // 0x24
  20. LCD_Write_DATA(0x00);
  21. LCD_Write_DATA(0x03); //Set HDP 799
  22. LCD_Write_DATA(0x1F);
  23. LCD_Write_DATA(0x01); //Set VDP 479
  24. LCD_Write_DATA(0xDF);
  25. LCD_Write_DATA(0x00);
  26. LCD_Write_COM(0xB4); //HSYNC
  27. LCD_Write_DATA(0x03); //Set HT 928
  28. LCD_Write_DATA(0xA0);
  29. LCD_Write_DATA(0x00); //Set HPS 46
  30. LCD_Write_DATA(0x2E);
  31. LCD_Write_DATA(0x30); //Set HPW 48
  32. LCD_Write_DATA(0x00); //Set LPS 15
  33. LCD_Write_DATA(0x0F);
  34. LCD_Write_DATA(0x00);
  35. LCD_Write_COM(0xB6); //VSYNC
  36. LCD_Write_DATA(0x02); //Set VT 525
  37. LCD_Write_DATA(0x0D);
  38. LCD_Write_DATA(0x00); //Set VPS 16
  39. LCD_Write_DATA(0x10);
  40. LCD_Write_DATA(0x10); //Set VPW 16
  41. LCD_Write_DATA(0x00); //Set FPS 8
  42. LCD_Write_DATA(0x08);
  43. LCD_Write_COM(0xBA);
  44. LCD_Write_DATA(0x05); //GPIO[3:0] out 1
  45. LCD_Write_COM(0xB8);
  46. LCD_Write_DATA(0x07); //GPIO3=input, GPIO[2:0]=output
  47. LCD_Write_DATA(0x01); //GPIO0 normal
  48. LCD_Write_COM(0x36); //rotation
  49. LCD_Write_DATA(0x22); // -- Set to 0x21 to rotate 180 degrees
  50. LCD_Write_COM(0xF0); //pixel data interface
  51. LCD_Write_DATA(0x03);
  52. delay(10);
  53. setXY(0, 0, 799, 479);
  54. LCD_Write_COM(0x29); //display on
  55. LCD_Write_COM(0xBE); //set PWM for B/L
  56. LCD_Write_DATA(0x06);
  57. LCD_Write_DATA(0xF0);
  58. LCD_Write_DATA(0x01);
  59. LCD_Write_DATA(0xF0);
  60. LCD_Write_DATA(0x00);
  61. LCD_Write_DATA(0x00);
  62. LCD_Write_COM(0xD0);
  63. LCD_Write_DATA(0x0D);
  64. LCD_Write_COM(0x2C);
  65. break;