]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/i2cdisplay.py
python 3.7 for actions
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / i2cdisplay.py
index a29422eaba61c744069181174f459c7fa109d85e..b2d38dc808e1c4340522630b889b00b7df56a38c 100644 (file)
@@ -23,20 +23,9 @@ displayio for Blinka
 __version__ = "0.0.0-auto.0"
 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
 
 __version__ = "0.0.0-auto.0"
 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
 
-
 import time
 import busio
 import digitalio
 import time
 import busio
 import digitalio
-import microcontroller
-
-try:
-    from typing import Optional
-except ImportError:
-    pass
-try:
-    from _typing import ReadableBuffer
-except ImportError:
-    pass
 
 
 class I2CDisplay:
 
 
 class I2CDisplay:
@@ -44,13 +33,7 @@ class I2CDisplay:
     It doesn’t handle display initialization.
     """
 
     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
         """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
@@ -93,12 +76,15 @@ class I2CDisplay:
         while not self._i2c.try_lock():
             pass
 
         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.
         """
         """
         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)
 
         if command:
             n = len(data)