Adding original screen clearing LUT to help prevent burn-in

Signed-off-by: Justin Richards <ratmandu@gmail.com>
This commit is contained in:
Justin Richards 2019-10-27 15:48:14 -05:00
parent 15b815d8ad
commit dfcc2f6bf2

View File

@ -58,10 +58,10 @@ class EPD:
self.height = EPD_HEIGHT
lut_vcomDC = [
0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
0x99, 0x20, 0x20, 0x20, 0x20, 0x06,
0x00, 0x20, 0x20, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -69,44 +69,46 @@ class EPD:
]
lut_ww = [
0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
0x66, 0x06, 0x06, 0x06, 0x06, 0x04,
0xAA, 0x32, 0x32, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
]
lut_bw = [
0x40, 0x17, 0x00, 0x00, 0x00, 0x02,
0x90, 0x0F, 0x0F, 0x00, 0x00, 0x03,
0x40, 0x0A, 0x01, 0x00, 0x00, 0x01,
0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02,
0x66, 0x06, 0x06, 0x06, 0x06, 0x04,
0xAA, 0x32, 0x32, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
]
lut_wb = [
0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
0x99, 0x06, 0x06, 0x06, 0x06, 0x04,
0x55, 0x42, 0x42, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
]
lut_bb = [
0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
0x90, 0x28, 0x28, 0x00, 0x00, 0x00,
0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
0x99, 0x06, 0x06, 0x06, 0x06, 0x04,
0x55, 0x42, 0x42, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
]
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
]
lut_vcom1 = [
0xA0, 0x10, 0x10, 0x00, 0x00, 0x02,
@ -233,16 +235,32 @@ class EPD:
return 0
def SetFullReg(self):
self.send_command(0x82)
self.send_data(0x00)
self.send_command(0X50)
self.send_data(0x97)
# self.send_command(0x00) # panel setting
# self.send_data(0x9f) # LUT from OTP,128x296
self.send_command(0x00) # panel setting
self.send_data(0x9f) # LUT from OTP,128x296
#self.send_command(0x82)
#self.send_data(0x00)
#self.send_command(0X50)
#self.send_data(0x97)
#self.send_command(0x20) # vcom
#for count in range(0, 44):
# self.send_data(self.lut_vcomDC[count])
#self.send_command(0x21) # ww --
#for count in range(0, 42):
# self.send_data(self.lut_ww[count])
#self.send_command(0x22) # bw r
#for count in range(0, 42):
# self.send_data(self.lut_bw[count])
#self.send_command(0x23) # wb w
#for count in range(0, 42):
# self.send_data(self.lut_wb[count])
#self.send_command(0x24) # bb b
#for count in range(0, 42):
# self.send_data(self.lut_bb[count])
def SetPartReg(self):
# self.send_command(0x00) # panel setting
# self.send_data(0xbf) # LUT from OTP,128x296
self.send_command(0x00) # panel setting
self.send_data(0xbf) # LUT from OTP,128x296
self.send_command(0x82)
self.send_data(0x03)
self.send_command(0X50)
@ -336,16 +354,17 @@ class EPD:
def Clear(self):
self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0x00)
epdconfig.delay_ms(10)
self.send_data(0xFF)
self.send_command(0x92)
self.send_command(0x13)
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0x00)
epdconfig.delay_ms(10)
self.send_data(0xFF)
self.send_command(0x92)
self.SetFullReg()
self.TurnOnDisplay()
self.send_command(0x12) # REFRESH
self.ReadBusy()
def sleep(self):
self.send_command(0X50)