Fix indentation on epd2in13_V3.py

Python will not import modules/scripts with mixed indentation.
This commit is contained in:
Avery 2022-01-04 16:56:51 +08:00 committed by GitHub
commit bb221f7be4
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,
] ]
''' '''
@ -102,8 +102,8 @@ class EPD:
epdconfig.delay_ms(2) epdconfig.delay_ms(2)
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:
''' '''
@ -134,8 +134,8 @@ class EPD:
while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy while(epdconfig.digital_read(self.busy_pin) == 1): # 0: idle, 1: busy
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
@ -203,8 +203,8 @@ class EPD:
self.send_data((y_start >> 8) & 0xFF) self.send_data((y_start >> 8) & 0xFF)
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:
''' '''
@ -258,12 +258,12 @@ 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,11 +297,11 @@ 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
''' '''
def displayPartial(self, image): def displayPartial(self, image):
if self.width%8 == 0: if self.width%8 == 0:
linewidth = int(self.width/8) linewidth = int(self.width/8)
@ -341,8 +341,8 @@ class EPD:
for i in range(0, linewidth): for i in range(0, linewidth):
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
@ -381,8 +381,8 @@ class EPD:
self.send_data(color) self.send_data(color)
self.TurnOnDisplay() self.TurnOnDisplay()
''' '''
function : Enter sleep mode function : Enter sleep mode
parameter: parameter:
''' '''