def display(self):
        """Write display buffer to physical display."""
        self.command(SSD1306_COLUMNADDR)
        self.command(0)              # Column start address. (0 = reset)
        self.command(self.width-1)   # Column end address.
        self.command(SSD1306_PAGEADDR)
        self.command(0)              # Page start address. (0 = reset)
        self.command(self._pages-1)  # Page end address.
        # Write buffer data.
        if self._spi is not None:
            # Set DC high for data.
            self._gpio.set_high(self._dc)
            # Write buffer.
            self._spi.write(self._buffer)
        else:
            for i in range(0, len(self._buffer), 16):
                control = 0x40   # Co = 0, DC = 0
                self._i2c.writeList(control, self._buffer[i:i+16])
def display ( self ) : self . command ( SSD1306_COLUMNADDR ) self . command ( 0 ) self . command ( self . width - 1 ) self . command ( SSD1306_PAGEADDR ) self . command ( 0 ) self . command ( self . _pages - 1 ) if self . _spi is not None : self . _gpio . set_high ( self . _dc ) self . _spi . write ( self . _buffer ) else : for i in range ( 0 , len ( self . _buffer ) , 16 ) : control = 0x40 self . _i2c . writeList ( control , self . _buffer [ i : i + 16 ] )
Write display buffer to physical display.