mirror of
https://github.com/antirez/uc8151_micropython.git
synced 2025-12-06 06:12:49 +08:00
Temporary experimental hand-made fast LUT.
This commit is contained in:
56
uc8151.py
56
uc8151.py
@@ -263,6 +263,59 @@ class UC8151:
|
||||
self.write(CMD_POF)
|
||||
self.wait_ready()
|
||||
|
||||
def set_handmade_lut(self):
|
||||
VCOM = bytes([
|
||||
0x00, 0x01, 0x01, 0x02, 0x00, 0x01,
|
||||
0x00, 0x02, 0x02, 0x03, 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
|
||||
])
|
||||
WW = bytes([
|
||||
0xa8, 0x02, 0x02, 0x03, 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
|
||||
])
|
||||
BW = bytes([
|
||||
0x54, 0x01, 0x01, 0x02, 0x00, 0x01,
|
||||
0xa8, 0x02, 0x02, 0x03, 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
|
||||
])
|
||||
WB = bytes([
|
||||
0xa8, 0x01, 0x01, 0x02, 0x00, 0x01,
|
||||
0x54, 0x02, 0x02, 0x03, 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
|
||||
])
|
||||
BB = bytes([
|
||||
0x54, 0x02, 0x02, 0x03, 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
|
||||
])
|
||||
self.write(CMD_LUT_VCOM,VCOM)
|
||||
self.write(CMD_LUT_BW,BW)
|
||||
self.write(CMD_LUT_WB,WB)
|
||||
self.write(CMD_LUT_BB,BB)
|
||||
self.write(CMD_LUT_WW,WW)
|
||||
|
||||
# Set the lookup tables used during the display refresh.
|
||||
# We have a table for each transition possibile:
|
||||
# white -> white (WW)
|
||||
@@ -481,6 +534,9 @@ if __name__ == "__main__":
|
||||
eink.fb.ellipse(10,10,10,10,1)
|
||||
eink.fb.ellipse(50,50,10,10,1)
|
||||
|
||||
#eink.set_handmade_lut()
|
||||
|
||||
random.seed(123)
|
||||
for _ in range(10):
|
||||
x = random.randrange(100)
|
||||
y = random.randrange(200)
|
||||
|
||||
Reference in New Issue
Block a user