1 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
3 # SPDX-License-Identifier: MIT
6 `displayio.epaperdisplay`
7 ================================================================================
11 **Software and Dependencies:**
14 https://github.com/adafruit/Adafruit_Blinka/releases
16 * Author(s): Melissa LeBlanc-Williams
21 __version__ = "0.0.0-auto.0"
22 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
26 """Manage updating an epaper display over a display bus
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
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.
50 set_column_window_command=None,
51 set_row_window_command=None,
52 set_current_column_command=None,
53 set_current_row_command=None,
54 write_black_ram_command,
55 black_bits_inverted=False,
56 write_color_ram_command=None,
57 color_bits_inverted=False,
58 highlight_color=0x000000,
59 refresh_display_command,
63 seconds_per_frame=180,
64 always_toggle_chip_select=False,
67 # pylint: disable=too-many-locals,unnecessary-pass
69 Create a EPaperDisplay object on the given display bus (displayio.FourWire or
70 displayio.ParallelBus).
72 The start_sequence and stop_sequence are bitpacked to minimize the ram impact. Every
73 command begins with a command byte followed by a byte to determine the parameter
74 count and if a delay is need after. When the top bit of the second byte is 1, the
75 next byte will be the delay time in milliseconds. The remaining 7 bits are the
76 parameter count excluding any delay byte. The third through final bytes are the
77 remaining command parameters. The next byte will begin a new command definition.
80 :param display_bus: The bus that the display is connected to
81 :type _DisplayBus: displayio.FourWire or displayio.ParallelBus
82 :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence.
83 :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence.
84 :param int width: Width in pixels
85 :param int height: Height in pixels
86 :param int ram_width: RAM width in pixels
87 :param int ram_height: RAM height in pixels
88 :param int colstart: The index if the first visible column
89 :param int rowstart: The index if the first visible row
90 :param int rotation: The rotation of the display in degrees clockwise. Must be in
91 90 degree increments (0, 90, 180, 270)
92 :param int set_column_window_command: Command used to set the start and end columns
94 :param int set_row_window_command: Command used so set the start and end rows to update
95 :param int set_current_column_command: Command used to set the current column location
96 :param int set_current_row_command: Command used to set the current row location
97 :param int write_black_ram_command: Command used to write pixels values into the update
99 :param bool black_bits_inverted: True if 0 bits are used to show black pixels. Otherwise,
100 1 means to show black.
101 :param int write_color_ram_command: Command used to write pixels values into the update
103 :param bool color_bits_inverted: True if 0 bits are used to show the color. Otherwise, 1
105 :param int highlight_color: RGB888 of source color to highlight with third ePaper color.
106 :param int refresh_display_command: Command used to start a display refresh
107 :param float refresh_time: Time it takes to refresh the display before the stop_sequence
108 should be sent. Ignored when busy_pin is provided.
109 :param microcontroller.Pin busy_pin: Pin used to signify the display is busy
110 :param bool busy_state: State of the busy pin when the display is busy
111 :param float seconds_per_frame: Minimum number of seconds between screen refreshes
112 :param bool always_toggle_chip_select: When True, chip select is toggled every byte
113 :param bool grayscale: When true, the color ram is the low bit of 2-bit grayscale
117 def show(self, group):
118 # pylint: disable=unnecessary-pass
119 """Switches to displaying the given group of layers. When group is None, the default
120 CircuitPython terminal will be shown (eventually).
125 # pylint: disable=unnecessary-pass
126 """Refreshes the display immediately or raises an exception if too soon. Use
127 ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.
132 def time_to_refresh(self):
133 """Time, in fractional seconds, until the ePaper display can be refreshed."""
138 # pylint: disable=unnecessary-pass
144 # pylint: disable=unnecessary-pass
150 # pylint: disable=unnecessary-pass
151 """Current Display Bus"""