Skip to content

Commit 900d3af

Browse files
authored
Merge pull request #15 from makermelissa/master
Added EInk HD Gizmo
2 parents 4676d8f + 5dbbb19 commit 900d3af

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

adafruit_gizmo/eink_gizmo.py

100644100755
+33-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44

55
"""
6-
`adafruit_gizmo.tft_gizmo`
6+
`adafruit_gizmo.eink_gizmo`
77
================================================================================
88
99
Helper for the `Tri-Color E-Ink Gizmo <https://www.adafruit.com/product/4428>`_.
@@ -19,10 +19,11 @@
1919
import board
2020
import displayio
2121
from adafruit_il0373 import IL0373
22+
from adafruit_ssd1681 import SSD1681
2223

2324
# pylint: disable=invalid-name, too-few-public-methods
2425
class EInk_Gizmo(IL0373):
25-
"""Class representing a EInk Gizmo."""
26+
"""Class representing a 152x152 Tri-Color EInk Gizmo."""
2627

2728
def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
2829
displayio.release_displays()
@@ -48,3 +49,33 @@ def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
4849
rotation=180,
4950
highlight_color=0xFF0000,
5051
)
52+
53+
54+
# pylint: disable=invalid-name, too-few-public-methods
55+
class EInk_HD_Gizmo(SSD1681):
56+
"""Class representing a 200x200 Tri-Color EInk HD Gizmo."""
57+
58+
def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
59+
displayio.release_displays()
60+
if spi is None:
61+
import busio # pylint: disable=import-outside-toplevel
62+
63+
spi = busio.SPI(board.SCL, MOSI=board.SDA)
64+
if cs is None:
65+
cs = board.RX
66+
if dc is None:
67+
dc = board.TX
68+
if reset is None:
69+
reset = board.A3
70+
self._display_bus = displayio.FourWire(
71+
spi, command=dc, chip_select=cs, reset=reset, baudrate=1000000
72+
)
73+
sleep(1)
74+
super().__init__(
75+
self._display_bus,
76+
width=200,
77+
height=200,
78+
busy_pin=busy,
79+
rotation=180,
80+
highlight_color=0xFF0000,
81+
)

docs/conf.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@
2525
# Uncomment the below if you use native CircuitPython modules such as
2626
# digitalio, micropython and busio. List the modules you use. Without it, the
2727
# autodoc module docs will fail to generate with a warning.
28-
autodoc_mock_imports = ["adafruit_st7789", "digitalio", "busio", "displayio", "board"]
28+
autodoc_mock_imports = [
29+
"adafruit_st7789",
30+
"digitalio",
31+
"busio",
32+
"displayio",
33+
"board",
34+
"adafruit_il0373",
35+
"adafruit_ssd1608",
36+
]
2937

3038

3139
intersphinx_mapping = {

docs/examples.rst

+8
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ Other examples
1313
.. literalinclude:: ../examples/gizmo_tft_demo.py
1414
:caption: examples/gizmo_tft_demo.py
1515
:linenos:
16+
17+
.. literalinclude:: ../examples/gizmo_tft_thermometer.py
18+
:caption: examples/gizmo_tft_thermometer.py
19+
:linenos:
20+
21+
.. literalinclude:: ../examples/gizmo_eink_simpletest.py
22+
:caption: examples/gizmo_eink_simpletest.py
23+
:linenos:

examples/gizmo_eink_simpletest.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from adafruit_gizmo import eink_gizmo
77

88
display = eink_gizmo.EInk_Gizmo()
9+
# Use the below line instead for the 200x200 E-Ink Gizmo
10+
# display = eink_gizmo.EInk_HD_Gizmo()
911

1012
# Create a display group for our screen objects
1113
display_group = displayio.Group()
File renamed without changes.

0 commit comments

Comments
 (0)