]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - displayio/epaperdisplay.py
aae6b5749575dd530eebafbe66907636ba7afd00
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / epaperdisplay.py
1 # The MIT License (MIT)
2 #
3 # Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 # THE SOFTWARE.
22
23 """
24 `displayio.epaperdisplay`
25 ================================================================================
26
27 displayio for Blinka
28
29 **Software and Dependencies:**
30
31 * Adafruit Blinka:
32   https://github.com/adafruit/Adafruit_Blinka/releases
33
34 * Author(s): Melissa LeBlanc-Williams
35
36 """
37
38
39 __version__ = "0.0.0-auto.0"
40 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
41
42 # pylint: disable=unnecessary-pass, unused-argument
43
44 class EPaperDisplay:
45     """Manage updating an epaper display over a display bus
46
47     This initializes an epaper display and connects it into CircuitPython. Unlike other
48     objects in CircuitPython, EPaperDisplay objects live until
49     displayio.release_displays() is called. This is done so that CircuitPython can use
50     the display itself.
51
52     Most people should not use this class directly. Use a specific display driver instead
53     that will contain the startup and shutdown sequences at minimum.
54     """
55
56     # pylint: disable=too-many-locals
57     def __init__(
58         self,
59         display_bus,
60         start_sequence,
61         stop_sequence,
62         *,
63         width,
64         height,
65         ram_width,
66         ram_height,
67         colstart=0,
68         rowstart=0,
69         rotation=0,
70         set_column_window_command=None,
71         set_row_window_command=None,
72         single_byte_bounds=False,
73         write_black_ram_command,
74         black_bits_inverted=False,
75         write_color_ram_command=None,
76         color_bits_inverted=False,
77         highlight_color=0x000000,
78         refresh_display_command,
79         refresh_time=40,
80         busy_pin=None,
81         busy_state=True,
82         seconds_per_frame=180,
83         always_toggle_chip_select=False
84     ):
85         """
86         Create a EPaperDisplay object on the given display bus (displayio.FourWire or
87         displayio.ParallelBus).
88
89         The start_sequence and stop_sequence are bitpacked to minimize the ram impact. Every
90         command begins with a command byte followed by a byte to determine the parameter
91         count and if a delay is need after. When the top bit of the second byte is 1, the
92         next byte will be the delay time in milliseconds. The remaining 7 bits are the
93         parameter count excluding any delay byte. The third through final bytes are the
94         remaining command parameters. The next byte will begin a new command definition.
95         """
96         pass
97
98     # pylint: enable=too-many-locals
99
100     def show(self, group):
101         """Switches to displaying the given group of layers. When group is None, the default
102         CircuitPython terminal will be shown (eventually).
103         """
104         pass
105
106     def refresh(self):
107         """Refreshes the display immediately or raises an exception if too soon. Use
108         ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.
109         """
110         pass
111
112     @property
113     def time_to_refresh(self):
114         """Time, in fractional seconds, until the ePaper display can be refreshed."""
115         return 0
116
117     @property
118     def width(self):
119         """Display Width"""
120         pass
121
122     @property
123     def height(self):
124         """Display Height"""
125         pass
126
127     @property
128     def bus(self):
129         """Current Display Bus"""
130         pass