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