aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Mignot <victor@vmignot.fr>2026-02-06 15:56:46 +0100
committerVictor Mignot <victor@vmignot.fr>2026-02-06 15:56:46 +0100
commitced75dd25b796310e55c79141ce17c1d9f1eefbe (patch)
tree5f25a054a695d19a99ca72fd1e9d0bfdec80b7e6
parent719538162cd390963b3ac8f2965a3e6546162b3b (diff)
downloadnanji-ced75dd25b796310e55c79141ce17c1d9f1eefbe.tar.gz
[WIP] ST7789V: add display controller driverHEADmain
-rw-r--r--src/lcd.c96
-rw-r--r--src/lcd.h7
2 files changed, 103 insertions, 0 deletions
diff --git a/src/lcd.c b/src/lcd.c
new file mode 100644
index 0000000..d6fbc07
--- /dev/null
+++ b/src/lcd.c
@@ -0,0 +1,96 @@
+#include "lcd.h"
+
+enum lcd_command {
+ NOP = 0x0,
+ SWRESET = 0x1,
+ /** Read display ID */
+ RDDID = 0x4,
+ /** Read display status */
+ RDDST = 0x9,
+ /** Read display */
+ RDDPM = 0xa,
+ /** Read display */
+ RDD_MADCTL = 0xb,
+ /** Read display pixel */
+ RDD_COLMOD = 0xc,
+ /** Read display image */
+ RDDIM = 0xd,
+ /** Read display signal */
+ RDDSM = 0xe,
+ /** Read display self-diagnostic result */
+ RDDSDR = 0xf,
+ /** Sleep in */
+ SLPIN = 0x10,
+ /** Sleep out */
+ SLPOUT = 0x11,
+ /** Partial mode */
+ PTLON = 0x12,
+ /** Normal mode */
+ NORON = 0x13,
+ /** Display inversion off */
+ INVOFF = 0x20,
+ /** Display inversion on */
+ INVON = 0x21,
+ /** */
+ GAMSET = 0x26,
+ /** Display off */
+ DISPOFF = 0x28,
+ /** Display on */
+ DISPON = 0x29,
+ /** Column address set */
+ CASET = 0x2a,
+ /** Row address set */
+ RASET = 0x2b,
+ /** RAM write */
+ RAMWR = 0x2c,
+ /** RAM read */
+ RAMRD = 0x2e,
+ /** Partial start/end address set */
+ PTLAR = 0x30,
+ /** Vertical scrolling definition */
+ VSCRDEF = 0x33,
+ /** Tearing effect line off */
+ TEOFF = 0x34,
+ /** Tearing effect line on */
+ TEON = 0x35,
+ /** Memory data access control */
+ MADCTL = 0x36,
+ /** Vertical scrolling start address */
+ VSCRSADD = 0x37,
+ /** Idle mode off */
+ IDMOFF = 0x38,
+ /** Idle mode on */
+ IDMON = 0x39,
+ /** Interface pixel format */
+ COLMOD = 0x3a,
+ /** RAM write continue */
+ RAMWRC = 0x3c,
+ /** RAM read continue */
+ RAMRDC = 0x3e,
+ /** Set tear scanline */
+ TESCAN = 0x44,
+ /** Get scanline */
+ RDTESCAN = 0x45,
+ /** Write display brightness */
+ WRDISBV = 0x51,
+ /** Read display brightness value */
+ RDDISBV = 0x52,
+ /** Write CTRL value display*/
+ RDCTRLD = 0x54,
+ /** Write content adaptive brightness control and color enhancement */
+ WRCACE = 0x55,
+ /** Read content adaptive brightness control */
+ RDCABC = 0x56,
+ /** Write CABC minimum brightness */
+ WRCABCMB = 0x5e,
+ /** Read CABC minimum brightness */
+ RDCABCMB = 0x5f,
+ /** Read automatic brightness control self-diagnostic result */
+ RDABCSDR = 0x68,
+ /** Read ID1 */
+ RDID1 = 0xda,
+ /** Read ID2 */
+ RDID2 = 0xdb,
+ /** Read ID3 */
+ RDID3 = 0xdc,
+};
diff --git a/src/lcd.h b/src/lcd.h
new file mode 100644
index 0000000..bbe1280
--- /dev/null
+++ b/src/lcd.h
@@ -0,0 +1,7 @@
+#ifndef LCD_H
+#define LCD_H
+
+#define LCD_WIDTH 240
+#define LCD_HEIGHT 240
+
+#endif