-
Notifications
You must be signed in to change notification settings - Fork 7.3k
boards: frdm_mcxn947: turn OV7670 into a shield #89131
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
Open
josuah
wants to merge
3
commits into
zephyrproject-rtos:main
Choose a base branch
from
tinyvision-ai-inc:pr-frdm-mcxn947-shield
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2025 tinyVision.ai Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_DVP_20PIN_OV7670 | ||
def_bool $(shields_list_contains,SHIELD_DVP_20PIN_OV7670) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
.. _dvp_20pin_ov7670: | ||
|
||
DVP 20-pin OV7670 Camera Module | ||
############################### | ||
|
||
Overview | ||
******** | ||
|
||
This series of shields supports the camera modules which use a 18-pin connector compatible with | ||
the ``arducam,dvp-20pin-connector`` to connect a devkit to an OV7670 image sensor via DVP | ||
(Digital Video Port), aka parallel interface. | ||
|
||
Only 18 pins out of the 20-pin connector are present | ||
|
||
It was originally produced by `Arducam`_ but is discontinuited, and now `Olimex`_ provides it. | ||
|
||
Pins assignment | ||
=============== | ||
|
||
+-----+--------------+-----+--------------+ | ||
| Pin | Function | Pin | Function | | ||
+=====+==============+=====+==============+ | ||
| 1 | 3V3 | 2 | GND | | ||
+-----+--------------+-----+--------------+ | ||
| 3 | SCL | 4 | SDA | | ||
+-----+--------------+-----+--------------+ | ||
| 5 | VS | 6 | HS | | ||
+-----+--------------+-----+--------------+ | ||
| 7 | PCLK | 8 | XCLK | | ||
+-----+--------------+-----+--------------+ | ||
| 9 | D7 | 10 | D6 | | ||
+-----+--------------+-----+--------------+ | ||
| 11 | D5 | 12 | D4 | | ||
+-----+--------------+-----+--------------+ | ||
| 13 | D3 | 14 | D2 | | ||
+-----+--------------+-----+--------------+ | ||
| 15 | D1 | 16 | D0 | | ||
+-----+--------------+-----+--------------+ | ||
| 17 | POWER_EN | 18 | POWER_DOWN | | ||
+-----+--------------+-----+--------------+ | ||
|
||
Requirements | ||
************ | ||
|
||
This shield can be used with any board which provides a 18 or 20-pin header spread over two rows | ||
of 9 or 10 pins each with the above pinout, such as the `arduino Giga R1`_, `NXP FRDM-MCXN947`_, | ||
ST boards with the `ST-CAMS-OMV`_ adapter, or any other board with a compatible connector. | ||
|
||
Alternatively, it is possible to use jumper wires to connect the module to any devkit that | ||
exposes their camera parallel port to pin headers. | ||
|
||
Programming | ||
*********** | ||
|
||
Set ``--shield dvp_20pin_ov7670`` when you invoke ``west build``. For example: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/drivers/video/capture | ||
:board: frdm_mcxn947 | ||
:shield: dvp_20pin_ov7670 | ||
:goals: build | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: | ||
|
||
.. _ST-CAMS-OMV: | ||
https://www.st.com/en/evaluation-tools/b-cams-omv.html | ||
|
||
.. _Arducam: | ||
https://docs.arducam.com/DVP-Camera-Module/Arduino-GIGA/Arduino-GIGA/Quick-Start-Guide/ | ||
|
||
.. _Arduino Giga R1: | ||
https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-camera/ | ||
|
||
.. _NXP FRDM-MCXN947: | ||
https://www.nxp.com/docs/en/application-note/AN14191.pdf | ||
|
||
.. _Olimex: | ||
https://www.olimex.com/Products/Components/Camera/CAMERA-OV7670/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2024 NXP | ||
* Copyright 2025 tinyVision.ai Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,camera = &dvp_20pin_interface; | ||
}; | ||
}; | ||
|
||
&dvp_20pin_i2c { | ||
ov7670: ov7670@21 { | ||
compatible = "ovti,ov7670"; | ||
reg = <0x21>; | ||
reset-gpios = <&dvp_20pin_gpio DVP_20PIN_PEN GPIO_ACTIVE_HIGH>; | ||
pwdn-gpios = <&dvp_20pin_gpio DVP_20PIN_PDN GPIO_ACTIVE_HIGH>; | ||
|
||
port { | ||
ov7670_ep_out: endpoint { | ||
remote-endpoint-label = "dvp_20pin_ep_in"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
&dvp_20pin_interface { | ||
status = "okay"; | ||
|
||
port { | ||
dvp_20pin_ep_in: endpoint { | ||
remote-endpoint-label = "ov7670_ep_out"; | ||
}; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2025 tinyVision.ai Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
GPIO pins exposed on ArduCam 20-pin header camera connector, | ||
originally designed to connect Arducam modules to Arduino Giga R1, | ||
but further used by other vendors of camera and devkits. | ||
|
||
The connector layout is depicted below: | ||
|
||
1 3V3 2 GND | ||
3 SCL 4 SDA | ||
5 VS 6 HS | ||
7 PCLK 8 XCLK | ||
9 D7 10 D6 | ||
11 D5 12 D4 | ||
13 D3 14 D2 | ||
15 D1 16 D0 | ||
17 PEN 18 PDN | ||
19 PEN 20 PDN | ||
|
||
In many variants, the last row containing the pins 19 and 20 is | ||
not present, and the pins 17 and 18 are used for the same purpose | ||
instead. | ||
|
||
The following node labels can be used for use in shields: | ||
|
||
- dvp_20pin_interface: the video interface that receives the video | ||
feed and use with the zephyr,camera chosen node. | ||
|
||
- dvp_20pin_ep_in: video endpoint of the devkit receiving the video | ||
feed (see video-interfaces.yaml). | ||
|
||
- dvp_20pin_ep_out: video endpoint of the camera module to interconnect | ||
with this endpoint (see video-interfaces.yaml). | ||
|
||
- dvp_20pin_i2c: the I2C device of the devkit on which the camera | ||
module is instantiated. | ||
|
||
- dvp_20pin_gpio: the gpio nexus using the arducam,dvp-20pin-connector | ||
that defines the camera 'reset' pin, 'power-down' pin, etc. | ||
|
||
See <zephyr/dt-bindings/gpio/dvp-20pin-gpio.h> for pin description. | ||
|
||
compatible: "arducam,dvp-20pin-connector" | ||
|
||
include: [gpio-nexus.yaml, base.yaml] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2025 tinyVision.ai Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#ifndef INCLUDE_ZEPHYR_DT_BINDINGS_GPIO_DVP_20PIN_CONNECTOR_H_ | ||
#define INCLUDE_ZEPHYR_DT_BINDINGS_GPIO_DVP_20PIN_CONNECTOR_H_ | ||
|
||
/** Pin number mask (0..20). */ | ||
#define DVP_20PIN_MASK 0xff | ||
|
||
/** | ||
* @name Arducam DVP 20-pin or 18-pin connector pinout | ||
* @{ | ||
*/ | ||
#define DVP_20PIN_SCL 3 /**< I2C pin */ | ||
#define DVP_20PIN_SDA 4 /**< I2C pin */ | ||
#define DVP_20PIN_VS 5 /**< Vertical sync */ | ||
#define DVP_20PIN_HS 6 /**< Horizontal sync */ | ||
#define DVP_20PIN_PCLK 7 /**< Pixel clock used to transmit the data */ | ||
#define DVP_20PIN_XCLK 8 /**< System clock often needed for I2C communication */ | ||
#define DVP_20PIN_D7 9 /**< Parallel port data */ | ||
#define DVP_20PIN_D6 10 /**< Parallel port data */ | ||
#define DVP_20PIN_D5 11 /**< Parallel port data */ | ||
#define DVP_20PIN_D4 12 /**< Parallel port data */ | ||
#define DVP_20PIN_D3 13 /**< Parallel port data */ | ||
#define DVP_20PIN_D2 14 /**< Parallel port data */ | ||
#define DVP_20PIN_D1 15 /**< Parallel port data */ | ||
#define DVP_20PIN_D0 16 /**< Parallel port data */ | ||
#define DVP_20PIN_PEN 17 /**< Power Enable, typicaly shorted with pin 19 */ | ||
#define DVP_20PIN_PDN 18 /**< Power Down, typicaly shorted with pin 20 */ | ||
/** @} */ | ||
|
||
#endif /* INCLUDE_ZEPHYR_DT_BINDINGS_GPIO_DVP_20PIN_CONNECTOR_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
samples/drivers/video/capture/boards/frdm_mcxn947_cpu0.overlay
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shields does not talk about a
zephyr_...
prefix:zephyr/boards/weact/mini_stm32h743/mini_stm32h743.dts
Lines 243 to 253 in 02f85b2
So I went with
dvp_20pin_<sensorname>
anddvp_20pin_<feature>
.Let me know if
zephyr_camera_<...>
is better!