Skip to content

Commit 901318c

Browse files
authored
Merge pull request #7 from prcutler/root-group-fix
Update with display.root_group for CircuitPython 9 compatibility
2 parents 04f3216 + 8ba9146 commit 901318c

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Usage Example
121121
epd_reset = board.D11
122122
epd_busy = board.D12
123123
124-
display_bus = displayio.FourWire(
124+
display_bus = fourwire.FourWire(
125125
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
126126
)
127127
@@ -138,7 +138,7 @@ Usage Example
138138
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
139139
g.append(t)
140140
141-
display.show(g)
141+
display.root_group = g
142142
143143
display.refresh()
144144

adafruit_spd1656.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import struct
2525

26-
import displayio
26+
import epaperdisplay
2727

2828
__version__ = "0.0.0+auto.0"
2929
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SPD1656.git"
@@ -48,7 +48,7 @@
4848

4949

5050
# pylint: disable=too-few-public-methods
51-
class SPD1656(displayio.EPaperDisplay):
51+
class SPD1656(epaperdisplay.EPaperDisplay):
5252
r"""SPD1656 display driver
5353
5454
:param bus: The data bus the display is on

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Uncomment the below if you use native CircuitPython modules such as
2828
# digitalio, micropython and busio. List the modules you use. Without it, the
2929
# autodoc module docs will fail to generate with a warning.
30-
# autodoc_mock_imports = ["digitalio", "busio"]
30+
autodoc_mock_imports = ["epaperdisplay"]
3131

3232
autodoc_preserve_defaults = True
3333

examples/spd1656_4in_acep.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
import time
1212
import board
1313
import displayio
14+
import fourwire
1415
import adafruit_spd1656
1516

17+
1618
displayio.release_displays()
1719

1820
# This pinout works on a Feather RP2040 and may need to be altered for other boards.
@@ -22,7 +24,7 @@
2224
epd_reset = board.D11
2325
epd_busy = board.D12
2426

25-
display_bus = displayio.FourWire(
27+
display_bus = fourwire.FourWire(
2628
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
2729
)
2830

@@ -39,7 +41,7 @@
3941
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
4042
g.append(t)
4143

42-
display.show(g)
44+
display.root_group = g
4345

4446
display.refresh()
4547

examples/spd1656_color_stripes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
import board
1111
import displayio
1212
import bitmaptools
13+
import fourwire
1314
import adafruit_spd1656
1415

16+
1517
displayio.release_displays()
1618

1719
# This pinout works on a Feather RP2040 and may need to be altered for other boards.
@@ -21,7 +23,7 @@
2123
epd_reset = board.D11
2224
epd_busy = board.D12
2325

24-
display_bus = displayio.FourWire(
26+
display_bus = fourwire.FourWire(
2527
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
2628
)
2729

@@ -56,7 +58,7 @@
5658
tg = displayio.TileGrid(bitmap=bmp, pixel_shader=p)
5759
g.append(tg)
5860

59-
display.show(g)
61+
display.root_group = g
6062

6163
display.refresh()
6264

examples/spd1656_colors_and_text.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
import terminalio
1414
import bitmaptools
1515
from adafruit_display_text.bitmap_label import Label
16+
import fourwire
1617
import adafruit_spd1656
1718

19+
1820
displayio.release_displays()
1921

2022
# This pinout works on a Feather RP2040 and may need to be altered for other boards.
@@ -24,7 +26,7 @@
2426
epd_reset = board.D11
2527
epd_busy = board.D12
2628

27-
display_bus = displayio.FourWire(
29+
display_bus = fourwire.FourWire(
2830
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
2931
)
3032

@@ -55,7 +57,7 @@
5557
lbl.anchored_position = (display.width // 2, display.height // 2)
5658
g.append(lbl)
5759

58-
display.show(g)
60+
display.root_group = g
5961
display.refresh()
6062

6163
while True:

examples/spd1656_simpletest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
import time
1111
import board
1212
import displayio
13+
import fourwire
1314
import adafruit_spd1656
1415

16+
1517
displayio.release_displays()
1618

1719
# This pinout works on a Feather RP2040 and may need to be altered for other boards.
@@ -21,7 +23,7 @@
2123
epd_reset = board.D11
2224
epd_busy = board.D12
2325

24-
display_bus = displayio.FourWire(
26+
display_bus = fourwire.FourWire(
2527
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
2628
)
2729

@@ -38,7 +40,7 @@
3840
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
3941
g.append(t)
4042

41-
display.show(g)
43+
display.root_group = g
4244

4345
display.refresh()
4446

0 commit comments

Comments
 (0)