__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
-except ImportError:
- pass
-try:
- from _typing import ReadableBuffer
-except ImportError:
- pass
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
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)