Skip to content

Commit 25ebfb5

Browse files
committed
Merge branch 'feature/add_os02n10_mipi_driver_support' into 'master'
feat: add os02n10 mipi camera sensor driver Closes AEG-2666 See merge request espressif/esp-video-components!313
2 parents ddbbedb + b515749 commit 25ebfb5

File tree

15 files changed

+2631
-5
lines changed

15 files changed

+2631
-5
lines changed

esp_cam_sensor/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
## Unreleased
44

55
- Added line exposure time info in camera drivers.
6+
- Added OS02N10 MIPI camera sensor driver.
67

78
## 1.3.0
89
- Changed YUV422 sequence for SC030IOT, SC101IOT, GC0308, and BF3A03 sensors to depend on CONFIG_CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER
10+
- Changed YUV422 sequence for SC030IOT, SC101IOT, GC0308, and BF3A03 sensors to depend on CONFIG_CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER.
911
- Fixed OV2640 JPEG compression quality calculation issue.
1012
- Fixed incorrect format selection in OV2640 Kconfig.
1113
- Removed the GROUP Hold function in the SC2336 driver.
12-
- Modified GPIO pin type from int8_t to gpio_num_t
14+
- Modified GPIO pin type from int8_t to gpio_num_t.
1315

1416
## 1.2.1
1517
- Deprecated ledc intr type config

esp_cam_sensor/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ if(CONFIG_CAMERA_GC2145)
6262
list(APPEND priv_include_dirs "sensors/gc2145/private_include")
6363
endif()
6464

