qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

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