]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - displayio/parallelbus.py
Add pre-commit support.
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / parallelbus.py
1 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
2 #
3 # SPDX-License-Identifier: MIT
4
5 """
6 `displayio.parallelbus`
7 ================================================================================
8
9 displayio for Blinka
10
11 **Software and Dependencies:**
12
13 * Adafruit Blinka:
14   https://github.com/adafruit/Adafruit_Blinka/releases
15
16 * Author(s): Melissa LeBlanc-Williams
17
18 """
19
20 __version__ = "0.0.0-auto.0"
21 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
22
23
24 class ParallelBus:
25     """Manage updating a display over 8-bit parallel bus in the background while Python code
26     runs. This protocol may be refered to as 8080-I Series Parallel Interface in datasheets.
27     It doesn’t handle display initialization.
28     """
29
30     def __init__(self, i2c_bus, *, device_address, reset=None):
31         # pylint: disable=unnecessary-pass
32         """Create a ParallelBus object associated with the given pins. The
33         bus is inferred from data0 by implying the next 7 additional pins on a given GPIO
34         port.
35
36         The parallel bus and pins are then in use by the display until
37         displayio.release_displays() is called even after a reload. (It does this so
38         CircuitPython can use the display after your code is done.) So, the first time you
39         initialize a display bus in code.py you should call
40         :py:func`displayio.release_displays` first, otherwise it will error after the first
41         code.py run.
42         """
43         pass
44
45     def reset(self):
46         """Performs a hardware reset via the reset pin. Raises an exception if called when
47         no reset pin is available.
48         """
49         raise NotImplementedError("ParallelBus reset has not been implemented yet")
50
51     def send(self, command, data):
52         """Sends the given command value followed by the full set of data. Display state,
53         such as vertical scroll, set via ``send`` may or may not be reset once the code is
54         done.
55         """
56         raise NotImplementedError("ParallelBus send has not been implemented yet")