Skip to content

Commit b43e4c8

Browse files
committed
Update to CPy 9 display modules
1 parent 84e1345 commit b43e4c8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

adafruit_ssd1327.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@
2626
2727
"""
2828

29-
import displayio
29+
from busdisplay import BusDisplay
30+
31+
try:
32+
from typing import Union
33+
34+
from fourwire import FourWire
35+
from i2cdisplaybus import I2CDisplayBus
36+
except ImportError:
37+
pass
3038

3139
__version__ = "0.0.0+auto.0"
3240
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1327.git"
@@ -52,17 +60,17 @@
5260
)
5361

5462

55-
class SSD1327(displayio.Display):
63+
class SSD1327(BusDisplay):
5664
"""SSD1327 driver
5765
58-
:param ~displayio.I2CDisplay bus: The data bus the display is on
66+
:param bus: The data bus the display is on
5967
:param int height: (keyword-only) The height of the screen
6068
:param int width: (keyword-only) The width of the screen
6169
:param int rotation: (keyword-only) The rotation/orientation of the
6270
screen, in degrees
6371
"""
6472

65-
def __init__(self, bus: displayio.I2CDisplay, **kwargs) -> None:
73+
def __init__(self, bus: Union[FourWire, I2CDisplayBus], **kwargs) -> None:
6674
# Patch the init sequence for 32 pixel high displays.
6775
init_sequence = bytearray(_INIT_SEQUENCE)
6876
height = kwargs["height"]

0 commit comments

Comments
 (0)