Skip to content

Commit

Permalink
boards: shields: Add shield for NXP ov5640 camera modules
Browse files Browse the repository at this point in the history
Add a shield for NXP ov5640 camera modules. This shield uses a 44-pin
board-to-board connector which is supported on NXP RT1170 and RT1160 EVKs.

Signed-off-by: Phi Bang Nguyen <[email protected]>
  • Loading branch information
ngphibang authored and jhedberg committed Jun 11, 2024
1 parent 0c23cf9 commit 67a3e71
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 0 deletions.
21 changes: 21 additions & 0 deletions boards/nxp/mimxrt1160_evk/mimxrt1160_evk_mimxrt1166_cm7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@
aliases {
watchdog0 = &wdog1;
};

/*
* This node describes the GPIO pins mapping of the 44-pin camera
* connector, J2 on the EVK. This camera interface is supported
* on several NXP RT11xx EVKs, such as RT1170 and RT1160 EVK and
* is used with an ov5640 camera module available as a Zephyr shield
*/
nxp_cam_connector: cam-connector {
compatible = "nxp,cam-44pins-connector";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <9 0 &gpio11 15 0>, /* Pin 9, RESETB */
<17 0 &gpio9 25 0>; /* Pin 17, PWDN */
};
};

&lpuart1 {
Expand Down Expand Up @@ -97,3 +112,9 @@ zephyr_udc0: &usb1 {
&pit2 {
status = "okay";
};

nxp_cam_i2c: &lpi2c6 {};

nxp_mipi_csi: &mipi_csi2rx {};

nxp_csi: &csi {};
21 changes: 21 additions & 0 deletions boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@
<32 0 &gpio11 16 0>, /* Pin 32, PWR_EN */
<34 0 &gpio9 29 0>; /* Pin 34, BL_PWM */
};

/*
* This node describes the GPIO pins mapping of the 44-pin camera
* connector, J2 on the EVK. This camera interface is supported
* on several NXP RT11xx EVKs, such as RT1170 and RT1160 EVK and
* is used with an ov5640 camera module available as a Zephyr shield
*/
nxp_cam_connector: cam-connector {
compatible = "nxp,cam-44pins-connector";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <9 0 &gpio11 15 0>, /* Pin 9, RESETB */
<17 0 &gpio9 25 0>; /* Pin 17, PWDN */
};
};

