Added 320x240 2.0" LCD variant.
This commit is contained in:
parent
b4261874cf
commit
4df50bb676
19
st7789_lcd.c
19
st7789_lcd.c
|
@ -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
|
||||
|
|
|
@ -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."
|
||||
|
|
Loading…
Reference in New Issue