X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/09889f5e46420240ade4451f7af6f54814f8cfcd:/displayio/_epaperdisplay.py..6776bc60e1de38034ece8570028db4317a40f54b:/epaperdisplay/__init__.py diff --git a/displayio/_epaperdisplay.py b/epaperdisplay/__init__.py similarity index 95% rename from displayio/_epaperdisplay.py rename to epaperdisplay/__init__.py index 6ce0664..d5b7b75 100644 --- a/displayio/_epaperdisplay.py +++ b/epaperdisplay/__init__.py @@ -3,10 +3,10 @@ # SPDX-License-Identifier: MIT """ -`displayio.epaperdisplay` +`epaperdisplay` ================================================================================ -displayio for Blinka +epaperdisplay for Blinka **Software and Dependencies:** @@ -22,12 +22,12 @@ from typing import Optional, Union import microcontroller from digitalio import DigitalInOut from circuitpython_typing import ReadableBuffer -from ._displaycore import _DisplayCore -from ._group import Group, circuitpython_splash -from ._colorconverter import ColorConverter -from ._displaybus import _DisplayBus -from ._area import Area -from ._constants import ( +from busdisplay._displaybus import _DisplayBus +from displayio._displaycore import _DisplayCore +from displayio._group import Group, circuitpython_splash +from displayio._colorconverter import ColorConverter +from displayio._area import Area +from displayio._constants import ( CHIP_SELECT_TOGGLE_EVERY_BYTE, CHIP_SELECT_UNTOUCHED, DISPLAY_COMMAND, @@ -88,8 +88,8 @@ class EPaperDisplay: address_little_endian: bool = False, ) -> None: # pylint: disable=too-many-locals - """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or - `paralleldisplay.ParallelBus`). + """Create a EPaperDisplay object on the given display bus (`fourwire.FourWire` or + `paralleldisplaybus.ParallelBus`). The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every command begins with a command byte followed by a byte to determine the parameter count and @@ -101,7 +101,7 @@ class EPaperDisplay: definition. :param display_bus: The bus that the display is connected to - :type _DisplayBus: displayio.FourWire or paralleldisplay.ParallelBus + :type _DisplayBus: fourwire.FourWire or paralleldisplaybus.ParallelBus :param ~circuitpython_typing.ReadableBuffer start_sequence: Byte-packed command sequence. :param ~circuitpython_typing.ReadableBuffer stop_sequence: Byte-packed command sequence. :param int width: Width in pixels @@ -161,6 +161,8 @@ class EPaperDisplay: self._refreshing = False color_depth = 1 core_grayscale = True + # Disable while initializing + self._ticks_disabled = True if advanced_color_epaper: color_depth = 4 @@ -235,10 +237,10 @@ class EPaperDisplay: if highlight_color == 0x00 and write_color_ram_command != NO_COMMAND: """TODO: Clear""" - self.show(circuitpython_splash) + self._set_root_group(circuitpython_splash) def __new__(cls, *args, **kwargs): - from . import ( # pylint: disable=import-outside-toplevel, cyclic-import + from displayio import ( # pylint: disable=import-outside-toplevel, cyclic-import allocate_display, ) @@ -246,18 +248,9 @@ class EPaperDisplay: allocate_display(display_instance) return display_instance - def show(self, group: Group) -> None: - # pylint: disable=unnecessary-pass - """ - .. note:: `show()` is deprecated and will be removed when CircuitPython 9.0.0 - is released. Use ``.root_group = group`` instead. - - Switches to displaying the given group of layers. When group is None, the default - CircuitPython terminal will be shown (eventually). - """ - if group is None: - group = circuitpython_splash - self._core.set_root_group(group) + @staticmethod + def show(_group: Group) -> None: # pylint: disable=missing-function-docstring + raise AttributeError(".show(x) removed. Use .root_group = x") def _set_root_group(self, root_group: Group) -> None: ok = self._core.set_root_group(root_group)