Add Sunrise x3 Pi Python program, modify some programs to speed up data transfer.
This commit is contained in:
parent
979184d047
commit
88bbf456c6
28 changed files with 707 additions and 451 deletions
|
|
@ -4,8 +4,8 @@
|
|||
# * | Function : Electronic paper driver
|
||||
# * | Info :
|
||||
# *----------------
|
||||
# * | This version: V1.0
|
||||
# * | Date : 2020-10-22
|
||||
# * | This version: V1.1
|
||||
# * | Date : 2022-08-10
|
||||
# # | Info : python demo
|
||||
# -----------------------------------------------------------------------------
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
|
@ -68,6 +68,13 @@ class EPD:
|
|||
epdconfig.digital_write(self.cs_pin, 0)
|
||||
epdconfig.spi_writebyte([data])
|
||||
epdconfig.digital_write(self.cs_pin, 1)
|
||||
|
||||
# send a lot of data
|
||||
def send_data2(self, data):
|
||||
epdconfig.digital_write(self.dc_pin, 1)
|
||||
epdconfig.digital_write(self.cs_pin, 0)
|
||||
epdconfig.spi_writebyte2(data)
|
||||
epdconfig.digital_write(self.cs_pin, 1)
|
||||
|
||||
# Read Busy
|
||||
def ReadBusy(self):
|
||||
|
|
@ -148,25 +155,25 @@ class EPD:
|
|||
Width = self.width / 8
|
||||
Height = self.height
|
||||
|
||||
self.send_command(0x24)
|
||||
buf = [0x00] * int(Width * Height)
|
||||
for i in range(0, int(Width * Height)):
|
||||
self.send_data(imageblack[i])
|
||||
buf[i] = ~imagered[i]
|
||||
|
||||
self.send_command(0x24)
|
||||
self.send_data2(imageblack)
|
||||
|
||||
self.send_command(0x26)
|
||||
for i in range(0, int(Width * Height)):
|
||||
self.send_data(~imagered[i])
|
||||
self.send_data2(buf)
|
||||
|
||||
self.TurnOnDisplay()
|
||||
|
||||
# Clear the screen
|
||||
def Clear(self):
|
||||
self.send_command(0x24)
|
||||
for i in range(0, int(self.width * self.height / 8)):
|
||||
self.send_data(0xff)
|
||||
self.send_data2([0xff] * int(self.width * self.height / 8))
|
||||
|
||||
self.send_command(0x26)
|
||||
for i in range(0, int(self.width * self.height / 8)):
|
||||
self.send_data(0x00)
|
||||
self.send_data2([0x00] * int(self.width * self.height / 8))
|
||||
|
||||
self.TurnOnDisplay()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue