Merge pull request #24 from dhalbert/fourwire

support 8.x.x. and 9.x.x FourWire
This commit is contained in:
foamyguy 2023-12-18 14:15:48 -06:00 committed by GitHub
commit 5417f6225f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 17 deletions

View file

@ -28,7 +28,13 @@ Implementation Notes
"""
import displayio
try:
from epaperdisplay import EPaperDisplay
from fourwire import FourWire
except ImportError:
from displayio import EPaperDisplay
from displayio import FourWire
__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1680.git"
@ -50,7 +56,7 @@ _STOP_SEQUENCE = b"\x10\x81\x01\x64" # Deep Sleep
# pylint: disable=too-few-public-methods
class SSD1680(displayio.EPaperDisplay):
class SSD1680(EPaperDisplay):
r"""SSD1680 driver
:param bus: The data bus the display is on
@ -66,7 +72,7 @@ class SSD1680(displayio.EPaperDisplay):
Display rotation
"""
def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
def __init__(self, bus: FourWire, **kwargs) -> None:
if "colstart" not in kwargs:
kwargs["colstart"] = 8
stop_sequence = bytearray(_STOP_SEQUENCE)

View file

@ -17,9 +17,14 @@ Supported products:
import time
import board
import displayio
import fourwire
import adafruit_ssd1680
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
# This pinout works on a Metro M4 and may need to be altered for other boards.
@ -27,9 +32,7 @@ spi = board.SPI() # Uses SCK and MOSI
epd_cs = board.D9
epd_dc = board.D10
display_bus = fourwire.FourWire(
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
)
display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
time.sleep(1)
display = adafruit_ssd1680.SSD1680(

View file

@ -18,9 +18,14 @@ Supported products:
import time
import board
import displayio
import fourwire
import adafruit_ssd1680
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
# This pinout works on a Metro M4 and may need to be altered for other boards.
@ -30,7 +35,7 @@ epd_dc = board.D22
epd_reset = board.D27 # Set to None for FeatherWing
epd_busy = board.D17 # Set to None for FeatherWing
display_bus = fourwire.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)

View file

@ -14,9 +14,14 @@ Supported products:
import time
import board
import displayio
import fourwire
import adafruit_ssd1680
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
# This pinout works on a Metro M4 and may need to be altered for other boards.
@ -26,9 +31,7 @@ epd_dc = board.D10
epd_reset = board.D5
epd_busy = board.D6
display_bus = fourwire.FourWire(
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
)
display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
time.sleep(1)
display = adafruit_ssd1680.SSD1680(

View file

@ -13,10 +13,15 @@ import time
import board
import busio
import displayio
import fourwire
import terminalio
import adafruit_ssd1680
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
# This pinout works on a Feather RP2040 EPD and may need to be altered for other
@ -28,7 +33,7 @@ epd_dc = board.EPD_DC
epd_reset = board.EPD_RESET
epd_busy = board.EPD_BUSY
display_bus = fourwire.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
display = adafruit_ssd1680.SSD1680(

View file

@ -18,9 +18,14 @@ Supported products:
import time
import board
import displayio
import fourwire
import adafruit_ssd1680
# For 8.x.x and 9.x.x. When 8.x.x is discontinued as a stable release, change this.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
displayio.release_displays()
# This pinout works on a Metro M4 and may need to be altered for other boards.
@ -30,7 +35,7 @@ epd_dc = board.D10
epd_reset = board.D8 # Set to None for FeatherWing
epd_busy = board.D7 # Set to None for FeatherWing
display_bus = fourwire.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)