Skip to content

Added rotation support and simplified TFT Gizmo code #8

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 2 commits into from
Dec 4, 2019
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
11 changes: 3 additions & 8 deletions adafruit_gizmo/tft_gizmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,15 @@
class TFT_Gizmo(ST7789):
"""Class representing a TFT Gizmo."""

def __init__(self, *, spi=None, cs=None, dc=None, backlight=None):
def __init__(self, *, spi=None, cs=board.RX, dc=board.TX,
backlight=board.A3, rotation=180):
displayio.release_displays()
if spi is None:
import busio
spi = busio.SPI(board.SCL, MOSI=board.SDA)
if cs is None:
cs = board.RX
if dc is None:
dc = board.TX
if backlight is None:
backlight = board.A3
self._display_bus = displayio.FourWire(spi,
command=dc,
chip_select=cs)
super().__init__(self._display_bus, width=240, height=240,
rowstart=80, backlight_pin=backlight,
rotation=180)
rotation=rotation)
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# 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"]
autodoc_mock_imports = ["adafruit_st7789", "digitalio", "busio", "displayio", "board"]


intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
Expand Down