Skip to content

Commit 598ed3f

Browse files
committed
Update for incompatible upstream changes
See adafruit/circuitpython#4880 -- instead of "data0", pass a list of "data_pins". This supports non- sequential data pins on ESP32S2.
1 parent 81b6668 commit 598ed3f

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ On an Adafruit Metro M4 Grand Central, capture a 40x30 image into a buffer:
5656
5757
cam = OV7670(
5858
bus,
59-
data0=board.PCC_D0,
59+
data_pins=[board.PCC_D0, board.PCC_D1, board.PCC_D2, board.PCC_D3, board.PCC_D4, board.PCC_D5, board.PCC_D6, board.PCC_D7],
6060
clock=board.PCC_CLK,
6161
vsync=board.PCC_DEN1,
6262
href=board.PCC_DEN2,

adafruit_ov7670.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class OV7670: # pylint: disable=too-many-instance-attributes
506506
def __init__(
507507
self,
508508
i2c_bus,
509-
data0,
509+
data_pins,
510510
clock,
511511
vsync,
512512
href,
@@ -519,7 +519,7 @@ def __init__(
519519
"""
520520
Args:
521521
i2c_bus (busio.I2C): The I2C bus used to configure the OV7670
522-
data0 (microcontroller.Pin): The first of 8 parallel data capture pins.
522+
data_pins (List[microcontroller.Pin]): A list of 8 data pins, in order.
523523
clock (microcontroller.Pin): The pixel clock from the OV7670.
524524
vsync (microcontroller.Pin): The vsync signal from the OV7670.
525525
href (microcontroller.Pin): The href signal from the OV7670, \
@@ -581,7 +581,7 @@ def __init__(
581581
self._night = OV7670_NIGHT_MODE_OFF
582582

583583
self._imagecapture = imagecapture.ParallelImageCapture(
584-
data0=data0, clock=clock, vsync=vsync, href=href
584+
data_pins=data_pins, clock=clock, vsync=vsync, href=href
585585
)
586586

587587
def capture(self, buf):

examples/ov7670_displayio_gcm4_tftshield18.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from adafruit_ov7670 import ( # pylint: disable=unused-import
1414
OV7670,
1515
OV7670_TEST_PATTERN_COLOR_BAR,
16+
OV7670_TEST_PATTERN_COLOR_BAR_FADE,
17+
OV7670_TEST_PATTERN_SHIFTING_1,
1618
OV7670_SIZE_DIV4,
1719
OV7670_SIZE_DIV8,
1820
OV7670_NIGHT_MODE_2,
@@ -51,7 +53,16 @@ def __init__(self):
5153
self,
5254
bus,
5355
mclk=board.PCC_XCLK,
54-
data0=board.PCC_D0,
56+
data_pins=[
57+
board.PCC_D0,
58+
board.PCC_D1,
59+
board.PCC_D2,
60+
board.PCC_D3,
61+
board.PCC_D4,
62+
board.PCC_D5,
63+
board.PCC_D6,
64+
board.PCC_D7,
65+
],
5566
clock=board.PCC_CLK,
5667
vsync=board.PCC_DEN1,
5768
href=board.PCC_DEN2,
@@ -72,7 +83,7 @@ def deinit(self):
7283
pid = cam.product_id
7384
ver = cam.product_version
7485
print(f"Detected pid={pid:x} ver={ver:x}")
75-
# cam.test_pattern = OV7670_TEST_PATTERN_COLOR_BAR
86+
cam.test_pattern = OV7670_TEST_PATTERN_SHIFTING_1
7687

7788
g = displayio.Group(scale=1)
7889
bitmap = displayio.Bitmap(160, 120, 65536)

examples/ov7670_displayio_pico_st7789_2in.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@
4848
# Set up the camera (you must customize this for your board!)
4949
cam = OV7670(
5050
bus,
51-
data0=board.GP12, # [16] [org]
51+
data_pins=[
52+
board.GP12,
53+
board.GP13,
54+
board.GP14,
55+
board.GP15,
56+
board.GP16,
57+
board.GP17,
58+
board.GP18,
59+
board.GP19,
60+
], # [16] [org] etc
5261
clock=board.GP11, # [15] [blk]
5362
vsync=board.GP7, # [10] [brn]
5463
href=board.GP21, # [27/o14] [red]

0 commit comments

Comments
 (0)