Beispiel #1
0
    def init(self):
        """initialize display"""
        self.driver.init()
        Page.init(self)
        Chip.init(self)
        self.driver.reset()

        init_sequence = [0xae, 0xa4, 0xa9, 0xe2, 0xa0, 0xaf]
        for cmd in init_sequence:
            self.driver.cmd(cmd, 0)
            self.driver.cmd(cmd, 1)
Beispiel #2
0
    def init(self):
        """inits a device"""
        self.driver.init()
        Page.init(self)
        Chip.init(self)
        self.driver.reset()
        self.driver.cmd(0xae)  # turn off panel
        self.driver.cmd(0x00)  # set low column address
        self.driver.cmd(0x10)  # set high column address
        self.driver.cmd(0x40)  # set start line address

        self.driver.cmd(0x20)  # addr mode
        self.driver.cmd(0x02)  # horizontal

        self.driver.cmd(0xb0)  # set page address
        self.driver.cmd(0x81)  # set contrast control register
        self.driver.cmd(0xff)
        # a0/a1, a1 = segment 127 to 0, a0:0 to seg127
        self.driver.cmd(self.rotations[self.rotation]['sgmt'])

        # c8/c0 set com(N-1)to com0  c0:com0 to com(N-1)
        self.driver.cmd(self.rotations[self.rotation]['com'])

        self.driver.cmd(0xa6)  # set normal display, a6 - normal, a7 - inverted

        self.driver.cmd(0xa8)  # set multiplex ratio(16to63)
        self.driver.cmd(0x3f)  # 1/64 duty

        self.driver.cmd(0xd3)  # set display offset
        self.driver.cmd(0x00)  # not offset

        # set display clock divide ratio/oscillator frequency
        self.driver.cmd(0xd5)
        self.driver.cmd(0x80)  # set divide ratio

        self.driver.cmd(0xd9)  # set pre-charge period
        self.driver.cmd(0xf1)
        self.driver.cmd(0xda)  # set com pins hardware configuration
        self.driver.cmd(0x12)

        self.driver.cmd(0xdb)  # set vcomh
        self.driver.cmd(0x40)

        self.driver.cmd(0x8d)  # charge pump
        self.driver.cmd(0x14)  # enable charge pump
        self.driver.cmd(0xaf)  # turn on panel
Beispiel #3
0
 def init(self):
     """inits a device"""
     Page.init(self)
     Chip.init(self)