]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - paralleldisplay.py
Attempting to fix cryptic docs error
[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 from typing import Optional
21 import microcontroller
22 from circuitpython_typing import ReadableBuffer
23
24 __version__ = "0.0.0+auto.0"
25 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
26
27
28 class ParallelBus:
29     """Manage updating a display over 8-bit parallel bus in the background while Python code
30     runs. This protocol may be refered to as 8080-I Series Parallel Interface in datasheets.
31     It doesn't handle display initialization.
32     """
33
34     def __init__(
35         self,
36         *,
37         data0: microcontroller.Pin,
38         command: microcontroller.Pin,
39         chip_select: microcontroller.Pin,
40         write: microcontroller.Pin,
41         read: Optional[microcontroller.Pin],
42         reset: Optional[microcontroller.Pin] = None,
43         frequency: int = 30000000,
44     ):
45         # pylint: disable=unnecessary-pass
46         """Create a ParallelBus object associated with the given pins. The
47         bus is inferred from data0 by implying the next 7 additional pins on a given GPIO
48         port.
49
50         The parallel bus and pins are then in use by the display until
51         displayio.release_displays() is called even after a reload. (It does this so
52         CircuitPython can use the display after your code is done.) So, the first time you
53         initialize a display bus in code.py you should call
54         :py:func`displayio.release_displays` first, otherwise it will error after the first
55         code.py run.
56         """
57         pass
58
59     def reset(self) -> None:
60         """Performs a hardware reset via the reset pin. Raises an exception if called when
61         no reset pin is available.
62         """
63         raise NotImplementedError("ParallelBus reset has not been implemented yet")
64
65     def send(self, command: int, data: ReadableBuffer) -> None:
66         """Sends the given command value followed by the full set of data. Display state,
67         such as vertical scroll, set via ``send`` may or may not be reset once the code is
68         done.
69         """
70         raise NotImplementedError("ParallelBus send has not been implemented yet")
71
72     def _send(
73         self,
74         _data_type: int,
75         _chip_select: int,
76         _data: ReadableBuffer,
77     ) -> None:
78         pass
79
80     def _free(self) -> bool:
81         """Attempt to free the bus and return False if busy"""
82
83     def _begin_transaction(self) -> bool:
84         pass
85
86     def _end_transaction(self) -> None:
87         pass