Skip to content
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

displayio 9.x compatibility #27

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 9 additions & 1 deletion examples/ov2640_bmp_sd_kaluga1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

import sdcardio
import storage
import adafruit_ov2640
Expand All @@ -47,7 +55,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi,
command=board.LCD_D_C,
chip_select=board.LCD_CS,
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_directio_kaluga1_3_ili9341.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

import sdcardio
import storage
import adafruit_ov2640
Expand All @@ -45,7 +53,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi,
command=board.LCD_D_C,
chip_select=board.LCD_CS,
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_displayio_kaluga1_3_ili9341.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

from adafruit_ili9341 import ILI9341
import adafruit_ov2640

Expand All @@ -29,7 +37,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=board.LCD_D_C, chip_select=board.LCD_CS, reset=board.LCD_RST
)
display = ILI9341(display_bus, width=320, height=240, rotation=90)
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_displayio_kaluga1_3_ili9341_ulab.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

from adafruit_ili9341 import ILI9341
import ulab.numpy as np
import adafruit_ov2640
Expand All @@ -33,7 +41,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=board.LCD_D_C, chip_select=board.LCD_CS, reset=board.LCD_RST
)
display = ILI9341(display_bus, width=320, height=240, rotation=90)
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_displayio_kaluga1_3_st7789.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

from adafruit_st7789 import ST7789
import adafruit_ov2640

Expand All @@ -30,7 +38,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=board.LCD_D_C, chip_select=board.LCD_CS, reset=board.LCD_RST
)
display = ST7789(
Expand Down
9 changes: 8 additions & 1 deletion examples/ov2640_displayio_pico_st7789_2in.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
Bitmap,
Group,
TileGrid,
FourWire,
release_displays,
ColorConverter,
Colorspace,
)

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
# pylint: disable=ungrouped-imports
from displayio import FourWire

from adafruit_st7789 import ST7789
import board
import busio
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_jpeg_sd_kaluga1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
import board
import busio
import displayio

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

import sdcardio
import storage
from adafruit_ili9341 import ILI9341
Expand All @@ -47,7 +55,7 @@
displayio.release_displays()

spi = busio.SPI(MOSI=board.LCD_MOSI, clock=board.LCD_CLK)
display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=board.LCD_D_C, chip_select=board.LCD_CS, reset=board.LCD_RST
)
display = ILI9341(display_bus, width=320, height=240, rotation=90)
Expand Down
10 changes: 9 additions & 1 deletion examples/ov2640_jpeg_sd_pico_st7789_2in.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@
Bitmap,
Group,
TileGrid,
FourWire,
release_displays,
ColorConverter,
Colorspace,
)

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
from fourwire import FourWire
except ImportError:
# pylint: disable=ungrouped-imports
from displayio import FourWire

from adafruit_st7789 import ST7789
import board
import busio
Expand Down
Loading