]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blob - displayio/i2cdisplay.py
Add pre-commit support.
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / i2cdisplay.py
1 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams for Adafruit Industries
2 #
3 # SPDX-License-Identifier: MIT
4
5 """
6 `displayio.i2cdisplay`
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 __version__ = "0.0.0-auto.0"
21 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
22
23
24 class I2CDisplay:
25     """Manage updating a display over I2C in the background while Python code runs.
26     It doesn’t handle display initialization.
27     """
28
29     def __init__(self, i2c_bus, *, device_address, reset=None):
30         # pylint: disable=unnecessary-pass
31         """Create a I2CDisplay object associated with the given I2C bus and reset pin.
32
33         The I2C bus and pins are then in use by the display until displayio.release_displays() is
34         called even after a reload. (It does this so CircuitPython can use the display after your
35         code is done.) So, the first time you initialize a display bus in code.py you should call
36         :py:func`displayio.release_displays` first, otherwise it will error after the first
37         code.py run.
38         """
39         pass
40
41     def reset(self):
42         """Performs a hardware reset via the reset pin. Raises an exception if called
43         when no reset pin is available.
44         """
45         raise NotImplementedError("I2CDisplay reset has not been implemented yet")
46
47     def send(self, command, data):
48         """Sends the given command value followed by the full set of data. Display state,
49         such as vertical scroll, set via send may or may not be reset once the code is
50         done.
51         """
52         raise NotImplementedError("I2CDisplay send has not been implemented yet")