Răsfoiți Sursa

update:sh8601z启用

alienwalker 9 luni în urmă
părinte
comite
37c10d8281
2 a modificat fișierele cu 24 adăugiri și 17 ștergeri
  1. 23 17
      components/lcd/luat_lcd_sh8601z.c
  2. 1 0
      components/lcd/luat_lib_lcd.c

+ 23 - 17
components/lcd/luat_lcd_sh8601z.c

@@ -1,37 +1,43 @@
 #include "luat_base.h"
 #include "luat_lcd.h"
-
+#include "luat_gpio.h"
+#include "luat_rtos.h"
 #define LUAT_LOG_TAG "sh8601z"
 #include "luat_log.h"
 
-static const uint16_t sh8601z_init_cmds[] = {
-    // 发送初始化命令
-    0x023a,0x0355,
-	0x0253,0x0320,
-    0x0235,0x0300,
-    0x0251,0x03ff,
-};
-
-
 static int sh8601z_inited_init(luat_lcd_conf_t* conf)
 {
 	luat_lcd_qspi_conf_t auto_flush =
 	{
 			.write_4line_cmd = 0x32,
-			.vsync_reg = 0x61,
-			.hsync_cmd = 0xde,
-			.hsync_reg = 0x60,
+			.vsync_reg = 0,
+			.hsync_cmd = 0,
+			.hsync_reg = 0,
 			.write_1line_cmd = 0x02,
 			.write_4line_data = 0x12,
 	};
     luat_lcd_qspi_config(conf, &auto_flush);	//必须在第一个命令发送前就准备好
-    return luat_lcd_init_default(conf);
+    luat_gpio_set(conf->pin_rst, Luat_GPIO_LOW);
+    luat_rtos_task_sleep(10);
+    luat_gpio_set(conf->pin_rst, Luat_GPIO_HIGH);
+    luat_rtos_task_sleep(50);
+    luat_lcd_wakeup(conf);
+    luat_rtos_task_sleep(100);
+    uint8_t temp = 0x55;
+    lcd_write_cmd_data(conf,0x3A, &temp, 1);
+    temp = 0x20;
+    lcd_write_cmd_data(conf,0x53, &temp, 1);
+    temp = 0xff;
+    lcd_write_cmd_data(conf,0x51, &temp, 1);
+//    luat_lcd_clear(conf,LCD_BLACK);
+    luat_lcd_display_on(conf);
+    return 0;
 }
 
 luat_lcd_opts_t lcd_opts_sh8601z = {
-    .name = "jd9261t_inited",
-    .init_cmds_len = sizeof(sh8601z_init_cmds)/sizeof(sh8601z_init_cmds[0]),
-    .init_cmds = sh8601z_init_cmds,
+    .name = "sh8601z",
+    .init_cmds_len = 0,
+    .init_cmds = NULL,
     .direction0 = 0x00,
     .direction90 = 0x00,
     .direction180 = 0x40,

+ 1 - 0
components/lcd/luat_lib_lcd.c

@@ -67,6 +67,7 @@ static const lcd_reg_t lcd_regs[] = {
   {"hx8282",  &lcd_opts_hx8282},
   {"st7701s",  &lcd_opts_st7701s},
   {"st7701sn",  &lcd_opts_st7701sn},
+  {"sh8601z",  &lcd_opts_sh8601z},
   {"", NULL} // 最后一个必须是空字符串
 };