]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - displayio/epaperdisplay.py
Add pre-commit support.
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / epaperdisplay.py
1 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
2 #
3 # SPDX-License-Identifier: MIT
4
5 """
6 `displayio.epaperdisplay`
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
21 __version__ = "0.0.0-auto.0"
22 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
23
24
25 class EPaperDisplay:
26     """Manage updating an epaper display over a display bus
27
28     This initializes an epaper display and connects it into CircuitPython. Unlike other
29     objects in CircuitPython, EPaperDisplay objects live until
30     displayio.release_displays() is called. This is done so that CircuitPython can use
31     the display itself.
32
33     Most people should not use this class directly. Use a specific display driver instead
34     that will contain the startup and shutdown sequences at minimum.
35     """
36
37     def __init__(
38         self,
39         display_bus,
40         start_sequence,
41         stop_sequence,
42         *,
43         width,
44         height,
45         ram_width,
46         ram_height,
47         colstart=0,
48         rowstart=0,
49         rotation=0,
50         set_column_window_command=None,
51         set_row_window_command=None,
52         single_byte_bounds=False,
53         write_black_ram_command,
54         black_bits_inverted=False,
55         write_color_ram_command=None,
56         color_bits_inverted=False,
57         highlight_color=0x000000,
58         refresh_display_command,
59         refresh_time=40,
60         busy_pin=None,
61         busy_state=True,
62         seconds_per_frame=180,
63         always_toggle_chip_select=False
64     ):
65         # pylint: disable=too-many-locals,unnecessary-pass
66         """
67         Create a EPaperDisplay object on the given display bus (displayio.FourWire or
68         displayio.ParallelBus).
69
70         The start_sequence and stop_sequence are bitpacked to minimize the ram impact. Every
71         command begins with a command byte followed by a byte to determine the parameter
72         count and if a delay is need after. When the top bit of the second byte is 1, the
73         next byte will be the delay time in milliseconds. The remaining 7 bits are the
74         parameter count excluding any delay byte. The third through final bytes are the
75         remaining command parameters. The next byte will begin a new command definition.
76         """
77         pass
78
79     def show(self, group):
80         # pylint: disable=unnecessary-pass
81         """Switches to displaying the given group of layers. When group is None, the default
82         CircuitPython terminal will be shown (eventually).
83         """
84         pass
85
86     def refresh(self):
87         # pylint: disable=unnecessary-pass
88         """Refreshes the display immediately or raises an exception if too soon. Use
89         ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.
90         """
91         pass
92
93     @property
94     def time_to_refresh(self):
95         """Time, in fractional seconds, until the ePaper display can be refreshed."""
96         return 0
97
98     @property
99     def width(self):
100         # pylint: disable=unnecessary-pass
101         """Display Width"""
102         pass
103
104     @property
105     def height(self):
106         # pylint: disable=unnecessary-pass
107         """Display Height"""
108         pass
109
110     @property
111     def bus(self):
112         # pylint: disable=unnecessary-pass
113         """Current Display Bus"""
114         pass