Skip to content

Commit d9d7ec7

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

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

adafruit_ssd1327.py

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

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

3138
__version__ = "0.0.0+auto.0"
3239
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1327.git"
@@ -52,17 +59,17 @@
5259
)
5360

5461

55-
class SSD1327(displayio.Display):
62+
class SSD1327(BusDisplay):
5663
"""SSD1327 driver
5764
58-
:param ~displayio.I2CDisplay bus: The data bus the display is on
65+
:param bus: The data bus the display is on
5966
:param int height: (keyword-only) The height of the screen
6067
:param int width: (keyword-only) The width of the screen
6168
:param int rotation: (keyword-only) The rotation/orientation of the
6269
screen, in degrees
6370
"""
6471

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

0 commit comments

Comments
 (0)