The 1in54_V2 program uses external waveform, Improved refresh speed and compatibility

This commit is contained in:
SSYYL 2021-07-16 14:46:14 +08:00
commit 07230521f9
9 changed files with 209 additions and 74 deletions

View file

@ -114,23 +114,24 @@ int EPD_1in54_V2_test(void)
Paint_DrawString_CN(5, 155, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
EPD_1IN54_V2_Display(BlackImage);
DEV_Delay_ms(2000);
#endif
#if 1 //Partial refresh, example shows time
// The image of the previous frame must be uploaded, otherwise the
// first few seconds will display an exception.
EPD_1IN54_V2_Init();
EPD_1IN54_V2_DisplayPartBaseImage(BlackImage);
EPD_1IN54_V2_DisplayPartBaseImage(BlackImage);
// enter partial mode
EPD_1IN54_V2_Init_Partial();
printf("Partial refresh\r\n");
Paint_SelectImage(BlackImage);
PAINT_TIME sPaint_time;
sPaint_time.Hour = 12;
sPaint_time.Min = 34;
sPaint_time.Sec = 56;
UBYTE num = 20;
UBYTE num = 15;
for (;;) {
sPaint_time.Sec = sPaint_time.Sec + 1;
if (sPaint_time.Sec == 60) {

View file

@ -30,7 +30,32 @@
#include "EPD_1in54_V2.h"
#include "Debug.h"
const unsigned char WF_PARTIAL_1IN54_0[159] =
// waveform full refresh
unsigned char WF_Full_1IN54[159] =
{
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x80, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x40, 0x48, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x8, 0x1, 0x0, 0x8, 0x1, 0x0, 0x2,
0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
0x22, 0x17, 0x41, 0x0, 0x32, 0x20
};
// waveform partial refresh(fast)
unsigned char WF_PARTIAL_1IN54_0[159] =
{
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
@ -53,7 +78,8 @@ const unsigned char WF_PARTIAL_1IN54_0[159] =
0x02,0x17,0x41,0xB0,0x32,0x28,
};
const unsigned char WF_PARTIAL_1IN54_1[159] =
// waveform partial refresh(quality)
unsigned char WF_PARTIAL_1IN54_1[159] =
{
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
@ -223,15 +249,6 @@ void EPD_1IN54_V2_Init(void)
EPD_1IN54_V2_SendCommand(0x11); //data entry mode
EPD_1IN54_V2_SendData(0x01);
// EPD_1IN54_V2_SendCommand(0x44); //set Ram-X address start/end position
// EPD_1IN54_V2_SendData(0x00);
// EPD_1IN54_V2_SendData(0x18); //0x0C-->(18+1)*8=200
// EPD_1IN54_V2_SendCommand(0x45); //set Ram-Y address start/end position
// EPD_1IN54_V2_SendData(0xC7); //0xC7-->(199+1)=200
// EPD_1IN54_V2_SendData(0x00);
// EPD_1IN54_V2_SendData(0x00);
// EPD_1IN54_V2_SendData(0x00);
EPD_1IN54_V2_SetWindows(0, EPD_1IN54_V2_HEIGHT-1, EPD_1IN54_V2_WIDTH-1, 0);
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
@ -244,13 +261,10 @@ void EPD_1IN54_V2_Init(void)
EPD_1IN54_V2_SendData(0XB1);
EPD_1IN54_V2_SendCommand(0x20);
// EPD_1IN54_V2_SendCommand(0x4E); // set RAM x address count to 0;
// EPD_1IN54_V2_SendData(0x00);
// EPD_1IN54_V2_SendCommand(0x4F); // set RAM y address count to 0X199;
// EPD_1IN54_V2_SendData(0xC7);
// EPD_1IN54_V2_SendData(0x00);
EPD_1IN54_V2_SetCursor(0, EPD_1IN54_V2_HEIGHT-1);
EPD_1IN54_V2_ReadBusy();
EPD_1IN54_V2_SetLut(WF_Full_1IN54);
}
/******************************************************************************
@ -259,13 +273,10 @@ parameter:
******************************************************************************/
void EPD_1IN54_V2_Init_Partial(void)
{
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(2);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(5);
EPD_1IN54_V2_Reset();
EPD_1IN54_V2_ReadBusy();
EPD_1IN54_V2_SetLut(WF_PARTIAL_1IN54_0);
EPD_1IN54_V2_SetLut(WF_PARTIAL_1IN54_1);
EPD_1IN54_V2_SendCommand(0x37);
EPD_1IN54_V2_SendData(0x00);
EPD_1IN54_V2_SendData(0x00);