adafruit-circuitpython-rgb-display 3.13__tar.gz → 3.14.1__tar.gz

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.
Files changed (63) hide show
  1. adafruit_circuitpython_rgb_display-3.14.1/.gitattributes +11 -0
  2. adafruit_circuitpython_rgb_display-3.14.1/.pre-commit-config.yaml +21 -0
  3. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.readthedocs.yaml +1 -1
  4. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/PKG-INFO +6 -5
  5. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/README.rst +3 -3
  6. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_circuitpython_rgb_display.egg-info/PKG-INFO +6 -5
  7. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_circuitpython_rgb_display.egg-info/SOURCES.txt +2 -1
  8. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/__init__.py +1 -0
  9. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/gc9a01a.py +4 -3
  10. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/hx8353.py +5 -3
  11. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/hx8357.py +11 -9
  12. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/ili9341.py +6 -6
  13. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/rgb.py +24 -58
  14. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/s6d02a1.py +4 -3
  15. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/ssd1331.py +7 -10
  16. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/ssd1351.py +6 -4
  17. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/st7735.py +8 -8
  18. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_rgb_display/st7789.py +3 -3
  19. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/api.rst +3 -0
  20. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/conf.py +2 -8
  21. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_eyespi_beret_animated_gif.py +19 -16
  22. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_fbcp.py +12 -14
  23. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_hx8357test.py +5 -6
  24. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_ili9341test.py +5 -7
  25. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_minipitftstats.py +5 -4
  26. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_pillow_animated_gif.py +17 -18
  27. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_pillow_bonnet_buttons.py +7 -13
  28. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_pillow_demo.py +11 -12
  29. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_pillow_image.py +11 -9
  30. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_pillow_stats.py +13 -11
  31. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_simpletest.py +5 -6
  32. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/pyproject.toml +1 -1
  33. adafruit_circuitpython_rgb_display-3.14.1/ruff.toml +101 -0
  34. adafruit_circuitpython_rgb_display-3.13/.pre-commit-config.yaml +0 -42
  35. adafruit_circuitpython_rgb_display-3.13/.pylintrc +0 -399
  36. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
  37. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.github/workflows/build.yml +0 -0
  38. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.github/workflows/failure-help-text.yml +0 -0
  39. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.github/workflows/release_gh.yml +0 -0
  40. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.github/workflows/release_pypi.yml +0 -0
  41. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/.gitignore +0 -0
  42. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/CODE_OF_CONDUCT.md +0 -0
  43. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/LICENSE +0 -0
  44. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/LICENSES/CC-BY-4.0.txt +0 -0
  45. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/LICENSES/MIT.txt +0 -0
  46. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/LICENSES/Unlicense.txt +0 -0
  47. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/README.rst.license +0 -0
  48. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_circuitpython_rgb_display.egg-info/dependency_links.txt +0 -0
  49. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_circuitpython_rgb_display.egg-info/requires.txt +0 -0
  50. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/adafruit_circuitpython_rgb_display.egg-info/top_level.txt +0 -0
  51. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/_static/favicon.ico +0 -0
  52. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/_static/favicon.ico.license +0 -0
  53. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/api.rst.license +0 -0
  54. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/examples.rst +0 -0
  55. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/examples.rst.license +0 -0
  56. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/index.rst +0 -0
  57. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/index.rst.license +0 -0
  58. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/docs/requirements.txt +0 -0
  59. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/examples/rgb_display_minipitfttest.py +2 -2
  60. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/mypy.ini +0 -0
  61. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/optional_requirements.txt +0 -0
  62. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/requirements.txt +0 -0
  63. {adafruit_circuitpython_rgb_display-3.13 → adafruit_circuitpython_rgb_display-3.14.1}/setup.cfg +0 -0
@@ -0,0 +1,11 @@
1
+ # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
2
+ #
3
+ # SPDX-License-Identifier: Unlicense
4
+
5
+ .py text eol=lf
6
+ .rst text eol=lf
7
+ .txt text eol=lf
8
+ .yaml text eol=lf
9
+ .toml text eol=lf
10
+ .license text eol=lf
11
+ .md text eol=lf
@@ -0,0 +1,21 @@
1
+ # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
2
+ #
3
+ # SPDX-License-Identifier: Unlicense
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v4.5.0
8
+ hooks:
9
+ - id: check-yaml
10
+ - id: end-of-file-fixer
11
+ - id: trailing-whitespace
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.3.4
14
+ hooks:
15
+ - id: ruff-format
16
+ - id: ruff
17
+ args: ["--fix"]
18
+ - repo: https://github.com/fsfe/reuse-tool
19
+ rev: v3.0.1
20
+ hooks:
21
+ - id: reuse
@@ -12,7 +12,7 @@ sphinx:
12
12
  configuration: docs/conf.py
