Skip to content

Instantly share code, notes, and snippets.

@knight-ryu12
Created June 15, 2021 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knight-ryu12/0974fec547c75c53c6cab7785fa9b50f to your computer and use it in GitHub Desktop.
Save knight-ryu12/0974fec547c75c53c6cab7785fa9b50f to your computer and use it in GitHub Desktop.
#pragma once
enum ST7796_CMD {
// CMD List 1
// Read commands/ Op Commands
NOP = 0x00,
SWRESET = 0x01,
RDDID = 0x04,
// DSI = 5;
RDDST = 0x09,
RDDPM = 0x0A,
RDDMADCTL = 0x0B,
RDDCOLMOD = 0x0C,
RDDIM = 0x0D,
RDDSM = 0x0E,
RDDSDR = 0x0F,
// Display Controls
SLPIN = 0x10,
SLPOUT = 0x11,
PTLON = 0x12,
NORON = 0x13,
// Display Status Control
INVOFF = 0x20,
INVON = 0x21,
DISPOFF = 0x28,
DISPON = 0x29,
CASET = 0x2A,
RASET = 0x2B,
RAMWR = 0x2C,
RAMRD = 0x2E,
PTLAR = 0x30,
VSCRDEF = 0x33,
TEOFF = 0x34,
TEON = 0x35,
MADCTL = 0x36,
VSCSAD = 0x37,
IDMOFF = 0x38,
IDMON = 0x39,
COLMOD = 0x3A,
WRMEMC = 0x3C,
RDMEMC = 0x3E,
STE = 0x44,
GSCAN = 0x45,
WRDISBV = 0x51,
RDDISBV = 0x52,
WRCTRLD = 0x53,
RDCTRLD = 0x54,
WRCABC = 0x55,
RDCABC = 0x56,
WRCABCMB = 0x5E,
RDCABCMB = 0x5F,
RDFCS = 0xAA,
RDCFCS = 0xAF,
RDID1 = 0xDA,
RDID2 = 0xDB,
RDID3 = 0xDC,
// Command Table 2
IFMODE = 0xB0,
FRMCTR1 = 0xB1,
FRMCTR2 = 0xB2,
FRMCTR3 = 0xB3,
DIC = 0xB4,
BPC = 0xB5,
DFC = 0xB6,
EM = 0xB7,
PWR1 = 0xC0,
PWR2 = 0xC1,
PWR3 = 0xC2,
VCMPCTL = 0xC5,
VCMOFFSET = 0xC6,
NVMADW = 0xD0,
NVMBPROG = 0xD1,
RDNVMSTATUS = 0xD2,
RDID4 = 0xD4,
PGC = 0xE0,
NGC = 0xE1,
DGC1 = 0xE2,
DGC2 = 0xE3,
DOCA = 0xE8,
CSCON = 0xF0,
SPIREADCTL = 0xFB
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment