The 1in54_V2 program uses external waveform, Improved refresh speed and compatibility
This commit is contained in:
parent
452880de52
commit
07230521f9
9 changed files with 212 additions and 77 deletions
|
@ -114,23 +114,24 @@ int EPD_1in54_V2_test(void)
|
||||||
Paint_DrawString_CN(5, 155, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
|
Paint_DrawString_CN(5, 155, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
|
||||||
|
|
||||||
EPD_1IN54_V2_Display(BlackImage);
|
EPD_1IN54_V2_Display(BlackImage);
|
||||||
|
|
||||||
DEV_Delay_ms(2000);
|
DEV_Delay_ms(2000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 //Partial refresh, example shows time
|
#if 1 //Partial refresh, example shows time
|
||||||
|
|
||||||
// The image of the previous frame must be uploaded, otherwise the
|
// The image of the previous frame must be uploaded, otherwise the
|
||||||
// first few seconds will display an exception.
|
// 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");
|
printf("Partial refresh\r\n");
|
||||||
Paint_SelectImage(BlackImage);
|
Paint_SelectImage(BlackImage);
|
||||||
PAINT_TIME sPaint_time;
|
PAINT_TIME sPaint_time;
|
||||||
sPaint_time.Hour = 12;
|
sPaint_time.Hour = 12;
|
||||||
sPaint_time.Min = 34;
|
sPaint_time.Min = 34;
|
||||||
sPaint_time.Sec = 56;
|
sPaint_time.Sec = 56;
|
||||||
UBYTE num = 20;
|
UBYTE num = 15;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
sPaint_time.Sec = sPaint_time.Sec + 1;
|
sPaint_time.Sec = sPaint_time.Sec + 1;
|
||||||
if (sPaint_time.Sec == 60) {
|
if (sPaint_time.Sec == 60) {
|
||||||
|
|
|
@ -30,7 +30,32 @@
|
||||||
#include "EPD_1in54_V2.h"
|
#include "EPD_1in54_V2.h"
|
||||||
#include "Debug.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,
|
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
0x80,0x80,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,
|
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,
|
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
0x80,0x0,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_SendCommand(0x11); //data entry mode
|
||||||
EPD_1IN54_V2_SendData(0x01);
|
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_SetWindows(0, EPD_1IN54_V2_HEIGHT-1, EPD_1IN54_V2_WIDTH-1, 0);
|
||||||
|
|
||||||
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
EPD_1IN54_V2_SendCommand(0x3C); //BorderWavefrom
|
||||||
|
@ -244,13 +261,10 @@ void EPD_1IN54_V2_Init(void)
|
||||||
EPD_1IN54_V2_SendData(0XB1);
|
EPD_1IN54_V2_SendData(0XB1);
|
||||||
EPD_1IN54_V2_SendCommand(0x20);
|
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_SetCursor(0, EPD_1IN54_V2_HEIGHT-1);
|
||||||
EPD_1IN54_V2_ReadBusy();
|
EPD_1IN54_V2_ReadBusy();
|
||||||
|
|
||||||
|
EPD_1IN54_V2_SetLut(WF_Full_1IN54);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -259,13 +273,10 @@ parameter:
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
void EPD_1IN54_V2_Init_Partial(void)
|
void EPD_1IN54_V2_Init_Partial(void)
|
||||||
{
|
{
|
||||||
DEV_Digital_Write(EPD_RST_PIN, 0);
|
EPD_1IN54_V2_Reset();
|
||||||
DEV_Delay_ms(2);
|
|
||||||
DEV_Digital_Write(EPD_RST_PIN, 1);
|
|
||||||
DEV_Delay_ms(5);
|
|
||||||
EPD_1IN54_V2_ReadBusy();
|
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_SendCommand(0x37);
|
||||||
EPD_1IN54_V2_SendData(0x00);
|
EPD_1IN54_V2_SendData(0x00);
|
||||||
EPD_1IN54_V2_SendData(0x00);
|
EPD_1IN54_V2_SendData(0x00);
|
||||||
|
|
|
@ -21,7 +21,7 @@ try:
|
||||||
epd = epd1in54_V2.EPD()
|
epd = epd1in54_V2.EPD()
|
||||||
|
|
||||||
logging.info("init and Clear")
|
logging.info("init and Clear")
|
||||||
epd.init()
|
epd.init(0)
|
||||||
epd.Clear(0xFF)
|
epd.Clear(0xFF)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ try:
|
||||||
# Image.new('1', (epd.width, epd.height), 255)
|
# Image.new('1', (epd.width, epd.height), 255)
|
||||||
epd.displayPartBaseImage(epd.getbuffer(time_image))
|
epd.displayPartBaseImage(epd.getbuffer(time_image))
|
||||||
|
|
||||||
|
epd.init(1) # into partial refresh mode
|
||||||
time_draw = ImageDraw.Draw(time_image)
|
time_draw = ImageDraw.Draw(time_image)
|
||||||
num = 0
|
num = 0
|
||||||
while (True):
|
while (True):
|
||||||
|
@ -80,7 +81,7 @@ try:
|
||||||
break
|
break
|
||||||
|
|
||||||
logging.info("Clear...")
|
logging.info("Clear...")
|
||||||
epd.init()
|
epd.init(0)
|
||||||
epd.Clear(0xFF)
|
epd.Clear(0xFF)
|
||||||
|
|
||||||
logging.info("Goto Sleep...")
|
logging.info("Goto Sleep...")
|
||||||
|
|
|
@ -43,6 +43,75 @@ class EPD:
|
||||||
self.width = EPD_WIDTH
|
self.width = EPD_WIDTH
|
||||||
self.height = EPD_HEIGHT
|
self.height = EPD_HEIGHT
|
||||||
|
|
||||||
|
# waveform full refresh
|
||||||
|
WF_Full_1IN54 = [
|
||||||
|
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)
|
||||||
|
WF_PARTIAL_1IN54_0 = [
|
||||||
|
0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x40,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0xF,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x1,0x1,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,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||||
|
0x02,0x17,0x41,0xB0,0x32,0x28,
|
||||||
|
]
|
||||||
|
|
||||||
|
# waveform partial refresh(quality)
|
||||||
|
WF_PARTIAL_1IN54_1 = [
|
||||||
|
0x0,0x00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x40,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,
|
||||||
|
0xA,0x0,0x0,0x0,0x0,0x0,0x1,
|
||||||
|
0x1,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,
|
||||||
|
0x0,0x0,0x0,0x0,0x0,0x0,0x0,
|
||||||
|
0x22,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
|
||||||
|
0x22,0x17,0x41,0x0,0x32,0x20,
|
||||||
|
]
|
||||||
|
|
||||||
# Hardware reset
|
# Hardware reset
|
||||||
def reset(self):
|
def reset(self):
|
||||||
epdconfig.digital_write(self.reset_pin, 1)
|
epdconfig.digital_write(self.reset_pin, 1)
|
||||||
|
@ -72,25 +141,96 @@ class EPD:
|
||||||
|
|
||||||
def TurnOnDisplay(self):
|
def TurnOnDisplay(self):
|
||||||
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
||||||
self.send_data(0xF7)
|
self.send_data(0xc7)
|
||||||
self.send_command(0x20) # MASTER_ACTIVATION
|
self.send_command(0x20) # MASTER_ACTIVATION
|
||||||
self.ReadBusy()
|
self.ReadBusy()
|
||||||
|
|
||||||
def TurnOnDisplayPart(self):
|
def TurnOnDisplayPart(self):
|
||||||
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
self.send_command(0x22) # DISPLAY_UPDATE_CONTROL_2
|
||||||
self.send_data(0xFF)
|
self.send_data(0xcF)
|
||||||
self.send_command(0x20) # MASTER_ACTIVATION
|
self.send_command(0x20) # MASTER_ACTIVATION
|
||||||
self.ReadBusy()
|
self.ReadBusy()
|
||||||
|
|
||||||
def init(self):
|
def lut(self, lut):
|
||||||
|
self.send_command(0x32) # WRITE_LUT_REGISTER
|
||||||
|
for i in range(0, len(lut)):
|
||||||
|
self.send_data(lut[i])
|
||||||
|
|
||||||
|
def set_lut(self, lut):
|
||||||
|
self.lut(lut)
|
||||||
|
|
||||||
|
self.send_command(0x3f)
|
||||||
|
self.send_data(lut[153])
|
||||||
|
|
||||||
|
self.send_command(0x03)
|
||||||
|
self.send_data(lut[154])
|
||||||
|
|
||||||
|
self.send_command(0x04)
|
||||||
|
self.send_data(lut[155])
|
||||||
|
self.send_data(lut[156])
|
||||||
|
self.send_data(lut[157])
|
||||||
|
|
||||||
|
self.send_command(0x2c)
|
||||||
|
self.send_data(lut[158])
|
||||||
|
|
||||||
|
def SetWindows(self, Xstart, Ystart, Xend, Yend):
|
||||||
|
self.send_command(0x44); # SET_RAM_X_ADDRESS_START_END_POSITION
|
||||||
|
self.send_data((Xstart>>3) & 0xFF);
|
||||||
|
self.send_data((Xend>>3) & 0xFF);
|
||||||
|
|
||||||
|
self.send_command(0x45); # SET_RAM_Y_ADDRESS_START_END_POSITION
|
||||||
|
self.send_data(Ystart & 0xFF);
|
||||||
|
self.send_data((Ystart >> 8) & 0xFF);
|
||||||
|
self.send_data(Yend & 0xFF);
|
||||||
|
self.send_data((Yend >> 8) & 0xFF);
|
||||||
|
|
||||||
|
|
||||||
|
def SetCursor(self, Xstart, Ystart):
|
||||||
|
self.send_command(0x4E); # SET_RAM_X_ADDRESS_COUNTER
|
||||||
|
self.send_data(Xstart & 0xFF);
|
||||||
|
|
||||||
|
self.send_command(0x4F); # SET_RAM_Y_ADDRESS_COUNTER
|
||||||
|
self.send_data(Ystart & 0xFF);
|
||||||
|
self.send_data((Ystart >> 8) & 0xFF);
|
||||||
|
|
||||||
|
def init(self, isPartial):
|
||||||
if (epdconfig.module_init() != 0):
|
if (epdconfig.module_init() != 0):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
if(isPartial):
|
||||||
|
logging.debug("full refresh")
|
||||||
|
self.reset()
|
||||||
|
self.ReadBusy()
|
||||||
|
|
||||||
|
self.set_lut(self.WF_PARTIAL_1IN54_0)
|
||||||
|
|
||||||
|
self.send_command(0x37)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x40)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
self.send_data(0x00)
|
||||||
|
|
||||||
|
self.send_command(0x3c) # BorderWavefrom
|
||||||
|
self.send_data(0x80)
|
||||||
|
|
||||||
|
self.send_command(0x22)
|
||||||
|
self.send_data(0xc0)
|
||||||
|
self.send_command(0x20)
|
||||||
|
self.ReadBusy()
|
||||||
|
|
||||||
|
else:
|
||||||
|
logging.debug("partial refresh")
|
||||||
# EPD hardware init start
|
# EPD hardware init start
|
||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
self.ReadBusy()
|
self.ReadBusy()
|
||||||
self.send_command(0x12) # SWRESET
|
self.send_command(0x12) # SWRESET (software reset)
|
||||||
self.ReadBusy()
|
self.ReadBusy()
|
||||||
|
|
||||||
self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
|
self.send_command(0x01) # DRIVER_OUTPUT_CONTROL
|
||||||
|
@ -101,15 +241,7 @@ class EPD:
|
||||||
self.send_command(0x11) # data entry mode
|
self.send_command(0x11) # data entry mode
|
||||||
self.send_data(0x01)
|
self.send_data(0x01)
|
||||||
|
|
||||||
self.send_command(0x44) # set Ram-X address start/end position
|
self.SetWindows(0, self.height-1, self.width-1, 0) # Set Windows
|
||||||
self.send_data(0x00)
|
|
||||||
self.send_data(0x18) # 0x0C-->(18+1)*8=200
|
|
||||||
|
|
||||||
self.send_command(0x45) # set Ram-Y address start/end position
|
|
||||||
self.send_data(0xC7) # 0xC7-->(199+1)=200
|
|
||||||
self.send_data(0x00)
|
|
||||||
self.send_data(0x00)
|
|
||||||
self.send_data(0x00)
|
|
||||||
|
|
||||||
self.send_command(0x3C) # BorderWavefrom
|
self.send_command(0x3C) # BorderWavefrom
|
||||||
self.send_data(0x01)
|
self.send_data(0x01)
|
||||||
|
@ -121,14 +253,12 @@ class EPD:
|
||||||
self.send_data(0XB1)
|
self.send_data(0XB1)
|
||||||
self.send_command(0x20)
|
self.send_command(0x20)
|
||||||
|
|
||||||
self.send_command(0x4E) # set RAM x address count to 0;
|
self.SetCursor(0, self.height-1) # Set Cursor
|
||||||
self.send_data(0x00)
|
|
||||||
self.send_command(0x4F) # set RAM y address count to 0X199;
|
|
||||||
self.send_data(0xC7)
|
|
||||||
self.send_data(0x00)
|
|
||||||
|
|
||||||
self.ReadBusy()
|
self.ReadBusy()
|
||||||
|
|
||||||
|
self.set_lut(self.WF_Full_1IN54) # Set lut
|
||||||
|
|
||||||
def Clear(self, color):
|
def Clear(self, color):
|
||||||
self.send_command(0x24)
|
self.send_command(0x24)
|
||||||
for j in range(0, self.height):
|
for j in range(0, self.height):
|
||||||
|
@ -189,14 +319,6 @@ class EPD:
|
||||||
if (image == None):
|
if (image == None):
|
||||||
return
|
return
|
||||||
|
|
||||||
epdconfig.digital_write(self.reset_pin, 0)
|
|
||||||
epdconfig.delay_ms(10)
|
|
||||||
epdconfig.digital_write(self.reset_pin, 1)
|
|
||||||
epdconfig.delay_ms(10)
|
|
||||||
|
|
||||||
self.send_command(0x3c)
|
|
||||||
self.send_data(0x80)
|
|
||||||
|
|
||||||
self.send_command(0x24)
|
self.send_command(0x24)
|
||||||
for j in range(0, self.height):
|
for j in range(0, self.height):
|
||||||
for i in range(0, int(self.width / 8)):
|
for i in range(0, int(self.width / 8)):
|
||||||
|
|
BIN
RaspberryPi_JetsonNano/python/pic/4in2_1.bmp
Normal file
BIN
RaspberryPi_JetsonNano/python/pic/4in2_1.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_B.bmp
Normal file
BIN
RaspberryPi_JetsonNano/python/pic/4in2_B.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_Pico.bmp
Normal file
BIN
RaspberryPi_JetsonNano/python/pic/4in2_Pico.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
BIN
RaspberryPi_JetsonNano/python/pic/4in2_R.bmp
Normal file
BIN
RaspberryPi_JetsonNano/python/pic/4in2_R.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 788 KiB After Width: | Height: | Size: 788 KiB |
Loading…
Add table
Add a link
Reference in a new issue