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])
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])
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])
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])
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)