示例#1
0
    def Clear(self, color):
        self.send_command(0x10)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(0x00)
        epdconfig.delay_ms(10)

        self.send_command(0x13)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(0xFF)
        epdconfig.delay_ms(10)

        self.SetFullReg()
        self.TurnOnDisplay()
示例#2
0
    def display(self, image):
        self.send_command(0x10)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(0x00)
        epdconfig.delay_ms(10)

        self.send_command(0x13)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(image[i])
        epdconfig.delay_ms(10)

        self.SetFullReg()
        self.TurnOnDisplay()
示例#3
0
 def reset(self):
     epdconfig.digital_write(self.reset_pin, 1)
     epdconfig.delay_ms(200)
     epdconfig.digital_write(self.reset_pin, 0)
     epdconfig.delay_ms(10)
     epdconfig.digital_write(self.reset_pin, 1)
     epdconfig.delay_ms(200)
示例#4
0
    def DisplayPartial(self, image):
        self.SetPartReg()
        self.send_command(0x91)
        self.send_command(0x90)
        self.send_data(0)
        self.send_data(self.width - 1)

        self.send_data(0)
        self.send_data(0)
        self.send_data(int(self.height / 256))
        self.send_data(self.height % 256 - 1)
        self.send_data(0x28)

        self.send_command(0x10)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(image[i])
        epdconfig.delay_ms(10)

        self.send_command(0x13)
        for i in range(0, int(self.width * self.height / 8)):
            self.send_data(~image[i])
        epdconfig.delay_ms(10)

        self.TurnOnDisplay()
示例#5
0
 def ReadBusy(self):
     while (epdconfig.digital_read(
             self.busy_pin) == 1):  #  0: idle, 1: busy
         epdconfig.delay_ms(200)
示例#6
0
 def TurnOnDisplay(self):
     self.send_command(0x12)
     epdconfig.delay_ms(10)
     self.ReadBusy()
示例#7
0
 def ReadBusy(self):
     logging.debug("e-Paper busy")
     while (epdconfig.digital_read(self.busy_pin) == 0):  # 0: idle, 1: busy
         self.send_command(0x71)
         epdconfig.delay_ms(100)
     logging.debug("e-Paper busy release")