Skip to content

Commit

Permalink
Faster init
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarr823 committed Dec 7, 2023
1 parent 0b9a7fe commit fc88d71
Showing 1 changed file with 10 additions and 33 deletions.
43 changes: 10 additions & 33 deletions papertty/drivers/drivers_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,13 @@ def init(self, **kwargs):
self.wait_until_idle()

self.send_command(0x01) # setting gaet number
self.send_data(0xDF)
self.send_data(0x01)
self.send_data(0x00)
self.send_data_multi([0xDF,0x01,0x00])

self.send_command(0x03) # set gate voltage
self.send_data(0x00)

self.send_command(0x04) # set source voltage
self.send_data(0x41)
self.send_data(0xA8)
self.send_data(0x32)
self.send_data_multi([0x41,0xA8,0x32])

self.send_command(0x11) # set data entry sequence
self.send_data(0x03)
Expand All @@ -374,11 +370,7 @@ def init(self, **kwargs):
self.send_data(0x00)

self.send_command(0x0C) # set booster strength
self.send_data(0xAE)
self.send_data(0xC7)
self.send_data(0xC3)
self.send_data(0xC0)
self.send_data(0xC0)
self.send_data_multi([0xAE,0xC7,0xC3,0xC0,0xC0])

self.send_command(0x18) # set internal sensor on
self.send_data(0x80)
Expand All @@ -387,28 +379,15 @@ def init(self, **kwargs):
self.send_data(0x44)

self.send_command(0x37) # set display option, these setting turn on previous function
self.send_data(0x00) #can switch 1 gray or 4 gray
self.send_data(0xFF)
self.send_data(0xFF)
self.send_data(0xFF)
self.send_data(0xFF)
self.send_data(0x4F)
self.send_data(0xFF)
self.send_data(0xFF)
self.send_data(0xFF)
self.send_data(0xFF)
#can switch 1 gray or 4 gray
#4gray not currently implemented
self.send_data_multi([0x00,0xFF,0xFF,0xFF,0xFF,0x4F,0xFF,0xFF,0xFF,0xFF])

self.send_command(0x44) # setting X direction start/end position of RAM
self.send_data(0x00)
self.send_data(0x00)
self.send_data(0x17)
self.send_data(0x01)
self.send_data_multi([0x00,0x00,0x17,0x01])

self.send_command(0x45) # setting Y direction start/end position of RAM
self.send_data(0x00)
self.send_data(0x00)
self.send_data(0xDF)
self.send_data(0x01)
self.send_data_multi([0x00,0x00,0xDF,0x01])

self.send_command(0x22) # Display Update Control 2
self.send_data(0xCF)
Expand All @@ -422,11 +401,9 @@ def load_lut(self, lut):
def display_frame(self, frame_buffer, *args):
if frame_buffer:
self.send_command(0x4E)
self.send_data(0x00)
self.send_data(0x00)
self.send_data_multi([0x00,0x00])
self.send_command(0x4F)
self.send_data(0x00)
self.send_data(0x00)
self.send_data_multi([0x00,0x00])

self.send_command(0x24)
self.send_data_multi(frame_buffer)
Expand Down

0 comments on commit fc88d71

Please sign in to comment.