adafruit-circuitpython-rgb-display 3.13__py3-none-any.whl → 3.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {adafruit_circuitpython_rgb_display-3.13.dist-info → adafruit_circuitpython_rgb_display-3.14.0.dist-info}/METADATA +6 -5
- adafruit_circuitpython_rgb_display-3.14.0.dist-info/RECORD +16 -0
- {adafruit_circuitpython_rgb_display-3.13.dist-info → adafruit_circuitpython_rgb_display-3.14.0.dist-info}/WHEEL +1 -1
- adafruit_rgb_display/__init__.py +1 -0
- adafruit_rgb_display/gc9a01a.py +4 -3
- adafruit_rgb_display/hx8353.py +5 -3
- adafruit_rgb_display/hx8357.py +11 -9
- adafruit_rgb_display/ili9341.py +6 -6
- adafruit_rgb_display/rgb.py +24 -58
- adafruit_rgb_display/s6d02a1.py +4 -3
- adafruit_rgb_display/ssd1331.py +7 -10
- adafruit_rgb_display/ssd1351.py +6 -4
- adafruit_rgb_display/st7735.py +8 -8
- adafruit_rgb_display/st7789.py +3 -3
- adafruit_circuitpython_rgb_display-3.13.dist-info/RECORD +0 -16
- {adafruit_circuitpython_rgb_display-3.13.dist-info → adafruit_circuitpython_rgb_display-3.14.0.dist-info/licenses}/LICENSE +0 -0
- {adafruit_circuitpython_rgb_display-3.13.dist-info → adafruit_circuitpython_rgb_display-3.14.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: adafruit-circuitpython-rgb-display
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.14.0
|
4
4
|
Summary: CircuitPython library for RGB displays.
|
5
5
|
Author-email: Adafruit Industries <circuitpython@adafruit.com>
|
6
6
|
License: MIT
|
@@ -17,6 +17,7 @@ License-File: LICENSE
|
|
17
17
|
Requires-Dist: Adafruit-Blinka
|
18
18
|
Requires-Dist: adafruit-circuitpython-busdevice
|
19
19
|
Provides-Extra: optional
|
20
|
+
Dynamic: license-file
|
20
21
|
|
21
22
|
Introduction
|
22
23
|
============
|
@@ -33,9 +34,9 @@ Introduction
|
|
33
34
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/actions/
|
34
35
|
:alt: Build Status
|
35
36
|
|
36
|
-
.. image:: https://img.shields.io/badge/
|
37
|
-
:target: https://github.com/
|
38
|
-
:alt: Code Style:
|
37
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
38
|
+
:target: https://github.com/astral-sh/ruff
|
39
|
+
:alt: Code Style: Ruff
|
39
40
|
|
40
41
|
Port of display drivers from https://github.com/adafruit/micropython-adafruit-rgb-display to Adafruit CircuitPython for use on Adafruit's SAMD21-based and other CircuitPython boards.
|
41
42
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
adafruit_circuitpython_rgb_display-3.14.0.dist-info/licenses/LICENSE,sha256=LgLxmuGT-yzOZ0qYCW63SRPvZjD-WMNrJbkyFM0XVOI,1110
|
2
|
+
adafruit_rgb_display/__init__.py,sha256=swPLlB67JAtxLrDjyuS3bWv2uahufIbYsj2u3_cA7t4,210
|
3
|
+
adafruit_rgb_display/gc9a01a.py,sha256=6x6OdzDbzg2aefCDlnveEp0IaNZg1QqdupAQ69Iz4Pw,3559
|
4
|
+
adafruit_rgb_display/hx8353.py,sha256=X9b7-BGwt8tXtgrUJ_YNbRvj1pdeRv2bAn7oLVCv-ZA,1996
|
5
|
+
adafruit_rgb_display/hx8357.py,sha256=rCurUER2T644DKcXUFehHtkQCsFie1_L1p7FnYaVOwM,3498
|
6
|
+
adafruit_rgb_display/ili9341.py,sha256=_iFzVQH3MazZ9y1T8mVIJa7Y8SYxl--vf4Iz2jmMwPQ,3397
|
7
|
+
adafruit_rgb_display/rgb.py,sha256=N9XfksSpGC5EEV51aXA1_cXsb-mLAN_-QXfR9m8cdiw,11020
|
8
|
+
adafruit_rgb_display/s6d02a1.py,sha256=yGMA-xQHsgYZPEA5MqurqebsqMfjtNFbFmnBsa0rveQ,2226
|
9
|
+
adafruit_rgb_display/ssd1331.py,sha256=LIzLYBHODpkmMp-QK9x-khCR84Rv65kLzGLDOiU5RgQ,4093
|
10
|
+
adafruit_rgb_display/ssd1351.py,sha256=uREMBbnlWdpJYWapNSXTeFiF1UCuJziOM0fynQHzwmM,3740
|
11
|
+
adafruit_rgb_display/st7735.py,sha256=nkyqaLI7dWxW3jljRlFro6vxSWEP7uqDnfzfVP8OpFk,8247
|
12
|
+
adafruit_rgb_display/st7789.py,sha256=0EMERq951a9YIqIfiTFly9WTYVHIHkz4TgDNoqBJtXE,3507
|
13
|
+
adafruit_circuitpython_rgb_display-3.14.0.dist-info/METADATA,sha256=1rM7zoP10_vA5BUTaEhrDX2vsDMxeYEt9eP8Dixj0o8,6508
|
14
|
+
adafruit_circuitpython_rgb_display-3.14.0.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
15
|
+
adafruit_circuitpython_rgb_display-3.14.0.dist-info/top_level.txt,sha256=cJwF7_bQzYW5T_mcKLceSSUQ99qb2Bmpz7KdRs_O0tA,21
|
16
|
+
adafruit_circuitpython_rgb_display-3.14.0.dist-info/RECORD,,
|
adafruit_rgb_display/__init__.py
CHANGED
adafruit_rgb_display/gc9a01a.py
CHANGED
@@ -11,9 +11,11 @@ A simple driver for the GC9A01A-based displays.
|
|
11
11
|
"""
|
12
12
|
|
13
13
|
import time
|
14
|
+
|
14
15
|
import busio
|
15
16
|
import digitalio
|
16
17
|
from micropython import const
|
18
|
+
|
17
19
|
from adafruit_rgb_display.rgb import DisplaySPI
|
18
20
|
|
19
21
|
try:
|
@@ -21,7 +23,7 @@ try:
|
|
21
23
|
except ImportError:
|
22
24
|
pass
|
23
25
|
|
24
|
-
__version__ = "3.
|
26
|
+
__version__ = "3.14.0"
|
25
27
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
26
28
|
|
27
29
|
# Command constants
|
@@ -83,7 +85,6 @@ class GC9A01A(DisplaySPI):
|
|
83
85
|
(_DISPON, None), # Display ON
|
84
86
|
)
|
85
87
|
|
86
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
87
88
|
def __init__(
|
88
89
|
self,
|
89
90
|
spi: busio.SPI,
|
@@ -98,7 +99,7 @@ class GC9A01A(DisplaySPI):
|
|
98
99
|
*,
|
99
100
|
x_offset: int = 0,
|
100
101
|
y_offset: int = 0,
|
101
|
-
rotation: int = 0
|
102
|
+
rotation: int = 0,
|
102
103
|
) -> None:
|
103
104
|
super().__init__(
|
104
105
|
spi,
|
adafruit_rgb_display/hx8353.py
CHANGED
@@ -11,17 +11,20 @@ A simple driver for the HX8353-based displays.
|
|
11
11
|
|
12
12
|
* Author(s): Radomir Dopieralski, Michael McWethy, Matt Land
|
13
13
|
"""
|
14
|
+
|
14
15
|
from micropython import const
|
16
|
+
|
15
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
16
18
|
|
17
19
|
try:
|
18
20
|
from typing import Optional
|
19
|
-
|
21
|
+
|
20
22
|
import busio
|
23
|
+
import digitalio
|
21
24
|
except ImportError:
|
22
25
|
pass
|
23
26
|
|
24
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
25
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
26
29
|
|
27
30
|
_SWRESET = const(0x01)
|
@@ -65,7 +68,6 @@ class HX8353(DisplaySPI):
|
|
65
68
|
_ENCODE_PIXEL = ">H"
|
66
69
|
_ENCODE_POS = ">HH"
|
67
70
|
|
68
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
69
71
|
def __init__(
|
70
72
|
self,
|
71
73
|
spi: busio.SPI,
|
adafruit_rgb_display/hx8357.py
CHANGED
@@ -11,17 +11,20 @@ A simple driver for the HX8357-based displays.
|
|
11
11
|
|
12
12
|
* Author(s): Melissa LeBlanc-Williams, Matt Land
|
13
13
|
"""
|
14
|
+
|
14
15
|
from micropython import const
|
16
|
+
|
15
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
16
18
|
|
17
19
|
try:
|
18
20
|
from typing import Optional
|
19
|
-
|
21
|
+
|
20
22
|
import busio
|
23
|
+
import digitalio
|
21
24
|
except ImportError:
|
22
25
|
pass
|
23
26
|
|
24
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
25
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
26
29
|
|
27
30
|
_SWRESET = const(0x01)
|
@@ -72,21 +75,21 @@ class HX8357(DisplaySPI):
|
|
72
75
|
_RAM_READ = _RAMRD
|
73
76
|
_INIT = (
|
74
77
|
(_SWRESET, None),
|
75
|
-
(_SETC, b"\
|
78
|
+
(_SETC, b"\xff\x83\x57"),
|
76
79
|
(_SETRGB, b"\x80\x00\x06\x06"), # 0x80 enables SDO pin (0x00 disables)
|
77
80
|
(_SETCOM, b"\x25"), # -1.52V
|
78
81
|
(_SETOSC, b"\x68"), # Normal mode 70Hz, Idle mode 55 Hz
|
79
82
|
(_SETPANEL, b"\x05"), # BGR, Gate direction swapped
|
80
|
-
(_SETPWR1, b"\x00\x15\
|
81
|
-
(_SETSTBA, b"\x50\x50\x01\
|
83
|
+
(_SETPWR1, b"\x00\x15\x1c\x1c\x83\xaa"), # Not deep standby BT VSPR VSNR AP
|
84
|
+
(_SETSTBA, b"\x50\x50\x01\x3c\x1e\x08"), # OPON normal OPON idle STBA GEN
|
82
85
|
(
|
83
86
|
_SETCYC,
|
84
|
-
b"\x02\x40\x00\
|
87
|
+
b"\x02\x40\x00\x2a\x2a\x0d\x78",
|
85
88
|
), # NW 0x02 RTN DIV DUM DUM GDON GDOFF
|
86
89
|
(
|
87
90
|
_SETGAMMA,
|
88
|
-
b"\x02\
|
89
|
-
b"\
|
91
|
+
b"\x02\x0a\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3a\x27\x1b\x08\x09\x03\x02"
|
92
|
+
b"\x0a\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3a\x27\x1b\x08\x09\x03\x00\x01",
|
90
93
|
),
|
91
94
|
(_COLMOD, b"\x55"), # 16 bit
|
92
95
|
(_MADCTL, b"\xc0"),
|
@@ -99,7 +102,6 @@ class HX8357(DisplaySPI):
|
|
99
102
|
_ENCODE_PIXEL = ">H"
|
100
103
|
_ENCODE_POS = ">HH"
|
101
104
|
|
102
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
103
105
|
def __init__(
|
104
106
|
self,
|
105
107
|
spi: busio.SPI,
|
adafruit_rgb_display/ili9341.py
CHANGED
@@ -11,18 +11,20 @@ A simple driver for the ILI9341/ILI9340-based displays.
|
|
11
11
|
|
12
12
|
* Author(s): Radomir Dopieralski, Michael McWethy, Matt Land
|
13
13
|
"""
|
14
|
+
|
14
15
|
import struct
|
15
16
|
|
16
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
17
18
|
|
18
19
|
try:
|
19
20
|
from typing import Optional
|
20
|
-
|
21
|
+
|
21
22
|
import busio
|
23
|
+
import digitalio
|
22
24
|
except ImportError:
|
23
25
|
pass
|
24
26
|
|
25
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
26
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
27
29
|
|
28
30
|
|
@@ -79,7 +81,6 @@ class ILI9341(DisplaySPI):
|
|
79
81
|
_ENCODE_POS = ">HH"
|
80
82
|
_DECODE_PIXEL = ">BBB"
|
81
83
|
|
82
|
-
# pylint: disable-msg=too-many-arguments
|
83
84
|
def __init__(
|
84
85
|
self,
|
85
86
|
spi: busio.SPI,
|
@@ -107,10 +108,9 @@ class ILI9341(DisplaySPI):
|
|
107
108
|
)
|
108
109
|
self._scroll = 0
|
109
110
|
|
110
|
-
# pylint: enable-msg=too-many-arguments
|
111
|
-
|
112
111
|
def scroll(
|
113
|
-
self,
|
112
|
+
self,
|
113
|
+
dy: Optional[int] = None,
|
114
114
|
) -> Optional[int]:
|
115
115
|
"""Scroll the display by delta y"""
|
116
116
|
if dy is None:
|
adafruit_rgb_display/rgb.py
CHANGED
@@ -16,10 +16,10 @@ import struct
|
|
16
16
|
import time
|
17
17
|
|
18
18
|
try:
|
19
|
-
from typing import
|
20
|
-
import digitalio
|
21
|
-
import busio
|
19
|
+
from typing import Any, ByteString, List, Optional, Tuple, Union
|
22
20
|
|
21
|
+
import busio
|
22
|
+
import digitalio
|
23
23
|
from circuitpython_typing.pil import Image
|
24
24
|
except ImportError:
|
25
25
|
pass
|
@@ -31,7 +31,7 @@ except ImportError:
|
|
31
31
|
|
32
32
|
from adafruit_bus_device import spi_device
|
33
33
|
|
34
|
-
__version__ = "3.
|
34
|
+
__version__ = "3.14.0"
|
35
35
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
36
36
|
|
37
37
|
# This is the size of the buffer to be used for fill operations, in 16-bit
|
@@ -58,9 +58,7 @@ def color565(
|
|
58
58
|
if len(r) >= 3:
|
59
59
|
red, g, b = r[0:3]
|
60
60
|
else:
|
61
|
-
raise ValueError(
|
62
|
-
"Not enough values to unpack (expected 3, got %d)" % len(r)
|
63
|
-
)
|
61
|
+
raise ValueError("Not enough values to unpack (expected 3, got %d)" % len(r))
|
64
62
|
else:
|
65
63
|
red = r
|
66
64
|
return (red & 0xF8) << 8 | (g & 0xFC) << 3 | b >> 3
|
@@ -71,11 +69,7 @@ def image_to_data(image: Image) -> Any:
|
|
71
69
|
# NumPy is much faster at doing this. NumPy code provided by:
|
72
70
|
# Keith (https://www.blogger.com/profile/02555547344016007163)
|
73
71
|
data = numpy.array(image.convert("RGB")).astype("uint16")
|
74
|
-
color = (
|
75
|
-
((data[:, :, 0] & 0xF8) << 8)
|
76
|
-
| ((data[:, :, 1] & 0xFC) << 3)
|
77
|
-
| (data[:, :, 2] >> 3)
|
78
|
-
)
|
72
|
+
color = ((data[:, :, 0] & 0xF8) << 8) | ((data[:, :, 1] & 0xFC) << 3) | (data[:, :, 2] >> 3)
|
79
73
|
return numpy.dstack(((color >> 8) & 0xFF, color & 0xFF)).flatten().tolist()
|
80
74
|
|
81
75
|
|
@@ -118,7 +112,7 @@ class DummyPin:
|
|
118
112
|
pass
|
119
113
|
|
120
114
|
|
121
|
-
class Display:
|
115
|
+
class Display:
|
122
116
|
"""Base class for all RGB display devices
|
123
117
|
:param width: number of pixels wide
|
124
118
|
:param height: number of pixels high
|
@@ -128,8 +122,8 @@ class Display: # pylint: disable-msg=no-member
|
|
128
122
|
_COLUMN_SET: Optional[int] = None
|
129
123
|
_RAM_WRITE: Optional[int] = None
|
130
124
|
_RAM_READ: Optional[int] = None
|
131
|
-
_X_START = 0
|
132
|
-
_Y_START = 0
|
125
|
+
_X_START = 0
|
126
|
+
_Y_START = 0
|
133
127
|
_INIT: Tuple[Tuple[int, Union[ByteString, None]], ...] = ()
|
134
128
|
_ENCODE_PIXEL = ">H"
|
135
129
|
_ENCODE_POS = ">HH"
|
@@ -138,14 +132,12 @@ class Display: # pylint: disable-msg=no-member
|
|
138
132
|
def __init__(self, width: int, height: int, rotation: int) -> None:
|
139
133
|
self.width = width
|
140
134
|
self.height = height
|
141
|
-
if rotation not in
|
135
|
+
if rotation not in {0, 90, 180, 270}:
|
142
136
|
raise ValueError("Rotation must be 0/90/180/270")
|
143
137
|
self._rotation = rotation
|
144
138
|
self.init()
|
145
139
|
|
146
|
-
def write(
|
147
|
-
self, command: Optional[int] = None, data: Optional[ByteString] = None
|
148
|
-
) -> None:
|
140
|
+
def write(self, command: Optional[int] = None, data: Optional[ByteString] = None) -> None:
|
149
141
|
"""Abstract method"""
|
150
142
|
raise NotImplementedError()
|
151
143
|
|
@@ -158,25 +150,18 @@ class Display: # pylint: disable-msg=no-member
|
|
158
150
|
for command, data in self._INIT:
|
159
151
|
self.write(command, data)
|
160
152
|
|
161
|
-
# pylint: disable-msg=invalid-name,too-many-arguments
|
162
153
|
def _block(
|
163
154
|
self, x0: int, y0: int, x1: int, y1: int, data: Optional[ByteString] = None
|
164
155
|
) -> Optional[ByteString]:
|
165
156
|
"""Read or write a block of data."""
|
166
|
-
self.write(
|
167
|
-
|
168
|
-
)
|
169
|
-
self.write(
|
170
|
-
self._PAGE_SET, self._encode_pos(y0 + self._Y_START, y1 + self._Y_START)
|
171
|
-
)
|
157
|
+
self.write(self._COLUMN_SET, self._encode_pos(x0 + self._X_START, x1 + self._X_START))
|
158
|
+
self.write(self._PAGE_SET, self._encode_pos(y0 + self._Y_START, y1 + self._Y_START))
|
172
159
|
if data is None:
|
173
160
|
size = struct.calcsize(self._DECODE_PIXEL)
|
174
161
|
return self.read(self._RAM_READ, (x1 - x0 + 1) * (y1 - y0 + 1) * size)
|
175
162
|
self.write(self._RAM_WRITE, data)
|
176
163
|
return None
|
177
164
|
|
178
|
-
# pylint: enable-msg=invalid-name,too-many-arguments
|
179
|
-
|
180
165
|
def _encode_pos(self, x: int, y: int) -> bytes:
|
181
166
|
"""Encode a position into bytes."""
|
182
167
|
return struct.pack(self._ENCODE_POS, x, y)
|
@@ -189,9 +174,7 @@ class Display: # pylint: disable-msg=no-member
|
|
189
174
|
"""Decode bytes into a pixel color."""
|
190
175
|
return color565(*struct.unpack(self._DECODE_PIXEL, data))
|
191
176
|
|
192
|
-
def pixel(
|
193
|
-
self, x: int, y: int, color: Optional[Union[int, Tuple]] = None
|
194
|
-
) -> Optional[int]:
|
177
|
+
def pixel(self, x: int, y: int, color: Optional[Union[int, Tuple]] = None) -> Optional[int]:
|
195
178
|
"""Read or write a pixel at a given position."""
|
196
179
|
if color is None:
|
197
180
|
return self._decode_pixel(self._block(x, y, x, y)) # type: ignore[arg-type]
|
@@ -212,19 +195,15 @@ class Display: # pylint: disable-msg=no-member
|
|
212
195
|
the supplied origin."""
|
213
196
|
if rotation is None:
|
214
197
|
rotation = self.rotation
|
215
|
-
if not img.mode in
|
198
|
+
if not img.mode in {"RGB", "RGBA"}:
|
216
199
|
raise ValueError("Image must be in mode RGB or RGBA")
|
217
|
-
if rotation not in
|
200
|
+
if rotation not in {0, 90, 180, 270}:
|
218
201
|
raise ValueError("Rotation must be 0/90/180/270")
|
219
202
|
if rotation != 0:
|
220
203
|
img = img.rotate(rotation, expand=True)
|
221
204
|
imwidth, imheight = img.size
|
222
205
|
if x + imwidth > self.width or y + imheight > self.height:
|
223
|
-
raise ValueError(
|
224
|
-
"Image must not exceed dimensions of display ({0}x{1}).".format(
|
225
|
-
self.width, self.height
|
226
|
-
)
|
227
|
-
)
|
206
|
+
raise ValueError(f"Image must not exceed dimensions of display ({self.width}x{self.height}).")
|
228
207
|
if numpy:
|
229
208
|
pixels = bytes(image_to_data(img))
|
230
209
|
else:
|
@@ -237,10 +216,7 @@ class Display: # pylint: disable-msg=no-member
|
|
237
216
|
pixels[2 * (j * imwidth + i) + 1] = pix & 0xFF
|
238
217
|
self._block(x, y, x + imwidth - 1, y + imheight - 1, pixels)
|
239
218
|
|
240
|
-
|
241
|
-
def fill_rectangle(
|
242
|
-
self, x: int, y: int, width: int, height: int, color: Union[int, Tuple]
|
243
|
-
) -> None:
|
219
|
+
def fill_rectangle(self, x: int, y: int, width: int, height: int, color: Union[int, Tuple]) -> None:
|
244
220
|
"""Draw a rectangle at specified position with specified width and
|
245
221
|
height, and fill it with the specified color."""
|
246
222
|
x = min(self.width - 1, max(0, x))
|
@@ -256,8 +232,6 @@ class Display: # pylint: disable-msg=no-member
|
|
256
232
|
self.write(None, data)
|
257
233
|
self.write(None, pixel * rest)
|
258
234
|
|
259
|
-
# pylint: enable-msg=too-many-arguments
|
260
|
-
|
261
235
|
def fill(self, color: Union[int, Tuple] = 0) -> None:
|
262
236
|
"""Fill the whole display with the specified color."""
|
263
237
|
self.fill_rectangle(0, 0, self.width, self.height, color)
|
@@ -277,7 +251,7 @@ class Display: # pylint: disable-msg=no-member
|
|
277
251
|
|
278
252
|
@rotation.setter
|
279
253
|
def rotation(self, val: int) -> None:
|
280
|
-
if val not in
|
254
|
+
if val not in {0, 90, 180, 270}:
|
281
255
|
raise ValueError("Rotation must be 0/90/180/270")
|
282
256
|
self._rotation = val
|
283
257
|
|
@@ -285,7 +259,6 @@ class Display: # pylint: disable-msg=no-member
|
|
285
259
|
class DisplaySPI(Display):
|
286
260
|
"""Base class for SPI type devices"""
|
287
261
|
|
288
|
-
# pylint: disable-msg=too-many-arguments
|
289
262
|
def __init__(
|
290
263
|
self,
|
291
264
|
spi: busio.SPI,
|
@@ -300,23 +273,19 @@ class DisplaySPI(Display):
|
|
300
273
|
*,
|
301
274
|
x_offset: int = 0,
|
302
275
|
y_offset: int = 0,
|
303
|
-
rotation: int = 0
|
276
|
+
rotation: int = 0,
|
304
277
|
):
|
305
|
-
self.spi_device = spi_device.SPIDevice(
|
306
|
-
spi, cs, baudrate=baudrate, polarity=polarity, phase=phase
|
307
|
-
)
|
278
|
+
self.spi_device = spi_device.SPIDevice(spi, cs, baudrate=baudrate, polarity=polarity, phase=phase)
|
308
279
|
self.dc_pin = dc
|
309
280
|
self.rst = rst
|
310
281
|
self.dc_pin.switch_to_output(value=0)
|
311
282
|
if self.rst:
|
312
283
|
self.rst.switch_to_output(value=0)
|
313
284
|
self.reset()
|
314
|
-
self._X_START = x_offset
|
315
|
-
self._Y_START = y_offset
|
285
|
+
self._X_START = x_offset
|
286
|
+
self._Y_START = y_offset
|
316
287
|
super().__init__(width, height, rotation)
|
317
288
|
|
318
|
-
# pylint: enable-msg=too-many-arguments
|
319
|
-
|
320
289
|
def reset(self) -> None:
|
321
290
|
"""Reset the device"""
|
322
291
|
if not self.rst:
|
@@ -326,10 +295,7 @@ class DisplaySPI(Display):
|
|
326
295
|
self.rst.value = 1
|
327
296
|
time.sleep(0.050) # 50 milliseconds
|
328
297
|
|
329
|
-
|
330
|
-
def write(
|
331
|
-
self, command: Optional[int] = None, data: Optional[ByteString] = None
|
332
|
-
) -> None:
|
298
|
+
def write(self, command: Optional[int] = None, data: Optional[ByteString] = None) -> None:
|
333
299
|
"""SPI write to the device: commands and data"""
|
334
300
|
if command is not None:
|
335
301
|
self.dc_pin.value = 0
|
adafruit_rgb_display/s6d02a1.py
CHANGED
@@ -13,16 +13,18 @@ A simple driver for the S6D02A1-based displays.
|
|
13
13
|
"""
|
14
14
|
|
15
15
|
from micropython import const
|
16
|
+
|
16
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
17
18
|
|
18
19
|
try:
|
19
20
|
from typing import Optional
|
20
|
-
|
21
|
+
|
21
22
|
import busio
|
23
|
+
import digitalio
|
22
24
|
except ImportError:
|
23
25
|
pass
|
24
26
|
|
25
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
26
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
27
29
|
|
28
30
|
_SWRESET = const(0x01)
|
@@ -66,7 +68,6 @@ class S6D02A1(DisplaySPI):
|
|
66
68
|
_ENCODE_PIXEL = ">H"
|
67
69
|
_ENCODE_POS = ">HH"
|
68
70
|
|
69
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
70
71
|
def __init__(
|
71
72
|
self,
|
72
73
|
spi: busio.SPI,
|
adafruit_rgb_display/ssd1331.py
CHANGED
@@ -13,16 +13,18 @@ A simple driver for the SSD1331-based displays.
|
|
13
13
|
"""
|
14
14
|
|
15
15
|
from micropython import const
|
16
|
+
|
16
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
17
18
|
|
18
19
|
try:
|
19
|
-
from typing import
|
20
|
-
|
20
|
+
from typing import ByteString, Optional
|
21
|
+
|
21
22
|
import busio
|
23
|
+
import digitalio
|
22
24
|
except ImportError:
|
23
25
|
pass
|
24
26
|
|
25
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
26
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
27
29
|
|
28
30
|
|
@@ -111,8 +113,6 @@ class SSD1331(DisplaySPI):
|
|
111
113
|
_ENCODE_PIXEL = ">H"
|
112
114
|
_ENCODE_POS = ">BB"
|
113
115
|
|
114
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
115
|
-
# super required to allow override of default values
|
116
116
|
def __init__(
|
117
117
|
self,
|
118
118
|
spi: busio.SPI,
|
@@ -125,7 +125,7 @@ class SSD1331(DisplaySPI):
|
|
125
125
|
polarity: int = 0,
|
126
126
|
phase: int = 0,
|
127
127
|
*,
|
128
|
-
rotation: int = 0
|
128
|
+
rotation: int = 0,
|
129
129
|
) -> None:
|
130
130
|
super().__init__(
|
131
131
|
spi,
|
@@ -140,10 +140,7 @@ class SSD1331(DisplaySPI):
|
|
140
140
|
rotation=rotation,
|
141
141
|
)
|
142
142
|
|
143
|
-
|
144
|
-
def write(
|
145
|
-
self, command: Optional[int] = None, data: Optional[ByteString] = None
|
146
|
-
) -> None:
|
143
|
+
def write(self, command: Optional[int] = None, data: Optional[ByteString] = None) -> None:
|
147
144
|
"""write procedure specific to SSD1331"""
|
148
145
|
self.dc_pin.value = command is None
|
149
146
|
with self.spi_device as spi:
|
adafruit_rgb_display/ssd1351.py
CHANGED
@@ -11,17 +11,20 @@ A simple driver for the SSD1351-based displays.
|
|
11
11
|
|
12
12
|
* Author(s): Radomir Dopieralski, Michael McWethy, Matt Land
|
13
13
|
"""
|
14
|
+
|
14
15
|
from micropython import const
|
16
|
+
|
15
17
|
from adafruit_rgb_display.rgb import DisplaySPI
|
16
18
|
|
17
19
|
try:
|
18
20
|
from typing import Optional
|
19
|
-
|
21
|
+
|
20
22
|
import busio
|
23
|
+
import digitalio
|
21
24
|
except ImportError:
|
22
25
|
pass
|
23
26
|
|
24
|
-
__version__ = "3.
|
27
|
+
__version__ = "3.14.0"
|
25
28
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
26
29
|
|
27
30
|
_SETCOLUMN = const(0x15)
|
@@ -104,7 +107,6 @@ class SSD1351(DisplaySPI):
|
|
104
107
|
_ENCODE_PIXEL = ">H"
|
105
108
|
_ENCODE_POS = ">BB"
|
106
109
|
|
107
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
108
110
|
def __init__(
|
109
111
|
self,
|
110
112
|
spi: busio.SPI,
|
@@ -119,7 +121,7 @@ class SSD1351(DisplaySPI):
|
|
119
121
|
*,
|
120
122
|
x_offset: int = 0,
|
121
123
|
y_offset: int = 0,
|
122
|
-
rotation: int = 0
|
124
|
+
rotation: int = 0,
|
123
125
|
):
|
124
126
|
super().__init__(
|
125
127
|
spi,
|
adafruit_rgb_display/st7735.py
CHANGED
@@ -11,19 +11,22 @@ A simple driver for the ST7735-based displays.
|
|
11
11
|
|
12
12
|
* Author(s): Radomir Dopieralski, Michael McWethy, Matt Land
|
13
13
|
"""
|
14
|
+
|
14
15
|
import struct
|
15
16
|
|
16
17
|
from micropython import const
|
18
|
+
|
17
19
|
from adafruit_rgb_display.rgb import DisplaySPI
|
18
20
|
|
19
21
|
try:
|
20
|
-
from typing import Optional, Tuple,
|
21
|
-
|
22
|
+
from typing import ByteString, Optional, Tuple, Union
|
23
|
+
|
22
24
|
import busio
|
25
|
+
import digitalio
|
23
26
|
except ImportError:
|
24
27
|
pass
|
25
28
|
|
26
|
-
__version__ = "3.
|
29
|
+
__version__ = "3.14.0"
|
27
30
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
28
31
|
|
29
32
|
_NOP = const(0x00)
|
@@ -125,7 +128,6 @@ class ST7735(DisplaySPI):
|
|
125
128
|
_ENCODE_PIXEL = ">H"
|
126
129
|
_ENCODE_POS = ">HH"
|
127
130
|
|
128
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
129
131
|
def __init__(
|
130
132
|
self,
|
131
133
|
spi: busio.SPI,
|
@@ -179,15 +181,14 @@ class ST7735R(ST7735):
|
|
179
181
|
(_INVOFF, None),
|
180
182
|
(
|
181
183
|
_GMCTRP1,
|
182
|
-
b"\x02\x1c\x07\x12\x37\x32\x29\x2d" b"\x29\x25\
|
184
|
+
b"\x02\x1c\x07\x12\x37\x32\x29\x2d" b"\x29\x25\x2b\x39\x00\x01\x03\x10",
|
183
185
|
), # Gamma
|
184
186
|
(
|
185
187
|
_GMCTRN1,
|
186
|
-
b"\x03\x1d\x07\x06\
|
188
|
+
b"\x03\x1d\x07\x06\x2e\x2c\x29\x2d" b"\x2e\x2e\x37\x3f\x00\x00\x02\x10",
|
187
189
|
),
|
188
190
|
)
|
189
191
|
|
190
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
191
192
|
def __init__(
|
192
193
|
self,
|
193
194
|
spi: busio.SPI,
|
@@ -276,7 +277,6 @@ class ST7735S(ST7735):
|
|
276
277
|
(_DISPON, None),
|
277
278
|
)
|
278
279
|
|
279
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
280
280
|
def __init__(
|
281
281
|
self,
|
282
282
|
spi: busio.SPI,
|
adafruit_rgb_display/st7789.py
CHANGED
@@ -17,6 +17,7 @@ import struct
|
|
17
17
|
import busio
|
18
18
|
import digitalio
|
19
19
|
from micropython import const
|
20
|
+
|
20
21
|
from adafruit_rgb_display.rgb import DisplaySPI
|
21
22
|
|
22
23
|
try:
|
@@ -24,7 +25,7 @@ try:
|
|
24
25
|
except ImportError:
|
25
26
|
pass
|
26
27
|
|
27
|
-
__version__ = "3.
|
28
|
+
__version__ = "3.14.0"
|
28
29
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git"
|
29
30
|
|
30
31
|
_NOP = const(0x00)
|
@@ -101,7 +102,6 @@ class ST7789(DisplaySPI):
|
|
101
102
|
(_MADCTL, b"\x08"),
|
102
103
|
)
|
103
104
|
|
104
|
-
# pylint: disable-msg=useless-super-delegation, too-many-arguments
|
105
105
|
def __init__(
|
106
106
|
self,
|
107
107
|
spi: busio.SPI,
|
@@ -116,7 +116,7 @@ class ST7789(DisplaySPI):
|
|
116
116
|
*,
|
117
117
|
x_offset: int = 0,
|
118
118
|
y_offset: int = 0,
|
119
|
-
rotation: int = 0
|
119
|
+
rotation: int = 0,
|
120
120
|
) -> None:
|
121
121
|
super().__init__(
|
122
122
|
spi,
|
@@ -1,16 +0,0 @@
|
|
1
|
-
adafruit_rgb_display/__init__.py,sha256=4wOEGnSq7Q63i9G8CW4v5Cdc506UgMEwK_dS8xYpJ5k,209
|
2
|
-
adafruit_rgb_display/gc9a01a.py,sha256=dhlyrKxm8QUupuTQXMiI3VUnvpr29NvZCHL_NUbJYms,3625
|
3
|
-
adafruit_rgb_display/hx8353.py,sha256=VDgoDnzs5GYmTSCcsXIhwLPl0FOf1CSGyCEpsVwwA1w,2062
|
4
|
-
adafruit_rgb_display/hx8357.py,sha256=GOaepoLjzxGj3sE6n88snky_44P7aqyzhC1oBlOKdpg,3564
|
5
|
-
adafruit_rgb_display/ili9341.py,sha256=-hSWY1gOPoLydSPnrOucu-qSlraOjU8ccM-sNp_Q4m8,3510
|
6
|
-
adafruit_rgb_display/rgb.py,sha256=86gyiUZSE9SKMxylYIRlyb5RbIdV66khQ-Ta3Uv0TnU,11770
|
7
|
-
adafruit_rgb_display/s6d02a1.py,sha256=CRVzGpxL9DCMY4X_hrlTxax1SfqRq8gsgu2spaWbtLs,2293
|
8
|
-
adafruit_rgb_display/ssd1331.py,sha256=NgD7b4GlhIJD3lCCR7QaBTvcmngq48ZJybbBa2wZhT8,4262
|
9
|
-
adafruit_rgb_display/ssd1351.py,sha256=Q-UJxjc5CbjL0pEIFYjwlX6tyVBQvV2LSIlYc_QA_3Y,3805
|
10
|
-
adafruit_rgb_display/st7735.py,sha256=bmsQvrA_3R-ko-oM5l1uEEGhKz_MDSg3abq36pVxf9U,8455
|
11
|
-
adafruit_rgb_display/st7789.py,sha256=V-hKFVRVn8SOW7p4HJwz6EQBCEKRG2rrWqBUQNL2mCg,3574
|
12
|
-
adafruit_circuitpython_rgb_display-3.13.dist-info/LICENSE,sha256=LgLxmuGT-yzOZ0qYCW63SRPvZjD-WMNrJbkyFM0XVOI,1110
|
13
|
-
adafruit_circuitpython_rgb_display-3.13.dist-info/METADATA,sha256=ptzfDhjQMqsr2F1LSS9aEpTivxbIIsW61T-293NDhVw,6428
|
14
|
-
adafruit_circuitpython_rgb_display-3.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
15
|
-
adafruit_circuitpython_rgb_display-3.13.dist-info/top_level.txt,sha256=cJwF7_bQzYW5T_mcKLceSSUQ99qb2Bmpz7KdRs_O0tA,21
|
16
|
-
adafruit_circuitpython_rgb_display-3.13.dist-info/RECORD,,
|
File without changes
|