some lintin
This commit is contained in:
parent
03b18bf71c
commit
c410494ebc
2 changed files with 11 additions and 10 deletions
|
|
@ -50,8 +50,8 @@ _SSD1608_DISP_CTRL1 = const(0x21)
|
||||||
_SSD1608_DISP_CTRL2 = const(0x22)
|
_SSD1608_DISP_CTRL2 = const(0x22)
|
||||||
_SSD1608_WRITE_RAM = const(0x24)
|
_SSD1608_WRITE_RAM = const(0x24)
|
||||||
_SSD1608_READ_RAM = const(0x25)
|
_SSD1608_READ_RAM = const(0x25)
|
||||||
_SSD1608_VCOM_SENSE = const(0x28)
|
_SSD1608_VCOM_SENSE = const(0x28)
|
||||||
_SSD1608_VCOM_DURATION = const(0x29)
|
_SSD1608_VCOM_DURATION = const(0x29)
|
||||||
_SSD1608_WRITE_VCOM = const(0x2C)
|
_SSD1608_WRITE_VCOM = const(0x2C)
|
||||||
_SSD1608_READ_OTP = const(0x2D)
|
_SSD1608_READ_OTP = const(0x2D)
|
||||||
_SSD1608_WRITE_LUT = const(0x32)
|
_SSD1608_WRITE_LUT = const(0x32)
|
||||||
|
|
@ -63,14 +63,14 @@ _SSD1608_SET_RAMYPOS = const(0x45)
|
||||||
_SSD1608_SET_RAMXCOUNT = const(0x4E)
|
_SSD1608_SET_RAMXCOUNT = const(0x4E)
|
||||||
_SSD1608_SET_RAMYCOUNT = const(0x4F)
|
_SSD1608_SET_RAMYCOUNT = const(0x4F)
|
||||||
_SSD1608_NOP = const(0xFF)
|
_SSD1608_NOP = const(0xFF)
|
||||||
_LUT_DATA = b'\x02\x02\x01\x11\x12\x12""fiiYX\x99\x99\x88\x00\x00\x00\x00\xf8\xb4\x13Q5QQ\x19\x01\x00'
|
_LUT_DATA = b'\x02\x02\x01\x11\x12\x12""fiiYX\x99\x99\x88\x00\x00\x00\x00\xf8\xb4\x13Q5QQ\x19\x01\x00' # pylint: disable=line-too-long
|
||||||
|
|
||||||
class Adafruit_SSD1608(Adafruit_EPD):
|
class Adafruit_SSD1608(Adafruit_EPD):
|
||||||
"""driver class for Adafruit SSD1608 ePaper display breakouts"""
|
"""driver class for Adafruit SSD1608 ePaper display breakouts"""
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin):
|
def __init__(self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin):
|
||||||
super(Adafruit_SSD1608, self).__init__(width, height, spi, cs_pin, dc_pin,
|
super(Adafruit_SSD1608, self).__init__(width, height, spi, cs_pin, dc_pin,
|
||||||
sramcs_pin, rst_pin, busy_pin)
|
sramcs_pin, rst_pin, busy_pin)
|
||||||
|
|
||||||
if height % 8 != 0:
|
if height % 8 != 0:
|
||||||
height += (8 - height % 8)
|
height += (8 - height % 8)
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import busio
|
||||||
import board
|
import board
|
||||||
from adafruit_epd.epd import Adafruit_EPD
|
from adafruit_epd.epd import Adafruit_EPD
|
||||||
from adafruit_epd.il0373 import Adafruit_IL0373
|
from adafruit_epd.il0373 import Adafruit_IL0373
|
||||||
from adafruit_epd.il91874 import Adafruit_IL91874
|
from adafruit_epd.il91874 import Adafruit_IL91874 # pylint: disable=unused-import
|
||||||
from adafruit_epd.il0398 import Adafruit_IL0398
|
from adafruit_epd.il0398 import Adafruit_IL0398 # pylint: disable=unused-import
|
||||||
|
from adafruit_epd.ssd1608 import Adafruit_SSD1608 # pylint: disable=unused-import
|
||||||
|
|
||||||
# create the spi device and pins we will need
|
# create the spi device and pins we will need
|
||||||
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
|
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
|
||||||
|
|
@ -16,6 +17,7 @@ busy = digitalio.DigitalInOut(board.D12) # can be None to not use this pin
|
||||||
|
|
||||||
# give them all to our driver
|
# give them all to our driver
|
||||||
print("Creating display")
|
print("Creating display")
|
||||||
|
#display = Adafruit_SSD1608(200, 200, spi, # 1.54" HD mono display
|
||||||
#display = Adafruit_IL91874(176, 264, spi, # 2.7" Tri-color display
|
#display = Adafruit_IL91874(176, 264, spi, # 2.7" Tri-color display
|
||||||
#display = Adafruit_IL0373(152, 152, spi, # 1.54" Tri-color display
|
#display = Adafruit_IL0373(152, 152, spi, # 1.54" Tri-color display
|
||||||
#display = Adafruit_IL0373(128, 296, spi, # 2.9" Tri-color display
|
#display = Adafruit_IL0373(128, 296, spi, # 2.9" Tri-color display
|
||||||
|
|
@ -28,9 +30,9 @@ display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display
|
||||||
#display.set_black_buffer(1, False)
|
#display.set_black_buffer(1, False)
|
||||||
#display.set_color_buffer(1, False)
|
#display.set_color_buffer(1, False)
|
||||||
|
|
||||||
display.rotation = 3
|
display.rotation = 0
|
||||||
|
|
||||||
FILENAME = "blinka.bmp"
|
FILENAME = "blinka154mono.bmp"
|
||||||
|
|
||||||
def read_le(s):
|
def read_le(s):
|
||||||
# as of this writting, int.from_bytes does not have LE support, DIY!
|
# as of this writting, int.from_bytes does not have LE support, DIY!
|
||||||
|
|
@ -44,8 +46,7 @@ def read_le(s):
|
||||||
class BMPError(Exception):
|
class BMPError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def display_bitmap(epd, filename): # pylint: disable=too-many-locals, too-many-branches
|
||||||
def display_bitmap(epd, filename):
|
|
||||||
try:
|
try:
|
||||||
f = open("/" + filename, "rb")
|
f = open("/" + filename, "rb")
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue