]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - paralleldisplay.py
Update to pyproject.toml
[hackapet/Adafruit_Blinka_Displayio.git] / paralleldisplay.py
1 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
2 #
3 # SPDX-License-Identifier: MIT
4
5 """
6 `paralleldisplay`
7 ================================================================================
8
9 paralleldisplay 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 import microcontroller
21 import circuitpython_typing
22
23 __version__ = "0.0.0+auto.0"
24 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
25
26
27 class ParallelBus:
28     """Manage updating a display over 8-bit parallel bus in the background while Python code
29     runs. This protocol may be refered to as 8080-I Series Parallel Interface in datasheets.
30     It doesn't handle display initialization.
31     """
32
33     def __init__(
34         self,
35         *,
36         data0: microcontroller.Pin,
37         command: microcontroller.Pin,
38         chip_select: microcontroller.Pin,
39         write: microcontroller.Pin,
40         read: microcontroller.Pin,
41         reset: microcontroller.Pin,
42         frequency: int = 30000000,
43     ):
44         # pylint: disable=unnecessary-pass
45         """Create a ParallelBus object associated with the given pins. The
46         bus is inferred from data0 by implying the next 7 additional pins on a given GPIO
47         port.
48
49         The parallel bus and pins are then in use by the display until
50         displayio.release_displays() is called even after a reload. (It does this so
51         CircuitPython can use the display after your code is done.) So, the first time you
52         initialize a display bus in code.py you should call
53         :py:func`displayio.release_displays` first, otherwise it will error after the first
54         code.py run.
55         """
56         pass
57
58     def reset(self) -> None:
59         """Performs a hardware reset via the reset pin. Raises an exception if called when
60         no reset pin is available.
61         """
62         raise NotImplementedError("ParallelBus reset has not been implemented yet")
63
64     def send(self, command: int, data: circuitpython_typing.ReadableBuffer) -> None:
65         """Sends the given command value followed by the full set of data. Display state,
66         such as vertical scroll, set via ``send`` may or may not be reset once the code is
67         done.
68         """
69         raise NotImplementedError("ParallelBus send has not been implemented yet")