ili9341.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-11 RT-Thread the first version
  9. */
  10. #ifndef __ILI9341_H
  11. #define __ILI9341_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /**
  16. * @brief ILI9341 chip IDs
  17. */
  18. #define ILI9341_ID 0x9341
  19. /**
  20. * @brief ILI9341 Registers
  21. */
  22. /* Level 1 Commands */
  23. #define LCD_SWRESET 0x01 /* Software Reset */
  24. #define LCD_READ_DISPLAY_ID 0x04 /* Read display identification information */
  25. #define LCD_RDDST 0x09 /* Read Display Status */
  26. #define LCD_RDDPM 0x0A /* Read Display Power Mode */
  27. #define LCD_RDDMADCTL 0x0B /* Read Display MADCTL */
  28. #define LCD_RDDCOLMOD 0x0C /* Read Display Pixel Format */
  29. #define LCD_RDDIM 0x0D /* Read Display Image Format */
  30. #define LCD_RDDSM 0x0E /* Read Display Signal Mode */
  31. #define LCD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */
  32. #define LCD_SPLIN 0x10 /* Enter Sleep Mode */
  33. #define LCD_SLEEP_OUT 0x11 /* Sleep out register */
  34. #define LCD_PTLON 0x12 /* Partial Mode ON */
  35. #define LCD_NORMAL_MODE_ON 0x13 /* Normal Display Mode ON */
  36. #define LCD_DINVOFF 0x20 /* Display Inversion OFF */
  37. #define LCD_DINVON 0x21 /* Display Inversion ON */
  38. #define LCD_GAMMA 0x26 /* Gamma register */
  39. #define LCD_DISPLAY_OFF 0x28 /* Display off register */
  40. #define LCD_DISPLAY_ON 0x29 /* Display on register */
  41. #define LCD_COLUMN_ADDR 0x2A /* Colomn address register */
  42. #define LCD_PAGE_ADDR 0x2B /* Page address register */
  43. #define LCD_GRAM 0x2C /* GRAM register */
  44. #define LCD_RGBSET 0x2D /* Color SET */
  45. #define LCD_RAMRD 0x2E /* Memory Read */
  46. #define LCD_PLTAR 0x30 /* Partial Area */
  47. #define LCD_VSCRDEF 0x33 /* Vertical Scrolling Definition */
  48. #define LCD_TEOFF 0x34 /* Tearing Effect Line OFF */
  49. #define LCD_TEON 0x35 /* Tearing Effect Line ON */
  50. #define LCD_MAC 0x36 /* Memory Access Control register*/
  51. #define LCD_VSCRSADD 0x37 /* Vertical Scrolling Start Address */
  52. #define LCD_IDMOFF 0x38 /* Idle Mode OFF */
  53. #define LCD_IDMON 0x39 /* Idle Mode ON */
  54. #define LCD_PIXEL_FORMAT 0x3A /* Pixel Format register */
  55. #define LCD_WRITE_MEM_CONTINUE 0x3C /* Write Memory Continue */
  56. #define LCD_READ_MEM_CONTINUE 0x3E /* Read Memory Continue */
  57. #define LCD_SET_TEAR_SCANLINE 0x44 /* Set Tear Scanline */
  58. #define LCD_GET_SCANLINE 0x45 /* Get Scanline */
  59. #define LCD_WDB 0x51 /* Write Brightness Display register */
  60. #define LCD_RDDISBV 0x52 /* Read Display Brightness */
  61. #define LCD_WCD 0x53 /* Write Control Display register*/
  62. #define LCD_RDCTRLD 0x54 /* Read CTRL Display */
  63. #define LCD_WRCABC 0x55 /* Write Content Adaptive Brightness Control */
  64. #define LCD_RDCABC 0x56 /* Read Content Adaptive Brightness Control */
  65. #define LCD_WRITE_CABC 0x5E /* Write CABC Minimum Brightness */
  66. #define LCD_READ_CABC 0x5F /* Read CABC Minimum Brightness */
  67. #define LCD_READ_ID1 0xDA /* Read ID1 */
  68. #define LCD_READ_ID2 0xDB /* Read ID2 */
  69. #define LCD_READ_ID3 0xDC /* Read ID3 */
  70. /* Level 2 Commands */
  71. #define LCD_RGB_INTERFACE 0xB0 /* RGB Interface Signal Control */
  72. #define LCD_FRMCTR1 0xB1 /* Frame Rate Control (In Normal Mode) */
  73. #define LCD_FRMCTR2 0xB2 /* Frame Rate Control (In Idle Mode) */
  74. #define LCD_FRMCTR3 0xB3 /* Frame Rate Control (In Partial Mode) */
  75. #define LCD_INVTR 0xB4 /* Display Inversion Control */
  76. #define LCD_BPC 0xB5 /* Blanking Porch Control register */
  77. #define LCD_DFC 0xB6 /* Display Function Control register */
  78. #define LCD_ETMOD 0xB7 /* Entry Mode Set */
  79. #define LCD_BACKLIGHT1 0xB8 /* Backlight Control 1 */
  80. #define LCD_BACKLIGHT2 0xB9 /* Backlight Control 2 */
  81. #define LCD_BACKLIGHT3 0xBA /* Backlight Control 3 */
  82. #define LCD_BACKLIGHT4 0xBB /* Backlight Control 4 */
  83. #define LCD_BACKLIGHT5 0xBC /* Backlight Control 5 */
  84. #define LCD_BACKLIGHT7 0xBE /* Backlight Control 7 */
  85. #define LCD_BACKLIGHT8 0xBF /* Backlight Control 8 */
  86. #define LCD_POWER1 0xC0 /* Power Control 1 register */
  87. #define LCD_POWER2 0xC1 /* Power Control 2 register */
  88. #define LCD_VCOM1 0xC5 /* VCOM Control 1 register */
  89. #define LCD_VCOM2 0xC7 /* VCOM Control 2 register */
  90. #define LCD_NVMWR 0xD0 /* NV Memory Write */
  91. #define LCD_NVMPKEY 0xD1 /* NV Memory Protection Key */
  92. #define LCD_RDNVM 0xD2 /* NV Memory Status Read */
  93. #define LCD_READ_ID4 0xD3 /* Read ID4 */
  94. #define LCD_PGAMMA 0xE0 /* Positive Gamma Correction register */
  95. #define LCD_NGAMMA 0xE1 /* Negative Gamma Correction register */
  96. #define LCD_DGAMCTRL1 0xE2 /* Digital Gamma Control 1 */
  97. #define LCD_DGAMCTRL2 0xE3 /* Digital Gamma Control 2 */
  98. #define LCD_INTERFACE 0xF6 /* Interface control register */
  99. /* Extend register commands */
  100. #define LCD_POWERA 0xCB /* Power control A register */
  101. #define LCD_POWERB 0xCF /* Power control B register */
  102. #define LCD_DTCA 0xE8 /* Driver timing control A */
  103. #define LCD_DTCB 0xEA /* Driver timing control B */
  104. #define LCD_POWER_SEQ 0xED /* Power on sequence register */
  105. #define LCD_3GAMMA_EN 0xF2 /* 3 Gamma enable register */
  106. #define LCD_PRC 0xF7 /* Pump ratio control register */
  107. /* Size of read registers */
  108. #define LCD_READ_ID4_SIZE 3 /* Size of Read ID4 */
  109. /** @defgroup ILI9341_Exported_Functions
  110. * @{
  111. */
  112. int ili9341_hw_init(void);
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116. #endif /* __ILI9341_H */