Skip to content

Commit dddc26e

Browse files
committed
feat(esp_cam_sensor): Add OV02C10 MIPI camera sensor driver
Add support for OmniVision OV02C10 2MP MIPI CSI camera sensor with the following features: Hardware Specifications: - 2 Megapixel (1920x1080) resolution - 10-bit RAW Bayer GBRG output format - MIPI CSI interface (1-lane and 2-lane modes) - 1/5" optical format - 24MHz input clock - I2C address: 0x36 (7-bit) Supported Configurations: - 1288x728 @ 30fps (MIPI 1-lane, 24MHz input) - 1920x1080 @ 30fps (MIPI 1-lane, 24MHz input) - 1920x1080 @ 30fps (MIPI 2-lane, 24MHz input) Driver Features: - Auto-detection via I2C (PID: 0x5602) - ISP pipeline controller support - Configurable analog and digital gain priority modes - Auto-focus (AF) support - CSI line sync option - Customizable IPA JSON configuration - VFLIP and HMIRROR support Implementation includes: - Complete sensor driver (ov02c10.c) - Register definitions and initialization settings - Default ISP configuration (ov02c10_default.json) - Kconfig integration with format selection - CMakeLists.txt build rules - Auto-detect function for MIPI interface - Test configuration updates Tested on ESP32-P4 with JC4880P443C display module. Closes #XXX
1 parent 5abb193 commit dddc26e

File tree

14 files changed

+3174
-1
lines changed

14 files changed

+3174
-1
lines changed

esp_cam_sensor/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.5.0
4+
5+
- Added OV02C10 MIPI camera sensor driver with support for 1288x728 and 1920x1080 resolutions at 30fps (1-lane and 2-lane modes).
6+
37
## 1.4.0
48

59
- Update driver dependency, not rely on old `driver` component anymore

esp_cam_sensor/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ if(CONFIG_CAMERA_OS02N10)
6464
list(APPEND priv_include_dirs "sensors/os02n10/private_include")
6565
endif()
6666

67+
if(CONFIG_CAMERA_OV02C10)
68+
list(APPEND srcs "sensors/ov02c10/ov02c10.c")
69+
list(APPEND include_dirs "sensors/ov02c10/include")
70+
list(APPEND priv_include_dirs "sensors/ov02c10/private_include")
71+
endif()
72+
6773
if(CONFIG_CAMERA_SC101IOT)
6874
list(APPEND srcs "sensors/sc101iot/sc101iot.c")
6975
list(APPEND include_dirs "sensors/sc101iot/include")
@@ -155,6 +161,10 @@ if(CONFIG_CAMERA_OS02N10_AUTO_DETECT_MIPI_INTERFACE_SENSOR)
155161
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u os02n10_detect")
156162
endif()
157163

164+
if(CONFIG_CAMERA_OV02C10_AUTO_DETECT_MIPI_INTERFACE_SENSOR)
165+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ov02c10_detect")
166+
endif()
167+
158168
if(CONFIG_CAMERA_SC101IOT_AUTO_DETECT_DVP_INTERFACE_SENSOR)
159169
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u sc101iot_detect")
160170
endif()

esp_cam_sensor/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ menu "Espressif Camera Sensors Configurations"
99
rsource "sensors/os02n10/Kconfig.os02n10"
1010
rsource "sensors/ov2640/Kconfig.ov2640"
1111
rsource "sensors/ov2710/Kconfig.ov2710"
12+
rsource "sensors/ov02c10/Kconfig.ov02c10"
1213
rsource "sensors/ov5640/Kconfig.ov5640"
1314
rsource "sensors/ov5645/Kconfig.ov5645"
1415
rsource "sensors/ov5647/Kconfig.ov5647"

