Skip to content

Added EInk HD Gizmo #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions adafruit_gizmo/eink_gizmo.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT

"""
`adafruit_gizmo.tft_gizmo`
`adafruit_gizmo.eink_gizmo`
================================================================================

Helper for the `Tri-Color E-Ink Gizmo <https://www.adafruit.com/product/4428>`_.
Expand All @@ -19,10 +19,11 @@
import board
import displayio
from adafruit_il0373 import IL0373
from adafruit_ssd1681 import SSD1681

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

def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
displayio.release_displays()
Expand All @@ -48,3 +49,33 @@ def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
rotation=180,
highlight_color=0xFF0000,
)


# pylint: disable=invalid-name, too-few-public-methods
class EInk_HD_Gizmo(SSD1681):
"""Class representing a 200x200 Tri-Color EInk HD Gizmo."""

def __init__(self, *, spi=None, cs=None, dc=None, reset=None, busy=None):
displayio.release_displays()
if spi is None:
import busio # pylint: disable=import-outside-toplevel

spi = busio.SPI(board.SCL, MOSI=board.SDA)
if cs is None:
cs = board.RX
if dc is None:
dc = board.TX
if reset is None:
reset = board.A3
self._display_bus = displayio.FourWire(
spi, command=dc, chip_select=cs, reset=reset, baudrate=1000000
)
sleep(1)
super().__init__(
self._display_bus,
width=200,
height=200,
busy_pin=busy,
rotation=180,
highlight_color=0xFF0000,
)
10 changes: 9 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = ["adafruit_st7789", "digitalio", "busio", "displayio", "board"]
autodoc_mock_imports = [
"adafruit_st7789",
"digitalio",
"busio",
"displayio",
"board",
"adafruit_il0373",
"adafruit_ssd1608",
]


intersphinx_mapping = {
Expand Down
8 changes: 8 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ Other examples
.. literalinclude:: ../examples/gizmo_tft_demo.py
:caption: examples/gizmo_tft_demo.py
:linenos:

.. literalinclude:: ../examples/gizmo_tft_thermometer.py
:caption: examples/gizmo_tft_thermometer.py
:linenos:

.. literalinclude:: ../examples/gizmo_eink_simpletest.py
:caption: examples/gizmo_eink_simpletest.py
:linenos:
2 changes: 2 additions & 0 deletions examples/gizmo_eink_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from adafruit_gizmo import eink_gizmo

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

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