]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/i2cdisplay.py
fix _shade() looking up color on Palette. update docs/conf.py and setup.py for python3.7
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / i2cdisplay.py
index 238f98dda33f3c64b62e85db3d6ec6c21f450b6c..b2d38dc808e1c4340522630b889b00b7df56a38c 100644 (file)
@@ -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)