Skip to content

Commit 109182c

Browse files
authored
Merge pull request #8 from makermelissa/master
Added rotation support and simplified TFT Gizmo code
2 parents 4559f5a + b397bca commit 109182c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

adafruit_gizmo/tft_gizmo.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,15 @@
4040
class TFT_Gizmo(ST7789):
4141
"""Class representing a TFT Gizmo."""
4242

43-
def __init__(self, *, spi=None, cs=None, dc=None, backlight=None):
43+
def __init__(self, *, spi=None, cs=board.RX, dc=board.TX,
44+
backlight=board.A3, rotation=180):
4445
displayio.release_displays()
4546
if spi is None:
4647
import busio
4748
spi = busio.SPI(board.SCL, MOSI=board.SDA)
48-
if cs is None:
49-
cs = board.RX
50-
if dc is None:
51-
dc = board.TX
52-
if backlight is None:
53-
backlight = board.A3
5449
self._display_bus = displayio.FourWire(spi,
5550
command=dc,
5651
chip_select=cs)
5752
super().__init__(self._display_bus, width=240, height=240,
5853
rowstart=80, backlight_pin=backlight,
59-
rotation=180)
54+
rotation=rotation)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Uncomment the below if you use native CircuitPython modules such as
2121
# digitalio, micropython and busio. List the modules you use. Without it, the
2222
# autodoc module docs will fail to generate with a warning.
23-
autodoc_mock_imports = ["adafruit_st7789", "digitalio", "busio", "displayio"]
23+
autodoc_mock_imports = ["adafruit_st7789", "digitalio", "busio", "displayio", "board"]
2424

2525

2626
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)}

0 commit comments

Comments
 (0)