65+
if(CONFIG_CAMERA_OS02N10)
66+
list(APPEND srcs "sensors/os02n10/os02n10.c")
67+
list(APPEND include_dirs "sensors/os02n10/include")
68+
list(APPEND priv_include_dirs "sensors/os02n10/private_include")
69+
endif()
70+
6571
if(CONFIG_CAMERA_SC101IOT)
6672
list(APPEND srcs "sensors/sc101iot/sc101iot.c")
6773
list(APPEND include_dirs "sensors/sc101iot/include")
@@ -149,6 +155,10 @@ if(CONFIG_CAMERA_GC2145_AUTO_DETECT_MIPI_INTERFACE_SENSOR OR CONFIG_CAMERA_GC214
149155
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u gc2145_detect")
150156
endif()
151157

158+
if(CONFIG_CAMERA_OS02N10_AUTO_DETECT_MIPI_INTERFACE_SENSOR)
159+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u os02n10_detect")
160+
endif()
161+
152162
if(CONFIG_CAMERA_SC101IOT_AUTO_DETECT_DVP_INTERFACE_SENSOR)
153163
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u sc101iot_detect")
154164
endif()

esp_cam_sensor/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ menu "Espressif Camera Sensors Configurations"
66
rsource "sensors/bf3a03/Kconfig.bf3a03"
77
rsource "sensors/gc0308/Kconfig.gc0308"
88
rsource "sensors/gc2145/Kconfig.gc2145"
9+
rsource "sensors/os02n10/Kconfig.os02n10"
910
rsource "sensors/ov2640/Kconfig.ov2640"
1011
rsource "sensors/ov2710/Kconfig.ov2710"
1112
rsource "sensors/ov5640/Kconfig.ov5640"

esp_cam_sensor/README.md

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

esp_cam_sensor/project_include.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ if(CONFIG_CAMERA_SC2336)
1414
endif()
1515
endif()
1616

17+
if(CONFIG_CAMERA_OS02N10)
18+
if(CONFIG_CAMERA_OS02N10_DEFAULT_IPA_JSON_CONFIGURATION_FILE)
19+
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH "${COMPONENT_PATH}/sensors/os02n10/cfg/os02n10_default.json" APPEND)
20+
elseif(CONFIG_CAMERA_OS02N10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE)
21+
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH ${CONFIG_CAMERA_OS02N10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH} APPEND)
22+
endif()
23+
endif()
24+
1725
if(CONFIG_CAMERA_OV2710)
1826
if(CONFIG_CAMERA_OV2710_DEFAULT_IPA_JSON_CONFIGURATION_FILE)
1927
idf_build_set_property(ESP_IPA_JSON_CONFIG_FILE_PATH "${COMPONENT_PATH}/sensors/ov2710/cfg/ov2710_default.json" APPEND)
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
menuconfig CAMERA_OS02N10
2+
bool "OS02N10"
3+
default n
4+
depends on SOC_MIPI_CSI_SUPPORTED
5+
help
6+
Enable support for the OS02N10 CMOS image sensor.
7+
8+
if CAMERA_OS02N10
9+
menu "Auto detect OS02N10"
10+
config CAMERA_OS02N10_AUTO_DETECT_MIPI_INTERFACE_SENSOR
11+
bool "Detect for MIPI CSI interface sensor"
12+
default y
13+
depends on SOC_MIPI_CSI_SUPPORTED
14+
help
15+
When enabled, the OS02N10 sensor will be automatically detected
16+
and initialized on the MIPI CSI interface at startup without requiring
17+
manual detection call(os02n10_detect) in your application.
18+
endmenu
19+
20+
config CAMERA_OS02N10_SID_HIGH
21+
bool "Set SID pin to high"
22+
default n
23+
help
24+
This option allows you to configure the sensor ID. When the SID pin uses a high level,
25+
the sensor ID will be configured as 0x3d, otherwise, the sensor ID will be configured as 0x3c.
26+
27+
choice CAMERA_OS02N10_MIPI_DEFAULT_FMT
28+
prompt "Select default output format for MIPI CSI interface"
29+
default CAMERA_OS02N10_MIPI_RAW8_1920X1080_25FPS
30+
depends on SOC_MIPI_CSI_SUPPORTED
31+
help
32+
This option allows you to select the default video format for the OS02N10 sensor
33+
when it is initialized on the MIPI CSI interface. The selected format will be used
34+
when the sensor is detected and initialized, and can be changed later when the
35+
sensor is in stream off state.
36+
37+
config CAMERA_OS02N10_MIPI_RAW10_1920X1080_25FPS
38+
bool "RAW10 1920x1080 25fps, MIPI 2-lane, 24M input"
39+
help
40+
RAW10 color format at 1920x1080 resolution (HD) with 25fps framerate.
41+
Requires MIPI CSI-2 2-lane interface with 24MHz input clock.
42+
config CAMERA_OS02N10_MIPI_RAW10_1280X720_50FPS
43+
bool "RAW10 1280x720 50fps, MIPI 2-lane, 24M input"
44+
help
45+
RAW10 color format at 1280x720 resolution (HD) with 50fps framerate.
46+
Requires MIPI CSI-2 2-lane interface with 24MHz input clock.
47+
config CAMERA_OS02N10_MIPI_RAW8_1920X1080_25FPS
48+
bool "RAW8 1920x1080 25fps, MIPI 2-lane, 24M input"
49+
help
50+
RAW8 color format at 1920x1080 resolution (HD) with 25fps framerate.
51+
Requires MIPI CSI-2 2-lane interface with 24MHz input clock.
52+
config CAMERA_OS02N10_MIPI_RAW8_1280X720_50FPS
53+
bool "RAW8 1280x720 50fps, MIPI 2-lane, 24M input"
54+
help
55+
RAW8 color format at 1280x720 resolution (HD) with 50fps framerate.
56+
Requires MIPI CSI-2 2-lane interface with 24MHz input clock.
57+
config CAMERA_OS02N10_MIPI_RAW8_960x540_25FPS
58+
bool "RAW8 960x540 25fps, MIPI 2-lane, 24M input"
59+
help
60+
RAW8 color format at 960x540 resolution with 25fps framerate.
61+
Requires MIPI CSI-2 2-lane interface with 24MHz input clock.
62+
endchoice # CAMERA_OS02N10_MIPI_DEFAULT_FMT
63+
64+
config CAMERA_OS02N10_MIPI_IF_FORMAT_INDEX_DEFAULT
65+
int
66+
depends on SOC_MIPI_CSI_SUPPORTED
67+
default 0 if CAMERA_OS02N10_MIPI_RAW10_1920X1080_25FPS
68+
default 1 if CAMERA_OS02N10_MIPI_RAW10_1280X720_50FPS
69+
default 2 if CAMERA_OS02N10_MIPI_RAW8_1920X1080_25FPS
70+
default 3 if CAMERA_OS02N10_MIPI_RAW8_1280X720_50FPS
71+
default 4 if CAMERA_OS02N10_MIPI_RAW8_960x540_25FPS
72+
help
73+
Sets the default configuration for the MIPI CSI interface.
74+
Use query_support_formats() API to get more format options.
75+
76+
config CAMERA_OS02N10_ABSOLUTE_GAIN_LIMIT
77+
int "Maximum absolute gain limit (x1000)"
78+
default 10000
79+
range 4000 16468
80+
help
81+
Set the maximum gain limit that can be applied by upper-level applications.
82+
83+
Value is gain multiplied by 1000 to avoid floating-point arithmetic:
84+
- 4000 = 4x gain (minimum)
85+
- 16000 = 16x gain (default)
86+
- 16468 = 16.468x gain (maximum)
87+
88+
Lower values reduce noise but may limit low-light performance.
89+
Higher values improve low-light sensitivity but increase noise and
90+
may cause sensor overheating.
91+
92+
choice CAMERA_OS02N10_IPA_JSON_CONFIGURATION_FILE
93+
prompt "IPA Configuration File"
94+
default CAMERA_OS02N10_DEFAULT_IPA_JSON_CONFIGURATION_FILE
95+
help
96+
Select the Image Processing Algorithm (IPA) JSON configuration file
97+
for the OS02N10 sensor.
98+
99+
config CAMERA_OS02N10_DEFAULT_IPA_JSON_CONFIGURATION_FILE
100+
bool "Use default configuration"
101+
help
102+
Use the built-in default IPA configuration file:
103+
"esp_cam_sensor/sensors/os02n10/cfg/os02n10_default.json"
104+
105+
This configuration provides optimized settings for general use cases
106+
and is recommended for most applications.
107+
108+
config CAMERA_OS02N10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE
109+
bool "Use custom configuration"
110+
help
111+
Use a custom IPA configuration file with your own optimized settings.
112+
113+
This option allows you to fine-tune sensor parameters for specific
114+
lighting conditions, color requirements, or application needs.
115+
116+
You must specify the custom file path in the configuration below.
117+
endchoice
118+
119+
config CAMERA_OS02N10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE_PATH
120+
string "Custom IPA configuration file path"
121+
depends on CAMERA_OS02N10_CUSTOMIZED_IPA_JSON_CONFIGURATION_FILE
122+
help
123+
Specify the path to your custom OS02N10 IPA JSON configuration file.
124+
125+
The path is relative to your project root directory.
126+
127+
Example: "components/my_camera_config/os02n10_custom.json"
128+
129+
Ensure the file exists and contains valid JSON configuration
130+
parameters compatible with the OS02N10 sensor.
131+
endif

0 commit comments

Comments
 (0)