esp_cam_sensor/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ It is highly recommended that users use it in the [esp-video](https://github.com
2727
| GC0308 | 640 x 480 | DVP | Grayscale<br/>YCbCr422<br/>RGB565 | 1/6.5" |
2828
| GC2145 | 1600 x 1200 | MIPI & DVP | RGB565<br/>YCbCr422<br/>8bit Raw RGB data | 1/5" |
2929
| OS02N10 | 1920 x 1080 | MIPI | 8/10-bit Raw RGB data | 1/3.27" |
30+
| OV02C10 | 1920 x 1080 | MIPI | 10-bit Raw RGB data | 1/5" |
3031
| OV2640 | 1600 x 1200 | DVP | 8/10-bit Raw RGB data<br/>JPEG compression<br/>YUV/YCbCr422<br/>RGB565 | 1/4" |
3132
| OV2710 | 1920 x 1080 | MIPI | Raw RGB data | 1/2.7" |
3233
| OV5640 | 2592 x 1944 | MIPI & DVP | RGB565<br/>YUV/YCbCr422 | 1/4" |

esp_cam_sensor/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.4.0"
1+
version: "1.5.0"
22
description: "Espressif camera sensor drivers, it is recommended to use with esp_video"
33
targets:
44
- esp32p4

esp_cam_sensor/project_include.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,12 @@ if(CONFIG_CAMERA_SC035HGS)
3636
elseif(CONFIG_CAMERA_SC035HGS_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE)
3737
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH ${CONFIG_CAMERA_SC035HGS_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH} APPEND)
3838
endif()
39+
endif()
40+
41+
if(CONFIG_CAMERA_OV02C10)
42+
if(CONFIG_CAMERA_OV02C10_DEFAULT_IPA_JSON_CONFIGURATION_FILE)
43+
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH "${COMPONENT_PATH}/sensors/ov02c10/cfg/ov02c10_default.json" APPEND)
44+
elseif(CONFIG_CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE)
45+
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH ${CONFIG_CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH} APPEND)
46+
endif()
3947
endif()
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
menuconfig CAMERA_OV02C10
2+
bool "OV02C10"
3+
default n
4+
help
5+
Enabling this option will add the support for OV02C10.
6+
7+
if CAMERA_OV02C10
8+
menuconfig CAMERA_OV02C10_AUTO_DETECT
9+
bool "Auto detect OV02C10"
10+
default y
11+
help
12+
When enabled, it provides the ability in application layer to automatically
13+
detect camera sensors one by one.
14+
15+
if CAMERA_OV02C10_AUTO_DETECT
16+
config CAMERA_OV02C10_AUTO_DETECT_MIPI_INTERFACE_SENSOR
17+
bool "Detect for MIPI interface sensor"
18+
default y
19+
help
20+
When enabled, you don't need to call ov02c10_detect manually, ov02c10
21+
will be automatically detected and connected to the MIPI CSI interface
22+
when the application starts.
23+
endif
24+
25+
choice CAMERA_OV02C10_MIPI_DEFAULT_FMT
26+
prompt "Default format select"
27+
default CAMERA_OV02C10_MIPI_RAW10_1288x728_30FPS
28+
help
29+
Select the default format to load when the sensor is detected.
30+
When the sensor is in stream off state, the format can be changed.
31+
32+
config CAMERA_OV02C10_MIPI_RAW10_1288x728_30FPS
33+
bool "RAW10 1288x728 30fps, MIPI 1lane 24M input"
34+
config CAMERA_OV02C10_MIPI_RAW10_1920x1080_30FPS
35+
bool "RAW10 1920x1080 30fps, MIPI 1lane 24M input"
36+
config CAMERA_OV02C10_MIPI_RAW10_1920x1080_2LAN_30FPS
37+
bool "RAW10 1920x1080 30fps, MIPI 2lane 24M input"
38+
endchoice # CAMERA_OV02C10_MIPI_DEFAULT_FMT
39+
40+
config CAMERA_OV02C10_MIPI_IF_FORMAT_INDEX_DAFAULT
41+
int
42+
default 0 if CAMERA_OV02C10_MIPI_RAW10_1288x728_30FPS
43+
default 1 if CAMERA_OV02C10_MIPI_RAW10_1920x1080_30FPS
44+
default 2 if CAMERA_OV02C10_MIPI_RAW10_1920x1080_2LAN_30FPS
45+
help
46+
Set the configuration loaded by default for the MIPI interface.
47+
More information can be obtained by calling the query_support_formats().
48+
49+
config CAMERA_OV02C10_CSI_LINESYNC_ENABLE
50+
bool "CSI Line sync enable"
51+
default y
52+
help
53+
If enabled, send line short packet for each line.
54+
55+
config CAMERA_OV02C10_ISP_AF_ENABLE
56+
bool "AF(auto focus) enable"
57+
default y
58+
help
59+
If enabled, the camera module will enable some IO pins to drive the
60+
VCM motor.
61+
62+
config CAMERA_OV02C10_ABSOLUTE_GAIN_LIMIT
63+
int "Maximum absolute gain limit"
64+
default 66016
65+
range 4000 126016
66+
help
67+
Use this value to limit the maximum gain that upper level applications can use.
68+
To avoid using float type, the size of this value is gain x 1000.
69+
Excessive gain can lead to a worse signal-to-noise ratio and may cause the device to overheat, affecting its functionality.
70+
71+
choice CAMERA_OV02C10_ABS_GAIN_MAP_PRIORITY
72+
prompt "Gain map select"
73+
default CAMERA_OV02C10_ANA_GAIN_PRIORITY
74+
help
75+
The map of gains affects the size of the noise and the smoothness of the brightness change.
76+
Compared with digital gain, analog gain has less noise.
77+
Choose the appropriate gain map to balance the smoothness of the noise and brightness change.
78+
79+
config CAMERA_OV02C10_ANA_GAIN_PRIORITY
80+
bool "Analog Gain Priority"
81+
config CAMERA_OV02C10_DIG_GAIN_PRIORITY
82+
bool "Digital Gain Priority"
83+
endchoice # CAMERA_OV02C10_ABS_GAIN_MAP_PRIORITY
84+
85+
choice CAMERA_OV02C10_IPA_JSON_CONFIGURATION_FILE
86+
prompt "IPA JSON Configuration File"
87+
default CAMERA_OV02C10_DEFAULT_IPA_JSON_CONFIGURATION_FILE
88+
help
89+
Select OV02C10 JSON configuration file.
90+
91+
config CAMERA_OV02C10_DEFAULT_IPA_JSON_CONFIGURATION_FILE
92+
bool "Default"
93+
help
94+
Use the "esp_cam_sensor/sensors/ov02c10/cfg/ov02c10_default.json".
95+
96+
config CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE
97+
bool "Customized"
98+
help
99+
Use a customized OV02C10 JSON configuration file. Users should configure
100+
the file's path using the option "CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH."
101+
endchoice
102+
103+
config CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH
104+
string "OV02C10 Customized JSON Configuration File Path"
105+
depends on CAMERA_OV02C10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE
106+
help
107+
Customized OV02C10 JSON configuration file's path and this path is evaluated
108+
relative to the project root directory by default.
109+
endif

0 commit comments

Comments
 (0)