Skip to content

Commit

Permalink
displayio 9.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Apr 1, 2024
1 parent 59720f3 commit 9bbfc3a
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 8 deletions.
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

0 comments on commit 9bbfc3a

Please sign in to comment.