예제 #1
0
파일: epd2in7.py 프로젝트: fraserk9/ereader
 def send_data(self, data):
     self.digital_write(self.dc_pin, GPIO.HIGH)
     # the parameter type is list but not int
     # so use [data] instead of data
     epdif.spi_transfer([data])
예제 #2
0
파일: epd2in7.py 프로젝트: fraserk9/ereader
 def send_command(self, command):
     self.digital_write(self.dc_pin, GPIO.LOW)
     # the parameter type is list but not int
     # so use [command] instead of command
     epdif.spi_transfer([command])
예제 #3
0
 def send_data(self, data):
     self.bus.write_byte_data(DEVICE_ADDRESS, 0x35, 0x10) # DC HIGH
     # the parameter type is list but not int
     # so use [data] instead of data
     epdif.spi_transfer([data])
예제 #4
0
 def send_command(self, command):
     self.bus.write_byte_data(DEVICE_ADDRESS, 0x35, 0x00) # DC LOW
     # the parameter type is list but not int
     # so use [command] instead of command
     epdif.spi_transfer([command])
예제 #5
0
 def send_buffer(self, buffer):
     self.digital_write(self.dc_pin, GPIO.HIGH)
     for chunk in (buffer[i:i + 1024]
                   for i in xrange(0, len(buffer), 1024)):
         epdif.spi_transfer(chunk)