Skip to content

Commit efc2bd9

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 568680f commit efc2bd9

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-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: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ def __init__(self):
5151
self,
5252
bus,
5353
mclk=board.PCC_XCLK,
54-
data0=board.PCC_D0,
54+
data_pins=[
55+
board.PCC_D0,
56+
board.PCC_D1,
57+
board.PCC_D2,
58+
board.PCC_D3,
59+
board.PCC_D4,
60+
board.PCC_D5,
61+
board.PCC_D6,
62+
board.PCC_D7,
63+
],
5564
clock=board.PCC_CLK,
5665
vsync=board.PCC_DEN1,
5766
href=board.PCC_DEN2,
@@ -84,7 +93,6 @@ def deinit(self):
8493
)
8594
g.append(tg)
8695
display.show(g)
87-
buf = memoryview(bitmap)
8896

8997
t0 = time.monotonic_ns()
9098
display.auto_refresh = False

examples/ov7670_displayio_pico_st7789_2in.py

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

0 commit comments

Comments
 (0)