13
13
 
14
14
  build:
15
- os: ubuntu-20.04
15
+ os: ubuntu-lts-latest
16
16
  tools:
17
17
  python: "3"
18
18
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: adafruit-circuitpython-rgb-display
3
- Version: 3.13
3
+ Version: 3.14.1
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/code%20style-black-000000.svg
37
- :target: https://github.com/psf/black
38
- :alt: Code Style: Black
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
 
@@ -13,9 +13,9 @@ Introduction
13
13
  :target: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/actions/
14
14
  :alt: Build Status
15
15
 
16
- .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
17
- :target: https://github.com/psf/black
18
- :alt: Code Style: Black
16
+ .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
17
+ :target: https://github.com/astral-sh/ruff
18
+ :alt: Code Style: Ruff
19
19
 
20
20
  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.
21
21
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: adafruit-circuitpython-rgb-display
3
- Version: 3.13
3
+ Version: 3.14.1
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/code%20style-black-000000.svg
37
- :target: https://github.com/psf/black
38
- :alt: Code Style: Black
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
 
@@ -1,6 +1,6 @@
1
+ .gitattributes
1
2
  .gitignore
2
3
  .pre-commit-config.yaml
3
- .pylintrc
4
4
  .readthedocs.yaml
5
5
  CODE_OF_CONDUCT.md
6
6
  LICENSE
@@ -10,6 +10,7 @@ mypy.ini
10
10
  optional_requirements.txt
11
11
  pyproject.toml
12
12
  requirements.txt
13
+ ruff.toml
13
14
  .github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md
14
15
  .github/workflows/build.yml
15
16
  .github/workflows/failure-help-text.yml
@@ -3,4 +3,5 @@
3
3
  # SPDX-License-Identifier: MIT
4
4
 
5
5
  """Auto imports for Adafruit_CircuitPython_RGB_Display"""
6
+
6
7
  from adafruit_rgb_display.rgb import color565
@@ -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.13"
26
+ __version__ = "3.14.1"
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,
@@ -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
- import digitalio
21
+
20
22
  import busio
23
+ import digitalio
21
24
  except ImportError:
22
25
  pass
23
26
 
24
- __version__ = "3.13"
27
+ __version__ = "3.14.1"
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,
@@ -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
- import digitalio
21
+
20
22
  import busio
23
+ import digitalio
21
24
  except ImportError:
22
25
  pass
23
26
 
24
- __version__ = "3.13"
27
+ __version__ = "3.14.1"
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"\xFF\x83\x57"),
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\x1C\x1C\x83\xAA"), # Not deep standby BT VSPR VSNR AP
81
- (_SETSTBA, b"\x50\x50\x01\x3C\x1E\x08"), # OPON normal OPON idle STBA GEN
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\x2A\x2A\x0D\x78",
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\x0A\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x02"
89
- b"\x0A\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x00\x01",
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,
@@ -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
- import digitalio
21
+
21
22
  import busio
23
+ import digitalio
22
24
  except ImportError:
23
25
  pass
24
26
 
25
- __version__ = "3.13"
27
+ __version__ = "3.14.1"
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, dy: Optional[int] = None # pylint: disable-msg=invalid-name
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:
@@ -16,10 +16,10 @@ import struct
16
16
  import time
17
17
 
18
18
  try:
19
- from typing import Optional, Union, Tuple, List, Any, ByteString
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.13"
34
+ __version__ = "3.14.1"
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: # pylint: disable-msg=no-member
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 # pylint: disable=invalid-name
132
- _Y_START = 0 # pylint: disable=invalid-name
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 (0, 90, 180, 270):
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
- self._COLUMN_SET, self._encode_pos(x0 + self._X_START, x1 + self._X_START)
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 ("RGB", "RGBA"):
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 (0, 90, 180, 270):
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
- # pylint: disable-msg=too-many-arguments
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 (0, 90, 180, 270):
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 # pylint: disable=invalid-name
315
- self._Y_START = y_offset # pylint: disable=invalid-name
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
- # pylint: disable=no-member
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
@@ -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
- import digitalio
21
+
21
22
  import busio
23
+ import digitalio
22
24
  except ImportError:
23
25
  pass
24
26
 
25
- __version__ = "3.13"
27
+ __version__ = "3.14.1"
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,
@@ -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 Optional, ByteString
20
- import digitalio
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.13"
27
+ __version__ = "3.14.1"
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
- # pylint: disable=no-member
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:
@@ -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
- import digitalio
21
+
20
22
  import busio
23
+ import digitalio
21
24
  except ImportError:
22
25
  pass
23
26
 
24
- __version__ = "3.13"
27
+ __version__ = "3.14.1"
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,