X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/94342b1947ee2913c581317d280d9dab4e85f374..3e71b56944b2f39930bd2d50a387042a6c6d6fcc:/displayio/i2cdisplay.py diff --git a/displayio/i2cdisplay.py b/displayio/i2cdisplay.py index 238f98d..b2d38dc 100644 --- a/displayio/i2cdisplay.py +++ b/displayio/i2cdisplay.py @@ -23,17 +23,9 @@ displayio for Blinka __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git" - import time import busio import digitalio -import microcontroller - -try: - from typing import Optional - from typing import ReadableBuffer -except ImportError: - pass class I2CDisplay: @@ -41,13 +33,7 @@ class I2CDisplay: It doesn’t handle display initialization. """ - def __init__( - self, - i2c_bus: busio.I2C, - *, - device_address: int, - reset: Optional[microcontroller.Pin] = None - ): + def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset=None): """Create a I2CDisplay object associated with the given I2C bus and reset pin. The I2C bus and pins are then in use by the display until displayio.release_displays() is @@ -90,12 +76,15 @@ class I2CDisplay: while not self._i2c.try_lock(): pass - def send(self, command: bool, data: ReadableBuffer) -> None: + def send(self, command: bool, data, *, toggle_every_byte=False) -> None: + # pylint: disable=unused-argument """ Sends the given command value followed by the full set of data. Display state, such as vertical scroll, set via ``send`` may or may not be reset once the code is done. """ + # NOTE: we have to have a toggle_every_byte parameter, which we ignore, + # because Display._write() sets it regardless of bus type. if command: n = len(data)