panel_st77903.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef PANEL_ST77903_DRIVER_H__
  7. #define PANEL_ST77903_DRIVER_H__
  8. /* Command Table 1 */
  9. #define DDIC_CMD_NOP 0x00
  10. #define DDIC_CMD_SWRESET 0x01 /* Software Reset */
  11. #define DDIC_CMD_RDDID 0x04 /* Read Display ID */
  12. #define DDIC_CMD_RDDST 0x09 /* Read Display Status */
  13. #define DDIC_CMD_RDDPM 0x0A /* Read Display Power Mode */
  14. #define DDIC_CMD_RDDMADCTL 0x0B /* Read Display MADCTL */
  15. #define DDIC_CMD_RDDCOLMOD 0x0C /* Read Display Pixel Format */
  16. #define DDIC_CMD_RDDIM 0x0D /* Read Display Image Mode */
  17. #define DDIC_CMD_RDDSM 0x0E /* Read Display Signal Mode */
  18. #define DDIC_CMD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */
  19. #define DDIC_CMD_SLPIN 0x10 /* Sleep In */
  20. #define DDIC_CMD_SLPOUT 0x11 /* Sleep Out */
  21. #define DDIC_CMD_INVOFF 0x20 /* Display Inversion Off */
  22. #define DDIC_CMD_INVON 0x21 /* Display Inversion On */
  23. #define DDIC_CMD_DISPOFF 0x28 /* Display Off */
  24. #define DDIC_CMD_DISPON 0x29 /* Display On */
  25. #define DDIC_CMD_RAMWR 0x2C /* Memory Write */
  26. #define DDIC_CMD_TEOFF 0x34 /* Tearing Effect Line OFF */
  27. #define DDIC_CMD_TEON 0x35 /* Tearing Effect Line ON */
  28. #define DDIC_CMD_MADCTL 0x36 /* Memory Data Access Control */
  29. #define DDIC_CMD_IDMOFF 0x38 /* Idle Mode Off */
  30. #define DDIC_CMD_IDMON 0x39 /* Idle Mode On */
  31. #define DDIC_CMD_COLMOD 0x3A /* Interface Pixel Format */
  32. #define DDIC_CMD_WRMEMC 0x3C /* Memory Continuous Write */
  33. #define DDIC_CMD_STE 0x44 /* Set Tear Scanline */
  34. #define DDIC_CMD_TESLRD 0x45 /* Read Scanline */
  35. #define DDIC_CMD_HS 0x60 /* Horizontal SYNC Command */
  36. #define DDIC_CMD_VS 0x61 /* Vertical SYNC Command */
  37. #define DDIC_CMD_WRIDMC 0x90 /* Write two-color idle Mode color */
  38. #define DDIC_CMD_RDIDMC 0x91 /* Read two-color idle Mode color */
  39. #define DDIC_CMD_RDFCS 0xAA /* Read First Checksum */
  40. #define DDIC_CMD_RDCFCS 0xAF /* Read Continue Checksum */
  41. #define DDIC_CMD_RDID1 0xDA /* Read ID1 */
  42. #define DDIC_CMD_RDID2 0xDB /* Read ID2 */
  43. #define DDIC_CMD_RDID3 0xDC /* Read ID3 */
  44. /* Command Table 2 */
  45. #define DDIC_CMD_CK 0xF0 /* Command Key */
  46. #define DDIC_CMD_ECFC 0xB0 /* Entry Code Function Control */
  47. #define DDIC_CMD_FRC1 0xB1 /* Frame Rate Control 1 */
  48. #define DDIC_CMD_GSC 0xB2 /* Gate Scan Control */
  49. #define DDIC_CMD_VDMDC 0xB3 /* Video Mode Display Control */
  50. #define DDIC_CMD_TCMDC 0xB4 /* Two color Mode Display Control */
  51. #define DDIC_CMD_BPC 0xB5 /* Blank Porch Control */
  52. #define DDIC_CMD_DISCN 0xB6 /* Display Function Control */
  53. #define DDIC_CMD_EMSET 0xB7 /* Entry Mode Set */
  54. #define DDIC_CMD_PWR 0xC0 /* Power Control */
  55. #define DDIC_CMD_PWR1 0xC1 /* Power Control 1 */
  56. #define DDIC_CMD_PWR2 0xC2 /* Power Control 2 */
  57. #define DDIC_CMD_PWR3 0xC3 /* Power Control 3 */
  58. #define DDIC_CMD_VCOMCTL 0xC5 /* Vcom Control */
  59. #define DDIC_CMD_VMF1OFS 0xD6 /* Vcom Offset 1 */
  60. #define DDIC_CMD_VMF2OFS 0xD7 /* Vcom Offset 2 */
  61. #define DDIC_CMD_PGC 0xE0 /* Positive Gamma Control */
  62. #define DDIC_CMD_NGC 0xE1 /* Negative Gamma Control */
  63. #define DDIC_CMD_ANAMODE 0xE5 /* Analog System Control */
  64. #define DDIC_CMD_DTRCON 0xD9 /* Dithering Control */
  65. #define DDIC_CMD_SRECON 0xDE /* SRE Control */
  66. #define DDIC_CMD_RLCMODE 0xC8 /* Run-length Control */
  67. #define DDIC_CMD_RGBIF 0xA0 /* RGB Interface Control */
  68. #define ST77903_RD_CMD(cmd) ((0xDD << 24) | ((uint32_t)(cmd) << 8))
  69. #define ST77903_WR_CMD(cmd) ((0xDE << 24) | ((uint32_t)(cmd) << 8))
  70. #endif /* PANEL_ST77903_DRIVER_H__ */