1 # The MIT License (MIT)
3 # Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries
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:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
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
24 `displayio.epaperdisplay`
25 ================================================================================
29 **Software and Dependencies:**
32 https://github.com/adafruit/Adafruit_Blinka/releases
34 * Author(s): Melissa LeBlanc-Williams
39 __version__ = "0.0.0-auto.0"
40 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
42 # pylint: disable=unnecessary-pass, unused-argument
46 """Manage updating an epaper display over a display bus
48 This initializes an epaper display and connects it into CircuitPython. Unlike other
49 objects in CircuitPython, EPaperDisplay objects live until
50 displayio.release_displays() is called. This is done so that CircuitPython can use
53 Most people should not use this class directly. Use a specific display driver instead
54 that will contain the startup and shutdown sequences at minimum.
57 # pylint: disable=too-many-locals
71 set_column_window_command=None,
72 set_row_window_command=None,
73 single_byte_bounds=False,
74 write_black_ram_command,
75 black_bits_inverted=False,
76 write_color_ram_command=None,
77 color_bits_inverted=False,
78 highlight_color=0x000000,
79 refresh_display_command,
83 seconds_per_frame=180,
84 always_toggle_chip_select=False
87 Create a EPaperDisplay object on the given display bus (displayio.FourWire or
88 displayio.ParallelBus).
90 The start_sequence and stop_sequence are bitpacked to minimize the ram impact. Every
91 command begins with a command byte followed by a byte to determine the parameter
92 count and if a delay is need after. When the top bit of the second byte is 1, the
93 next byte will be the delay time in milliseconds. The remaining 7 bits are the
94 parameter count excluding any delay byte. The third through final bytes are the
95 remaining command parameters. The next byte will begin a new command definition.
99 # pylint: enable=too-many-locals
101 def show(self, group):
102 """Switches to displaying the given group of layers. When group is None, the default
103 CircuitPython terminal will be shown (eventually).
108 """Refreshes the display immediately or raises an exception if too soon. Use
109 ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.
114 def time_to_refresh(self):
115 """Time, in fractional seconds, until the ePaper display can be refreshed."""
130 """Current Display Bus"""