Added 320x240 2.0" LCD variant.

This commit is contained in:
imi415 2021-06-20 21:04:18 +08:00
parent b4261874cf
commit 4df50bb676
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
2 changed files with 25 additions and 0 deletions

View File

@ -1,5 +1,24 @@
#include "st7789_lcd.h"
uint8_t st7789_init_seq_zjy_320_240[] = {
0x05, 0xB2, 0x0C, 0x0C, 0x00, 0x33, 0x33, // Porch Setting
0x01, 0xB7, 0x35, // Gate Control
0x01, 0xBB, 0x32, // VCOM Setting // Factory 0x19 -> 0.725V
0x01, 0xC0, 0x2C, // LCM Control
0x01, 0xC2, 0x01, // VDV and VRH Command Enable
0x01, 0xC3, 0x15, // VRH Set // Factory 12H
0x01, 0xC4, 0x20, // VDV Set
0x01, 0xC6, 0x0F, // Frame Rate Control in Normal Mode
0x02, 0xD0, 0xA4, 0xA1, // Power Control 1
0x0E, 0xE0, 0xD0, 0x08, 0x0E, 0x09, 0x09, 0x05,
0x31, 0x33, 0x48, 0x17, 0x14, 0x15, 0x31,
0x34, // Positive Voltage Gamma Control
0x0E, 0xE1, 0xD0, 0x08, 0x0E, 0x09, 0x15, 0x31,
0x33, 0x48, 0x17, 0x2F, 0x14, 0x15, 0x31,
0x34, // Negative Voltage Gamma Control
0x00, 0x21, // Inversion On
};
uint8_t st7789_init_seq_zjy_240_240[] = {
0x05, 0xB2, 0x0C, 0x0C, 0x00, 0x33, 0x33, // Porch Setting
0x01, 0xB7, 0x35, // Gate Control

View File

@ -53,6 +53,12 @@ typedef struct {
#define PANEL_X_OFFSET 53
#define PANEL_Y_OFFSET 40
#elif ST7789_PANEL_ZJY_320
#define ST7789_PANEL_SELECTION st7789_init_seq_zjy_320_240
#define PANEL_X_OFFSET 0
#define PANEL_Y_OFFSET 0
#else
#warning "Panel not defined, using default."