Skip to content

Commit

Permalink
Merge pull request #19 from FoamyGuy/9x_compatibility
Browse files Browse the repository at this point in the history
9x compatibility
  • Loading branch information
FoamyGuy committed Apr 1, 2024
2 parents c707c98 + 31d64a8 commit 077f7ab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 9 additions & 3 deletions adafruit_il91874.py
Expand Up @@ -25,7 +25,13 @@
"""

import displayio
# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from epaperdisplay import EPaperDisplay
from fourwire import FourWire
except ImportError:
from displayio import EPaperDisplay, FourWire

__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IL91874.git"
Expand Down Expand Up @@ -67,10 +73,10 @@


# pylint: disable=too-few-public-methods
class IL91874(displayio.EPaperDisplay):
class IL91874(EPaperDisplay):
"""IL91874 display driver"""

def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
def __init__(self, bus: FourWire, **kwargs) -> None:
start_sequence = bytearray(_START_SEQUENCE)

width = kwargs["width"]
Expand Down
11 changes: 10 additions & 1 deletion examples/il91874_simpletest.py
Expand Up @@ -14,6 +14,15 @@
import time
import board
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
# pylint: disable=ungrouped-imports
from displayio import FourWire

import adafruit_il91874

# Used to ensure the display is free in CircuitPython
Expand All @@ -27,7 +36,7 @@
epd_busy = board.D6

# Create the displayio connection to the display pins
display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1) # Wait a bit
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -3,3 +3,4 @@
# SPDX-License-Identifier: Unlicense

Adafruit-Blinka
Adafruit-Blinka-Displayio

0 comments on commit 077f7ab

Please sign in to comment.