zephyr_lcdif: &lcdif {};
Expand Down Expand Up @@ -146,3 +161,9 @@ zephyr_udc0: &usb1 {
&pit2 {
status = "okay";
};

nxp_cam_i2c: &lpi2c6 {};

nxp_mipi_csi: &mipi_csi2rx {};

nxp_csi: &csi {};
5 changes: 5 additions & 0 deletions boards/shields/nxp_btb44_ov5640/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

config SHIELD_NXP_BTB44_OV5640
def_bool $(shields_list_contains,nxp_btb44_ov5640)
134 changes: 134 additions & 0 deletions boards/shields/nxp_btb44_ov5640/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.. _nxp_btb44_ov5640:

NXP BTB-44 OV5640 Camera Module
###############################

Overview
********

This shield supports ov5640 camera modules which use a 44-pin board-to-board connector and
a MIPI CSI or DVP (parallel) interface. These camera modules are made specifically for and
provided together with NXP's i.MX RT1160 and RT1170 EVK boards.

More information about this OV5640 camera module can be found at `Camera iMXRT`_.

Pins assignment of the NXP board-to-board 44-pin OV5640 camera module
======================================================================

+----------------------+--------------------+
| Camera Connector Pin | Function |
+======================+====================+
| 1 | AGND |
+----------------------+--------------------+
| 2 | AF_GND |
+----------------------+--------------------+
| 3 | STROBE |
+----------------------+--------------------+
| 4 | AF_VCC |
+----------------------+--------------------+
| 5 | SDA |
+----------------------+--------------------+
| 6 | VCMSINK |
+----------------------+--------------------+
| 7 | SCL |
+----------------------+--------------------+
| 8 | AVDD |
+----------------------+--------------------+
| 9 | RESETB |
+----------------------+--------------------+
| 10 | GPIO1 |
+----------------------+--------------------+
| 11 | PCLK |
+----------------------+--------------------+
| 12 | GPIO0 |
+----------------------+--------------------+
| 13 | VSYNC |
+----------------------+--------------------+
| 14 | FREX |
+----------------------+--------------------+
| 15 | HREF |
+----------------------+--------------------+
| 16 | MIPI_CSI_DP1 / D9 |
+----------------------+--------------------+
| 17 | PWDN |
+----------------------+--------------------+
| 18 | MIPI_CSI_DN1 / D8 |
+----------------------+--------------------+
| 19 | MIPI_CSI_DP1 / D9 |
+----------------------+--------------------+
| 20 | DGND |
+----------------------+--------------------+
| 21 | MIPI_CSI_DN1 / D8 |
+----------------------+--------------------+
| 22 | MIPI_CSI_CLKP / D7 |
+----------------------+--------------------+
| 23 | MIPI_CSI_CLKP / D7 |
+----------------------+--------------------+
| 24 | MIPI_CSI_CLKN / D6 |
+----------------------+--------------------+
| 25 | MIPI_CSI_CLKN / D6 |
+----------------------+--------------------+
| 26 | DGND |
+----------------------+--------------------+
| 27 | MIPI_CSI_DP0 / D5 |
+----------------------+--------------------+
| 28 | MIPI_CSI_DP0 / D5 |
+----------------------+--------------------+
| 29 | MIPI_CSI_DN0 / D4 |
+----------------------+--------------------+
| 30 | MIPI_CSI_DN0 / D4 |
+----------------------+--------------------+
| 31 | D3 |
+----------------------+--------------------+
| 32 | DGND |
+----------------------+--------------------+
| 33 | D2 |
+----------------------+--------------------+
| 34 | XCLK |
+----------------------+--------------------+
| 35 | D1 |
+----------------------+--------------------+
| 36 | DVDD |
+----------------------+--------------------+
| 37 | D0 |
+----------------------+--------------------+
| 38 | DOVDD |
+----------------------+--------------------+
| 39 | DGND |
+----------------------+--------------------+
| 40 | DGND |
+----------------------+--------------------+
| 41 | GND |
+----------------------+--------------------+
| 42 | GND |
+----------------------+--------------------+
| 43 | GND |
+----------------------+--------------------+
| 44 | AF_GND |
+----------------------+--------------------+

Requirements
************

This shield can only be used with a board which provides a 44-pin board-to-board
connector with MIPI CSI or DVP (parallel) interface where the pinouts are defined
as above, such as i.MX RT1160 and RT1170 EVK boards.

Programming
***********

Set ``-DSHIELD=nxp_btb44_ov5640`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/video/capture
:board: mimxrt1170_evk/mimxrt1176/cm7
:shield: nxp_btb44_ov5640
:goals: build

References
**********

.. target-notes::

.. _Camera iMXRT:
https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Connecting-camera-and-LCD-to-i-MX-RT-EVKs/ta-p/1122183
48 changes: 48 additions & 0 deletions boards/shields/nxp_btb44_ov5640/nxp_btb44_ov5640.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/{
chosen {
zephyr,camera = &nxp_csi;
};
};

&nxp_cam_i2c {
status = "okay";

ov5640: ov5640@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
reset-gpios = <&nxp_cam_connector 9 GPIO_ACTIVE_LOW>;
powerdown-gpios = <&nxp_cam_connector 17 GPIO_ACTIVE_HIGH>;

port {
ov5640_ep_out: endpoint {
remote-endpoint = <&mipi_csi2rx_ep_in>;
};
};
};
};

&nxp_mipi_csi {
status = "okay";

sensor = <&ov5640>;

ports {
port@1 {
reg = <1>;

mipi_csi2rx_ep_in: endpoint {
remote-endpoint = <&ov5640_ep_out>;
};
};
};
};

&nxp_csi {
status = "okay";
};
33 changes: 33 additions & 0 deletions dts/bindings/gpio/nxp,cam-44pins-connector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

description: |
GPIO pins exposed on NXP 44-pin board-to-board camera connector.
The connector layout is depicted below:
42 GND GND 41
2 AF_GND AGND 1
4 AF_VCC STROBE 3
6 VCMSINK SDA 5
8 AVDD SCL 7
10 GPIO1 RESETB 9
12 GPIO0 PCLK 11
14 FREX VSYNC 13
16 MIPI_CSI_DP1/D9 HREF 15
18 MIPI_CSI_DN1/D8 PWDN 17
20 DGND MIPI_CSI_DP1/D9 19
22 MIPI_CSI_CLKP/D7 MIPI_CSI_DN1/D8 21
24 MIPI_CSI_CLKN/D6 MIPI_CSI_CLKP/D7 23
26 DGND MIPI_CSI_CLKN/D6 25
28 MIPI_CSI_DP0/D5 MIPI_CSI_DP0/D5 27
30 MIPI_CSI_DN0/D4 MIPI_CSI_DN0/D4 29
32 DGND D3 31
34 XCLK D2 33
36 DVDD D1 35
38 DOVDD D0 37
40 DGND DGND 39
44 AF_GND GND 43
compatible: "nxp,cam-44pins-connector"

include: [gpio-nexus.yaml, base.yaml]

0 comments on commit 67a3e71

Please sign in to comment.