qp_st7789_opcodes.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright 2021 Paul Cotter (@gr1mr3aver)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. // Quantum Painter ST7789 additional command opcodes
  6. // System function commands
  7. #define ST7789_GET_SELF_DIAG 0x0F // Get self-diagnostic result
  8. #define ST7789_SET_VERT_SCRL 0x33 // Set vertical scroll definition
  9. #define ST7789_SET_VERT_SCRL_ADDR 0x37 // SEt Vertical scroll start address
  10. #define ST7789_SET_MEM_CONT 0x3C // Memory Write continue
  11. #define ST7789_GET_MEM_CONT 0x3E // Memory Read continue
  12. #define ST7789_SET_TEAR_LINE 0x44 // Set tear scanline
  13. #define ST7789_GET_TEAR_LINE 0x45 // Get tear scanline
  14. #define ST7789_SET_BRIGHTNESS 0x51 // Set display brightness
  15. #define ST7789_GET_BRIGHTNESS 0x52 // Get display brightness
  16. #define ST7789_SET_CTRL 0x53 // Set CTRL display
  17. #define ST7789_GET_CTRL 0x54 // Get CTRL display value
  18. #define ST7789_SET_CAB_COLOR 0x55 // Set content adaptive brightness control and color enhancement
  19. #define ST7789_GET_CAB_COLOR 0x56 // Get content adaptive brightness control and color enhancement
  20. #define ST7789_SET_CAB_BRIGHTNESS 0x5E // Set content adaptive minimum brightness
  21. #define ST7789_GET_CAB_BRIGHTNESS 0x5F // Get content adaptive minimum brightness
  22. #define ST7789_GET_ABC_SELF_DIAG 0x68 // Get Auto brightness control self diagnostics
  23. // Panel Function Commands
  24. #define ST7789_SET_RAM_CTL 0xB0 // Set RAM control
  25. #define ST7789_SET_RGB_CTL 0xB1 // Set RGB control
  26. #define ST7789_SET_PORCH_CTL 0xB2 // Set Porch control
  27. #define ST7789_SET_FRAME_RATE_CTL_1 0xB3 // Set frame rate control 1
  28. #define ST7789_SET_PARTIAL_CTL 0xB5 // Set Partial control
  29. #define ST7789_SET_GATE_CTL 0xB7 // Set gate control
  30. #define ST7789_SET_GATE_ON_TIMING 0xB8 // Set gate on timing adjustment
  31. #define ST7789_SET_DIGITAL_GAMMA_ON 0xBA // Enable digital gamma
  32. #define ST7789_SET_VCOM 0xBB // Set VCOM
  33. #define ST7789_SET_POWER_SAVE 0xBC // Set power saving mode
  34. #define ST7789_SET_DISP_OFF_POWER 0xBD // Set display off power saving
  35. #define ST7789_SET_LCM_CTL 0xC0 // Set LCM control
  36. #define ST7789_SET_IDS 0xC1 // Set IDs
  37. #define ST7789_SET_VDV_VRH_ON 0xC2 // Set VDV and VRH command enable
  38. #define ST7789_SET_VRH 0xC3 // Set VRH
  39. #define ST7789_SET_VDV 0xC4 // Set VDV
  40. #define ST7789_SET_VCOM_OFFSET 0xC5 // Set VCOM offset ctl
  41. #define ST7789_SET_FRAME_RATE_CTL_2 0xC6 // Set frame rate control 2
  42. #define ST7789_SET_CABC_CTL 0xC7 // Set CABC Control
  43. #define ST7789_GET_REG_1 0xC8 // Get register value selection1
  44. #define ST7789_GET_REG_2 0xCA // Get register value selection2
  45. #define ST7789_SET_PWM_FREQ 0xCC // Set PWM frequency
  46. #define ST7789_SET_POWER_CTL_1 0xD0 // Set power ctl 1
  47. #define ST7789_SET_VAP_VAN_ON 0xD2 // Enable VAP/VAN signal output
  48. #define ST7789_SET_CMD2_ENABLE 0xDF // Enable command 2
  49. #define ST7789_SET_PGAMMA 0xE0 // Set positive gamma
  50. #define ST7789_SET_NGAMMA 0xE1 // Set negative gamma
  51. #define ST7789_SET_DIGITAL_GAMMA_RED 0xE2 // Set digital gamma lookup table for red
  52. #define ST7789_SET_DIGITAL_GAMMA_BLUE 0xE3 // Get digital gamma lookup table for blue
  53. #define ST7789_SET_GATE_CTL_2 0xE4 // Set gate control 2
  54. #define ST7789_SET_SPI2_ENABLE 0xE7 // Enable SPI2
  55. #define ST7789_SET_POWER_CTL_2 0xE8 // Set power ctl 2
  56. #define ST7789_SET_EQ_TIME_CTL 0xE9 // Set equalize time control
  57. #define ST7789_SET_PROG_CTL 0xEC // Set program control
  58. #define ST7789_SET_PROG_MODE_ENABLE 0xFA // Set program mode enable
  59. #define ST7789_SET_NVMEM 0xFC // Set NVMEM data
  60. #define ST7789_SET_PROG_ACTION 0xFE // Set program action