+++ /dev/null
-# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams
-#
-# SPDX-License-Identifier: MIT
-
-"""
-`_typing`
-================================================================================
-
-Type aliases for Blinka
-
-**Software and Dependencies:**
-
-* Adafruit Blinka:
- https://github.com/adafruit/Adafruit_Blinka/releases
-
-* Author(s): Melissa LeBlanc-Williams
-
-"""
-
-from typing import Union
-
-__version__ = "0.0.0-auto.0"
-__repo__ = "https://github.com/adafruit/Adafruit_Blinka_Displayio.git"
-
-
-WriteableBuffer = Union[
- bytearray,
- memoryview,
- # array.array,
- # ulab.numpy.ndarray,
- # rgbmatrix.RGBMatrix
-]
-
-ReadableBuffer = Union[
- bytes,
- WriteableBuffer,
-]
from PIL import Image
import numpy
import microcontroller
-import _typing
+import circuitpython_typing
from ._displaycore import _DisplayCore
from ._displaybus import _DisplayBus
from ._colorconverter import ColorConverter
def __init__(
self,
display_bus: _DisplayBus,
- init_sequence: _typing.ReadableBuffer,
+ init_sequence: circuitpython_typing.ReadableBuffer,
*,
width: int,
height: int,
return struct.pack(self._bounds_encoding, x, y) # pylint: disable=no-member
def fill_row(
- self, y: int, buffer: _typing.WriteableBuffer
- ) -> _typing.WriteableBuffer:
+ self, y: int, buffer: circuitpython_typing.WriteableBuffer
+ ) -> circuitpython_typing.WriteableBuffer:
"""Extract the pixels from a single row"""
for x in range(0, self._width):
_rgb_565 = self._colorconverter.convert(self._buffer.getpixel((x, y)))
from typing import Union
-import _typing
+import circuitpython_typing
from paralleldisplay import ParallelBus
from ._fourwire import FourWire
from ._group import Group
self._current_group._in_group = False
def fill_area(
- self, area: Area, mask: _typing.WriteableBuffer, buffer: _typing.WriteableBuffer
+ self,
+ area: Area,
+ mask: circuitpython_typing.WriteableBuffer,
+ buffer: circuitpython_typing.WriteableBuffer,
) -> bool:
# pylint: disable=protected-access
"""Call the current group's fill area function"""
return True
def send(
- self, data_type: int, chip_select: int, data: _typing.ReadableBuffer
+ self,
+ data_type: int,
+ chip_select: int,
+ data: circuitpython_typing.ReadableBuffer,
) -> None:
"""
Send the data to the current bus
from typing import Optional
import microcontroller
-import _typing
+import circuitpython_typing
from ._group import Group
from ._displaybus import _DisplayBus
def __init__(
self,
display_bus: _DisplayBus,
- start_sequence: _typing.ReadableBuffer,
- stop_sequence: _typing.ReadableBuffer,
+ start_sequence: circuitpython_typing.ReadableBuffer,
+ stop_sequence: circuitpython_typing.ReadableBuffer,
*,
width: int,
height: int,
:param display_bus: The bus that the display is connected to
:type _DisplayBus: displayio.FourWire or displayio.ParallelBus
- :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence.
- :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence.
+ :param ~circuitpython_typing.ReadableBuffer start_sequence: Byte-packed
+ initialization sequence.
+ :param ~circuitpython_typing.ReadableBuffer stop_sequence: Byte-packed
+ initialization sequence.
:param int width: Width in pixels
:param int height: Height in pixels
:param int ram_width: RAM width in pixels
import digitalio
import busio
import microcontroller
-import _typing
+import circuitpython_typing
from ._constants import (
CHIP_SELECT_TOGGLE_EVERY_BYTE,
CHIP_SELECT_UNTOUCHED,
time.sleep(0.001)
def send(
- self, command, data: _typing.ReadableBuffer, *, toggle_every_byte: bool = False
+ self,
+ command,
+ data: circuitpython_typing.ReadableBuffer,
+ *,
+ toggle_every_byte: bool = False,
) -> None:
"""
Sends the given command value followed by the full set of data. Display state,
self._send(DISPLAY_DATA, chip_select, data)
self._end_transaction()
- def _send(self, data_type: int, chip_select: int, data: _typing.ReadableBuffer):
+ def _send(
+ self,
+ data_type: int,
+ chip_select: int,
+ data: circuitpython_typing.ReadableBuffer,
+ ):
self._dc.value = data_type == DISPLAY_DATA
if chip_select == CHIP_SELECT_TOGGLE_EVERY_BYTE:
for byte in data:
import time
import busio
import digitalio
-import _typing
+import circuitpython_typing
from ._constants import CHIP_SELECT_UNTOUCHED, DISPLAY_COMMAND
__version__ = "0.0.0-auto.0"
while not self._i2c.try_lock():
pass
- def send(self, command: int, data: _typing.ReadableBuffer) -> None:
+ def send(self, command: int, data: circuitpython_typing.ReadableBuffer) -> None:
"""
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
self._send(DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, bytes([command] + data))
self._end_transaction()
- def _send(self, data_type: int, chip_select: int, data: _typing.ReadableBuffer):
+ def _send(
+ self,
+ data_type: int,
+ chip_select: int,
+ data: circuitpython_typing.ReadableBuffer,
+ ):
# pylint: disable=unused-argument
if data_type == DISPLAY_COMMAND:
n = len(data)
"""
from typing import Optional, Union, Tuple
-import _typing
+import circuitpython_typing
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
def __setitem__(
self,
index: int,
- value: Union[int, _typing.ReadableBuffer, Tuple[int, int, int]],
+ value: Union[int, circuitpython_typing.ReadableBuffer, Tuple[int, int, int]],
) -> None:
"""Sets the pixel color at the given index. The index should be
an integer in the range 0 to color_count-1.
"""
import microcontroller
-import _typing
+import circuitpython_typing
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
"""
raise NotImplementedError("ParallelBus reset has not been implemented yet")
- def send(self, command: int, data: _typing.ReadableBuffer) -> None:
+ def send(self, command: int, data: circuitpython_typing.ReadableBuffer) -> None:
"""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.
#
# SPDX-License-Identifier: Unlicense
-Adafruit-Blinka
+Adafruit-Blinka>=7.0.0
+adafruit-circuitpython-typing
pillow
numpy
author="Adafruit Industries",
author_email="circuitpython@adafruit.com",
install_requires=[
- "Adafruit-Blinka",
+ "Adafruit-Blinka>=7.0.0",
+ "adafruit-circuitpython-typing",
"pillow",
"numpy",
],
keywords="adafruit blinka circuitpython micropython displayio lcd tft display pitft",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
- py_modules=["fontio", "terminalio", "paralleldisplay", "_typing"],
+ py_modules=["fontio", "terminalio", "paralleldisplay"],
packages=["displayio"],
)