Added H144C121D.
Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
parent
d4b93f784e
commit
7d0de59c3b
|
@ -8,6 +8,7 @@ set(EPD_SOURCES
|
|||
"src/driver/lcd_st7789.c"
|
||||
"src/panel/epd_wfh0420cz35.c"
|
||||
"src/panel/epd_gdew042t2.c"
|
||||
"src/panel/lcd_h144c121d.c"
|
||||
"src/panel/lcd_hp32030d.c"
|
||||
"src/panel/lcd_jlx256128g_920.c"
|
||||
"src/panel/lcd_zjy350c4001.c"
|
||||
|
|
|
@ -45,5 +45,6 @@ epd_ret_t lcd_st7789_load(lcd_st7789_t *lcd, epd_coord_t *coord, const uint8_t *
|
|||
epd_ret_t lcd_st7789_set_pixel_format(lcd_st7789_t *lcd, lcd_st7789_pixel_format_t format);
|
||||
epd_ret_t lcd_st7789_set_direction(lcd_st7789_t *lcd, lcd_st7789_direction_t direction);
|
||||
epd_ret_t lcd_st7789_set_inversion(lcd_st7789_t *lcd, bool invert);
|
||||
epd_ret_t lcd_st7789_enable_display(lcd_st7789_t *lcd, bool on);
|
||||
|
||||
#endif // LCD_ST7789_H
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef LCD_H144C121D_H
|
||||
#define LCD_H144C121D_H
|
||||
|
||||
#include "epd-spi/driver/lcd_st7789.h"
|
||||
|
||||
extern const st7789_panel_config_t lcd_h144c121d_panel_config;
|
||||
|
||||
#endif // LCD_H144C121D_H
|
|
@ -7,6 +7,8 @@
|
|||
#define ST7789_CMD_SLPOUT (0x11U)
|
||||
#define ST7789_CMD_INVOFF (0x20U)
|
||||
#define ST7789_CMD_INVON (0x21U)
|
||||
#define ST7789_CMD_DISPOFF (0x28U)
|
||||
#define ST7789_CMD_DISPON (0x29U)
|
||||
#define ST7789_CMD_CASET (0x2AU)
|
||||
#define ST7789_CMD_RASET (0x2BU)
|
||||
#define ST7789_CMD_RAMWR (0x2CU)
|
||||
|
@ -28,6 +30,10 @@ epd_ret_t lcd_st7789_init(lcd_st7789_t *lcd, const st7789_panel_config_t *config
|
|||
EPD_ERROR_CHECK(lcd_st7789_set_direction(lcd, LCD_ST7789_DIR_0));
|
||||
EPD_ERROR_CHECK(lcd_st7789_set_inversion(lcd, false));
|
||||
|
||||
if (lcd->cb.backlight_cb) {
|
||||
EPD_ERROR_CHECK(lcd->cb.backlight_cb(lcd, 1));
|
||||
}
|
||||
|
||||
return EPD_OK;
|
||||
}
|
||||
|
||||
|
@ -101,6 +107,20 @@ epd_ret_t lcd_st7789_set_inversion(lcd_st7789_t *lcd, bool invert) {
|
|||
return EPD_OK;
|
||||
}
|
||||
|
||||
epd_ret_t lcd_st7789_enable_display(lcd_st7789_t *lcd, bool on) {
|
||||
uint8_t command[1];
|
||||
|
||||
if (on) {
|
||||
command[0] = ST7789_CMD_DISPON;
|
||||
} else {
|
||||
command[0] = ST7789_CMD_DISPOFF;
|
||||
}
|
||||
|
||||
EPD_ERROR_CHECK(lcd->cb.write_command_cb(lcd->user_data, command, 0x01));
|
||||
|
||||
return EPD_OK;
|
||||
}
|
||||
|
||||
static epd_ret_t lcd_st7789_reset(lcd_st7789_t *lcd) {
|
||||
uint8_t cmd_buf[1] = {ST7789_CMD_SWRESET};
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#include "panel/lcd_h144c121d.h"
|
||||
|
||||
static uint8_t panel_init_struct[] = {
|
||||
0x01, 0x36, 0x00, // MADCTL
|
||||
0x01, 0x3A, 0x05, // COLMOD
|
||||
0x05, 0xB2, 0x0C, 0x0C, 0x00, 0x33, 0x33, // PORCTRL
|
||||
0x01, 0xB7, 0x72, // GCTRL
|
||||
0x01, 0xBB, 0x3D, // VCOMS
|
||||
0x01, 0xC2, 0x01, // VDVVRHEN
|
||||
0x01, 0xC3, 0x19, // VRHS
|
||||
0x01, 0xC4, 0x20, // VDVS
|
||||
0x01, 0xC6, 0x0F, // FRCTRL
|
||||
0x02, 0xD0, 0xA4, 0xA1, // PWCTRL1
|
||||
0x0E, 0xE0, 0x70, 0x04, 0x08, 0x09, 0x09, 0x05, 0x2A, 0x33, 0x41, 0x07, 0x13, 0x13, 0x29, 0x2F, // PGC
|
||||
0x0E, 0xE1, 0x70, 0x03, 0x09, 0x0A, 0x09, 0x06, 0x2B, 0x34, 0x41, 0x07, 0x12, 0x14, 0x28, 0x2E, // NGC
|
||||
};
|
||||
|
||||
const st7789_panel_config_t lcd_h144c121d_panel_config = {
|
||||
.init_struct = panel_init_struct,
|
||||
.init_struct_length = sizeof(panel_init_struct),
|
||||
.ram_offset_x = 0U,
|
||||
.ram_offset_y = 0U,
|
||||
.size_x = 240,
|
||||
.size_y = 240,
|
||||
.inversion = true,
|
||||
.bgr_filter = false,
|
||||
};
|
|
@ -16,7 +16,6 @@ static uint8_t panel_init_struct[] = {
|
|||
0x01, 0xD5, 0xA1, // ??
|
||||
0x0E, 0xE0, 0xD0, 0x08, 0x0A, 0x0D, 0x0B, 0x07, 0x21, 0x33, 0x39, 0x39, 0x16, 0x16, 0x1F, 0x3C, // PGC (E0H)
|
||||
0x0E, 0xE1, 0xD0, 0x00, 0x03, 0x01, 0x00, 0x10, 0x21, 0x32, 0x38, 0x16, 0x14, 0x14, 0x20, 0x3D, // NGC (E1H)
|
||||
0x00, 0x21, 0x00, 0x29, 0x00, 0x2C,
|
||||
};
|
||||
|
||||
const st7789_panel_config_t lcd_hp32030d_panel_config = {
|
||||
|
|
Loading…
Reference in New Issue