Merge pull request #218 from nullableVoidPtr/patch-1

Fix indentation on epd2in13_V3.py
This commit is contained in:
Sherlock 2022-01-04 18:13:15 +08:00 committed by GitHub
commit 130e685e7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,25 +70,25 @@ class EPD:
] ]
lut_full_update = [ lut_full_update = [
0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80,0x4A,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40,0x4A,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80,0x4A,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40,0x4A,0x80,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,
0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xF,0x0,0x0,0x0,0x0,0x0,0x0,
0xF, 0x0, 0x0, 0xF, 0x0, 0x0, 0x2, 0xF,0x0,0x0,0xF,0x0,0x0,0x2,
0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xF,0x0,0x0,0x0,0x0,0x0,0x0,
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 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,
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,0x22,0x22,0x22,0x22,0x22,0x0,0x0,0x0,
0x22, 0x17, 0x41, 0x0, 0x32, 0x36, 0x22,0x17,0x41,0x0,0x32,0x36,
] ]
''' '''
@ -103,7 +103,7 @@ class EPD:
epdconfig.digital_write(self.reset_pin, 1) epdconfig.digital_write(self.reset_pin, 1)
epdconfig.delay_ms(20) epdconfig.delay_ms(20)
''' '''
function :send command function :send command
parameter: parameter:
command : Command register command : Command register
@ -114,7 +114,7 @@ class EPD:
epdconfig.spi_writebyte([command]) epdconfig.spi_writebyte([command])
epdconfig.digital_write(self.cs_pin, 1) epdconfig.digital_write(self.cs_pin, 1)
''' '''
function :send data function :send data
parameter: parameter:
data : Write data data : Write data
@ -125,7 +125,7 @@ class EPD:
epdconfig.spi_writebyte([data]) epdconfig.spi_writebyte([data])
epdconfig.digital_write(self.cs_pin, 1) epdconfig.digital_write(self.cs_pin, 1)
''' '''
function :Wait until the busy_pin goes LOW function :Wait until the busy_pin goes LOW
parameter: parameter:
''' '''
@ -135,7 +135,7 @@ class EPD:
epdconfig.delay_ms(10) epdconfig.delay_ms(10)
logger.debug("e-Paper busy release") logger.debug("e-Paper busy release")
''' '''
function : Turn On Display function : Turn On Display
parameter: parameter:
''' '''
@ -145,7 +145,7 @@ class EPD:
self.send_command(0x20) # Activate Display Update Sequence self.send_command(0x20) # Activate Display Update Sequence
self.ReadBusy() self.ReadBusy()
''' '''
function : Turn On Display Part function : Turn On Display Part
parameter: parameter:
''' '''
@ -155,7 +155,7 @@ class EPD:
self.send_command(0x20) # Activate Display Update Sequence self.send_command(0x20) # Activate Display Update Sequence
self.ReadBusy() self.ReadBusy()
''' '''
function : Set lut function : Set lut
parameter: parameter:
lut : lut data lut : lut data
@ -166,7 +166,7 @@ class EPD:
self.send_data(lut[i]) self.send_data(lut[i])
self.ReadBusy() self.ReadBusy()
''' '''
function : Send lut data and configuration function : Send lut data and configuration
parameter: parameter:
lut : lut data lut : lut data
@ -175,16 +175,16 @@ class EPD:
self.Lut(lut) self.Lut(lut)
self.send_command(0x3f) self.send_command(0x3f)
self.send_data(lut[153]) self.send_data(lut[153])
self.send_command(0x03); # gate voltage self.send_command(0x03) # gate voltage
self.send_data(lut[154]) self.send_data(lut[154])
self.send_command(0x04); # source voltage self.send_command(0x04) # source voltage
self.send_data(lut[155]) # VSH self.send_data(lut[155]) # VSH
self.send_data(lut[156]) # VSH2 self.send_data(lut[156]) # VSH2
self.send_data(lut[157]) # VSL self.send_data(lut[157]) # VSL
self.send_command(0x2c); # VCOM self.send_command(0x2c) # VCOM
self.send_data(lut[158]) self.send_data(lut[158])
''' '''
function : Setting the display window function : Setting the display window
parameter: parameter:
xstart : X-axis starting position xstart : X-axis starting position
@ -204,7 +204,7 @@ class EPD:
self.send_data(y_end & 0xFF) self.send_data(y_end & 0xFF)
self.send_data((y_end >> 8) & 0xFF) self.send_data((y_end >> 8) & 0xFF)
''' '''
function : Set Cursor function : Set Cursor
parameter: parameter:
x : X-axis starting position x : X-axis starting position
@ -219,7 +219,7 @@ class EPD:
self.send_data(y & 0xFF) self.send_data(y & 0xFF)
self.send_data((y >> 8) & 0xFF) self.send_data((y >> 8) & 0xFF)
''' '''
function : Initialize the e-Paper register function : Initialize the e-Paper register
parameter: parameter:
''' '''
@ -259,11 +259,11 @@ class EPD:
self.SetLut(self.lut_full_update) self.SetLut(self.lut_full_update)
return 0 return 0
''' '''
function : Display images function : Display images
parameter: parameter:
image : Image data image : Image data
''' '''
def getbuffer(self, image): def getbuffer(self, image):
img = image img = image
imwidth, imheight = img.size imwidth, imheight = img.size
@ -297,7 +297,7 @@ class EPD:
self.send_data(image[i + j * linewidth]) self.send_data(image[i + j * linewidth])
self.TurnOnDisplay() self.TurnOnDisplay()
''' '''
function : Sends the image buffer in RAM to e-Paper and partial refresh function : Sends the image buffer in RAM to e-Paper and partial refresh
parameter: parameter:
image : Image data image : Image data
@ -342,7 +342,7 @@ class EPD:
self.send_data(image[i + j * linewidth]) self.send_data(image[i + j * linewidth])
self.TurnOnDisplayPart() self.TurnOnDisplayPart()
''' '''
function : Refresh a base image function : Refresh a base image
parameter: parameter:
image : Image data image : Image data
@ -382,7 +382,7 @@ class EPD:
self.TurnOnDisplay() self.TurnOnDisplay()
''' '''
function : Enter sleep mode function : Enter sleep mode
parameter: parameter:
''' '''