logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

qp_gc9xxx_opcodes.h (3236B)


  1. // Copyright 2021 Paul Cotter (@gr1mr3aver)
  2. // Copyright 2024 Fernando Birra
  3. // SPDX-License-Identifier: GPL-2.0-or-later
  4. #pragma once
  5. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  6. // Quantum Painter GC9xxx command opcodes
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. #define GC9XXX_GET_ID_INFO 0x04 // Get ID information
  9. #define GC9XXX_GET_STATUS 0x09 // Get status
  10. #define GC9XXX_CMD_SLEEP_ON 0x10 // Enter sleep mode
  11. #define GC9XXX_CMD_SLEEP_OFF 0x11 // Exit sleep mode
  12. #define GC9XXX_CMD_PARTIAL_ON 0x12 // Enter partial mode
  13. #define GC9XXX_CMD_PARTIAL_OFF 0x13 // Exit partial mode
  14. #define GC9XXX_CMD_INVERT_OFF 0x20 // Exit inverted mode
  15. #define GC9XXX_CMD_INVERT_ON 0x21 // Enter inverted mode
  16. #define GC9XXX_CMD_DISPLAY_OFF 0x28 // Disable display
  17. #define GC9XXX_CMD_DISPLAY_ON 0x29 // Enable display
  18. #define GC9XXX_SET_COL_ADDR 0x2A // Set column address (MSB(StartCol),LSB(StartCol),MSB(EndCol),LSB(EndCol)
  19. #define GC9XXX_SET_ROW_ADDR 0x2B // Set row address (MSB(StartRow),LSB(StartRow),MSB(EndRow),LSB(EndRow)
  20. #define GC9XXX_SET_MEM 0x2C // Set (write) memory
  21. #define GC9XXX_SET_PARTIAL_AREA 0x30 // Set partial area (MSB(StartRow),LSB(StartRow),MSB(EndRow),LSB(EndRow)
  22. #define GC9XXX_SET_VSCROLL 0x33 // Set vertical scroll MSB(TFA),LSB(TFA),MSB(VSA),LSB(VSA)+ GC9107 extra param: MSB(BFA),LSB(BFA)
  23. #define GC9XXX_CMD_TEARING_OFF 0x34 // Tearing effect line OFF
  24. #define GC9XXX_CMD_TEARING_ON 0x35 // Tearing effect line ON
  25. #define GC9XXX_SET_MEM_ACS_CTL 0x36 // Set mem access ctl
  26. #define GC9XXX_SET_VSCROLL_ADDR 0x37 // Set vscroll start addr
  27. #define GC9XXX_CMD_IDLE_OFF 0x38 // Exit idle mode
  28. #define GC9XXX_CMD_IDLE_ON 0x39 // Enter idle mode
  29. #define GC9XXX_SET_PIXEL_FORMAT 0x3A // Set pixel format
  30. #define GC9XXX_SET_TEAR_SCANLINE 0x44 // Set tearing scanline (Scanline = LS bit of Param 1 (GC9A01) + Param 2(GC9XXX))
  31. #define GC9XXX_GET_TEAR_SCANLINE 0x45 // Get tearing scanline (Scanline = LS bit of Param 1 (GC9A01) + Param 2(GC9XXX))
  32. #define GC9XXX_GET_ID1 0xDA // Get ID1
  33. #define GC9XXX_GET_ID2 0xDB // Get ID2
  34. #define GC9XXX_GET_ID3 0xDC // Get ID3
  35. #define GC9XXX_SET_INTER_REG_ENABLE1 0xFE // Enable Inter Register 1
  36. #define GC9XXX_SET_INTER_REG_ENABLE2 0xEF // Enable Inter Register 2
  37. #define GC9XXX_SET_GAMMA1 0xF0 // Set gamma 1
  38. #define GC9XXX_SET_GAMMA2 0xF1 // Set gamma 2
  39. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  40. // MADCTL Flags
  41. #define GC9XXX_MADCTL_MY 0b10000000 // Mirror Y (row address order)
  42. #define GC9XXX_MADCTL_MX 0b01000000 // Mirror X (column address order)
  43. #define GC9XXX_MADCTL_MV 0b00100000 // Vertical Refresh Order (bottom to top)
  44. #define GC9XXX_MADCTL_ML 0b00010000
  45. #define GC9XXX_MADCTL_BGR 0b00001000
  46. #define GC9XXX_MADCTL_RGB 0b00000000
  47. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  48. // GC9XXX Parameter constants