created send_command_and_data function
This commit is contained in:
parent
4304c79472
commit
96e61363e9
1 changed files with 8 additions and 5 deletions
|
|
@ -267,9 +267,12 @@ class EPD:
|
||||||
epdconfig.delay_ms(1)
|
epdconfig.delay_ms(1)
|
||||||
logging.debug("e-Paper busy release")
|
logging.debug("e-Paper busy release")
|
||||||
|
|
||||||
def build_look_up_table(self, command, lut):
|
def send_command_and_data(self command, data=None):
|
||||||
self.send_command(command)
|
self.digital_write(self.dc_pin, epdif.GPIO.LOW) # LOW: write command
|
||||||
[self.send_data(data) for data in lut]
|
epdif.spi_writebytes([command])
|
||||||
|
if data:
|
||||||
|
self.digital_write(self.dc_pin, epdif.GPIO.HIGH) # HIGH: write data
|
||||||
|
epdif.spi_writebytes(data)
|
||||||
|
|
||||||
def set_lut(self):
|
def set_lut(self):
|
||||||
look_up_tables = {
|
look_up_tables = {
|
||||||
|
|
@ -280,8 +283,8 @@ class EPD:
|
||||||
LUT_BLACK_TO_BLACK: self.lut_bb
|
LUT_BLACK_TO_BLACK: self.lut_bb
|
||||||
}
|
}
|
||||||
|
|
||||||
for command, lut in look_up_tables.items():
|
for command, data in look_up_tables.items():
|
||||||
self.build_look_up_table(command, lut)
|
self.send_command_and_data(command, data)
|
||||||
|
|
||||||
# self.send_command(LUT_FOR_VCOM) # vcom
|
# self.send_command(LUT_FOR_VCOM) # vcom
|
||||||
# for data in self.lut_vcom_dc:
|
# for data in self.lut_vcom_dc:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue