瀏覽代碼

Merge pull request #218 from nullableVoidPtr/patch-1

Fix indentation on epd2in13_V3.py
Sherlock 3 年之前
父節點
當前提交
130e685e7d
共有 1 個文件被更改,包括 49 次插入49 次删除
  1. 49 49
      RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V3.py

+ 49 - 49
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V3.py

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