panel_icna3311.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef PANEL_ICNA3311_DRIVER_H__
  7. #define PANEL_ICNA3311_DRIVER_H__
  8. #define DDIC_CMD_NOP 0x00 /* No Operation */
  9. #define DDIC_CMD_SWRESET 0x01 /* Software Reset */
  10. #define DDIC_CMD_RDDID 0x04 /* Read Display ID */
  11. #define DDIC_CMD_RDNUMED 0x05 /* Read Number of Errors on DSI */
  12. #define DDIC_CMD_RDDPM 0x0A /* Read Display Power Mode */
  13. #define DDIC_CMD_RDDMADCTR 0x0B /* Read Display MADCTR */
  14. #define DDIC_CMD_RDDCOLMOD 0x0C /* Read Display Pixel Format */
  15. #define DDIC_CMD_RDDIM 0x0D /* Read Display Image Mode */
  16. #define DDIC_CMD_RDDSM 0x0E /* Read Display Signal Mode */
  17. #define DDIC_CMD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */
  18. #define DDIC_CMD_SLPIN 0x10 /* Sleep In */
  19. #define DDIC_CMD_SLPOUT 0x11 /* Sleep Out */
  20. #define DDIC_CMD_PARON 0x12 /* Partial Display Mode On */
  21. #define DDIC_CMD_NORON 0x13 /* Normal Display Mode On */
  22. #define DDIC_CMD_INVOFF 0x20 /* Display Inversion Off */
  23. #define DDIC_CMD_INVON 0x21 /* Display Inversion On */
  24. #define DDIC_CMD_ALLPOFF 0x22 /* All Pixel Off */
  25. #define DDIC_CMD_ALLPON 0x23 /* All Pixel On */
  26. #define DDIC_CMD_DISPOFF 0x28 /* Display Off */
  27. #define DDIC_CMD_DISPON 0x29 /* Display On */
  28. #define DDIC_CMD_CASET 0x2A /* Column Start Address Set */
  29. #define DDIC_CMD_RASET 0x2B /* Row Start Address Set */
  30. #define DDIC_CMD_RAMWR 0x2C /* Memory Write Start */
  31. #define DDIC_CMD_RAMRD 0x2E /* Memory Read Start */
  32. #define DDIC_CMD_PTLAR 0x30 /* Vertical Partial Area Set */
  33. #define DDIC_CMD_PTLAR_H 0x31 /* Horizontal Partial Area Set */
  34. #define DDIC_CMD_TEOFF 0x34 /* Tearing Effect Line OFF */
  35. #define DDIC_CMD_TEON 0x35 /* Tearing Effect Line ON */
  36. #define DDIC_CMD_MADCTL 0x36 /* Memory Data Access Control */
  37. #define DDIC_CMD_IDMOFF 0x38 /* Idle Mode Off */
  38. #define DDIC_CMD_IDMON 0x39 /* Idle Mode On */
  39. #define DDIC_CMD_COLMOD 0x3A /* Control Interface Pixel Format */
  40. #define DDIC_CMD_RAMWRC 0x3C /* Memory Write Continue */
  41. #define DDIC_CMD_RAMRDC 0x3E /* Memory Read Continue */
  42. #define DDIC_CMD_STESL 0x44 /* Set Tearing Effect Scan Line */
  43. #define DDIC_CMD_GSL 0x45 /* Get Scan Line */
  44. #define DDIC_CMD_DSTBON 0x4F /* Deep Standby Mode On */
  45. #define DDIC_CMD_WRDISBV 0x51 /* Write Display Brightness Value */
  46. #define DDIC_CMD_RDDISBV 0x52 /* Read Display Brightness Value */
  47. #define DDIC_CMD_WRCTRLD 0x53 /* Write CTRL Display */
  48. #define DDIC_CMD_RDCTRLD 0x54 /* Read CTRL Display */
  49. #define DDIC_CMD_WRACL 0x55 /* Write ACL Control */
  50. #define DDIC_CMD_RDACL 0x56 /* Read ACL Control */
  51. #define DDIC_CMD_WRIMGEHCCTR 0x58 /* Write Color Enhance Control */
  52. #define DDIC_CMD_RDIMGEHCCTR 0x59 /* Read Color Enhance Control */
  53. #define DDIC_CMD_WRHBMDISBV 0x63 /* Write HBM Display Brightness Value */
  54. #define DDIC_CMD_RDHBMDISBV 0x64 /* Read HBM Display Brightness Value */
  55. #define DDIC_CMD_HBMCTL 0x66 /* Set HBM Mode */
  56. #define DDIC_CMD_COLSET0 0x70 /* Interface Pixel Format Set */
  57. #define DDIC_CMD_COLSET1 0x71 /* Interface Pixel Format Set */
  58. #define DDIC_CMD_COLSET2 0x72 /* Interface Pixel Format Set */
  59. #define DDIC_CMD_COLSET3 0x73 /* Interface Pixel Format Set */
  60. #define DDIC_CMD_COLSET4 0x74 /* Interface Pixel Format Set */
  61. #define DDIC_CMD_COLSET5 0x75 /* Interface Pixel Format Set */
  62. #define DDIC_CMD_COLSET6 0x76 /* Interface Pixel Format Set */
  63. #define DDIC_CMD_COLSET7 0x77 /* Interface Pixel Format Set */
  64. #define DDIC_CMD_COLSET8 0x78 /* Interface Pixel Format Set */
  65. #define DDIC_CMD_COLSET9 0x79 /* Interface Pixel Format Set */
  66. #define DDIC_CMD_COLSET10 0x7A /* Interface Pixel Format Set */
  67. #define DDIC_CMD_COLSET11 0x7B /* Interface Pixel Format Set */
  68. #define DDIC_CMD_COLSET12 0x7C /* Interface Pixel Format Set */
  69. #define DDIC_CMD_COLSET13 0x7D /* Interface Pixel Format Set */
  70. #define DDIC_CMD_COLSET14 0x7E /* Interface Pixel Format Set */
  71. #define DDIC_CMD_COLSET15 0x7F /* Interface Pixel Format Set */
  72. #define DDIC_CMD_COLOPT 0x80 /* Interface Pixel Format Option */
  73. #define DDIC_CMD_RDDDBS 0xA1 /* Read DDB Start */
  74. #define DDIC_CMD_RDDDBC 0xA8 /* Read DDB Continue */
  75. #define DDIC_CMD_RDFCS 0xAA /* Read First Checksum */
  76. #define DDIC_CMD_RDCCS 0xAF /* Read Continue Checksum */
  77. #define DDIC_CMD_SETDISPMODE 0xC2 /* Set Display Mode */
  78. #define DDIC_CMD_SETDSPIMODE 0xC4 /* Set Dual SPI Mode */
  79. #define DDIC_CMD_RDID1 0xDA /* Read ID1 */
  80. #define DDIC_CMD_RDID2 0xDB /* Read ID2 */
  81. #define DDIC_CMD_RDID3 0xDC /* Read ID3 */
  82. #define DDIC_CMD_MSC 0xFE /* Manufacture CMD Set Control */
  83. #define DDIC_QSPI_CMD_RD(cmd) ((0x03 << 24) | ((uint32_t)(cmd) << 8))
  84. #define DDIC_QSPI_CMD_WR(cmd) ((0x02 << 24) | ((uint32_t)(cmd) << 8))
  85. #define DDIC_QSPI_CMD_RAMWR(cmd) ((0x32 << 24) | ((uint32_t)(cmd) << 8))
  86. #if 1
  87. #define DDIC_CMD_DELAY 0xFF
  88. typedef struct panel_regcfg {
  89. uint8_t cmd; /* (write) command */
  90. uint8_t len; /* parameter length or delay milliseconds */
  91. uint8_t buf[4]; /* parameter list */
  92. } panel_regcfg_t;
  93. //static inline void panel_apply_config(
  94. // const struct device *lcdc_dev, panel_regcfg_t *cfg, int num)
  95. //{
  96. // for (; num > 0; num--, cfg++) {
  97. // if (cfg->cmd == DDIC_CMD_DELAY) {
  98. // k_msleep(cfg->len);
  99. // } else {
  100. // display_controller_write_config(lcdc_dev,
  101. // DDIC_QSPI_CMD_WR(cfg->cmd), cfg->dat, cfg->len);
  102. // }
  103. // }
  104. //}
  105. #endif
  106. #endif /* PANEL_ICNA3311_DRIVER_H__ */