Explorar el Código

fix:修复3.52寸墨水屏不显示

Dozingfiretruck hace 2 años
padre
commit
fdaec6b689
Se han modificado 3 ficheros con 17 adiciones y 10 borrados
  1. 11 2
      components/epaper/EPD_3in52.c
  2. 5 7
      components/epaper/EPD_3in7.c
  3. 1 1
      components/epaper/epd.c

+ 11 - 2
components/epaper/EPD_3in52.c

@@ -238,7 +238,7 @@ parameter:
 ******************************************************************************/
 void EPD_3IN52_ReadBusy(void)
 {
-    EPD_Busy_WaitUntil(0,0);
+    EPD_Busy_WaitUntil(1,0);
     // Debug("e-Paper busy\r\n");
     // UBYTE busy;
     // do {
@@ -460,7 +460,14 @@ void EPD_3IN52_Init(UBYTE mode)
     EPD_3IN52_SendData(0x68);			//  VRES[7:0]
 
     EPD_3IN52_SendCommand(0x50);			
-    EPD_3IN52_SendData(0xB7);			
+    EPD_3IN52_SendData(0xB7);		
+    
+    EPD_3IN52_display_NUM(EPD_3IN52_WHITE);
+    EPD_3IN52_lut_GC();
+    EPD_3IN52_refresh();
+
+    EPD_3IN52_SendCommand(0x50);
+    EPD_3IN52_SendData(0x17);	
 }
 
 
@@ -473,6 +480,8 @@ void EPD_3IN52_display(UBYTE *Image, UBYTE *Image2)
         EPD_3IN52_SendData(*Image);
         Image++;
     }
+    EPD_3IN52_lut_GC();
+    EPD_3IN52_refresh();
 }
 
 void EPD_3IN52_display_NUM(UBYTE NUM)

+ 5 - 7
components/epaper/EPD_3in7.c

@@ -229,6 +229,7 @@ void EPD_3IN7_4Gray_Init(UBYTE mode)
     EPD_3IN7_SendData(0x00);
     EPD_3IN7_SendData(0x00);
     EPD_3IN7_SendData(0x00);
+    EPD_3IN7_SendData(0x00);  
     EPD_3IN7_SendData(0x00);
     EPD_3IN7_SendData(0x00);
     EPD_3IN7_SendData(0x00);
@@ -401,7 +402,7 @@ void EPD_3IN7_1Gray_Clear(void)
     EPD_3IN7_SendData(0xff);
   }
 
-  EPD_3IN7_Load_LUT(1);
+  EPD_3IN7_Load_LUT(2);
 
   EPD_3IN7_SendCommand(0x20);
   EPD_3IN7_ReadBusy_HIGH();
@@ -543,7 +544,7 @@ void EPD_3IN7_1Gray_Display(const UBYTE *Image, UBYTE *Image2)
     EPD_3IN7_SendData(Image[i]);
   }
 
-  EPD_3IN7_Load_LUT(1);
+  EPD_3IN7_Load_LUT(2);
   EPD_3IN7_SendCommand(0x20);
   EPD_3IN7_ReadBusy_HIGH();
 }
@@ -586,9 +587,6 @@ parameter:
 ******************************************************************************/
 void EPD_3IN7_Sleep(void)
 {
-    EPD_3IN7_SendCommand(0X50);
-    EPD_3IN7_SendData(0xf7);
-    EPD_3IN7_SendCommand(0X02);  	//power off
-    EPD_3IN7_SendCommand(0X07);  	//deep sleep
-    EPD_3IN7_SendData(0xA5);
+    EPD_3IN7_SendCommand(0X10);  	//deep sleep
+    EPD_3IN7_SendData(0x03);
 }

+ 1 - 1
components/epaper/epd.c

@@ -47,7 +47,7 @@ static const eink_reg_t eink_regs[] = {
         {.tp=MODEL_2in9d,       .colors=1, .init=EPD_2IN9D_Init, .w = EPD_2IN9D_WIDTH, .h = EPD_2IN9D_HEIGHT, .clear = EPD_2IN9D_Clear, .sleep =EPD_2IN9D_Sleep, .display=EPD_2IN9D_Display},
         // {.tp=MODEL_2in9ff,      .colors=1, .init=EPD_2IN9FF_Init, .w = EPD_2IN9FF_WIDTH, .h = EPD_2IN9FF_HEIGHT, .clear = EPD_2IN9FF_Clear, .sleep =EPD_2IN9FF_Sleep, .display=EPD_2IN9FF_Display},
         {.tp=MODEL_2in9_V2,     .colors=1, .init=EPD_2IN9_V2_Init, .w = EPD_2IN9_V2_WIDTH, .h = EPD_2IN9_V2_HEIGHT, .clear = EPD_2IN9_V2_Clear, .sleep =EPD_2IN9_V2_Sleep, .display=EPD_2IN9_V2_Display},
-        {.tp=MODEL_3in52,        .colors=1, .init=EPD_3IN52_Init, .w = EPD_3IN52_WIDTH, .h = EPD_3IN52_HEIGHT, .clear = EPD_3IN52_Clear, .sleep =EPD_3IN52_sleep, .display=EPD_3IN52_display},
+        {.tp=MODEL_3in52,       .colors=1, .init=EPD_3IN52_Init, .w = EPD_3IN52_WIDTH, .h = EPD_3IN52_HEIGHT, .clear = EPD_3IN52_Clear, .sleep =EPD_3IN52_sleep, .display=EPD_3IN52_display},
         {.tp=MODEL_3in7,        .colors=1, .init=EPD_3IN7_1Gray_Init, .w = EPD_3IN7_WIDTH, .h = EPD_3IN7_HEIGHT, .clear = EPD_3IN7_1Gray_Clear, .sleep =EPD_3IN7_Sleep, .display=EPD_3IN7_1Gray_Display},
         {.tp=MODEL_4in2,        .colors=1, .init=EPD_4IN2_Init, .w = EPD_4IN2_WIDTH, .h = EPD_4IN2_HEIGHT, .clear = EPD_4IN2_Clear, .sleep =EPD_4IN2_Sleep, .display=EPD_4IN2_Display},
         {.tp=MODEL_4in2_V2,     .colors=1, .init=EPD_4IN2_V2_Init, .w = EPD_4IN2_V2_WIDTH, .h = EPD_4IN2_V2_HEIGHT, .clear = EPD_4IN2_V2_Clear, .sleep =EPD_4IN2_V2_Sleep, .display=EPD_4IN2_V2_Display},