-
Notifications
You must be signed in to change notification settings - Fork 17
feat(esp_cam_sensor): Add OV02C10 MIPI camera sensor driver (AEGHB-1263) #46
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
base: master
Are you sure you want to change the base?
Conversation
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
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.
Pull Request Overview
This PR adds comprehensive support for the OmniVision OV02C10 2MP MIPI CSI camera sensor, including a complete driver implementation with multiple resolution modes, ISP pipeline integration, and auto-detection functionality.
- Adds OV02C10 sensor driver with support for 1288x728@30fps and 1920x1080@30fps in both 1-lane and 2-lane MIPI modes
- Integrates comprehensive configuration system with Kconfig options for format selection, gain mapping, and ISP settings
- Provides default ISP JSON configuration and auto-detection capability for MIPI interface
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| esp_cam_sensor/sensors/ov02c10/ov02c10.c | Main sensor driver implementation with register control and format support |
| esp_cam_sensor/sensors/ov02c10/private_include/ov02c10_settings.h | Register configuration arrays for different resolution modes |
| esp_cam_sensor/sensors/ov02c10/private_include/ov02c10_regs.h | Register address definitions and constants |
| esp_cam_sensor/sensors/ov02c10/include/ov02c10_types.h | Type definitions for register info structure |
| esp_cam_sensor/sensors/ov02c10/include/ov02c10.h | Public header with sensor detection function |
| esp_cam_sensor/sensors/ov02c10/cfg/ov02c10_default.json | Default ISP configuration parameters |
| esp_cam_sensor/sensors/ov02c10/Kconfig.ov02c10 | Configuration options for format selection and gain mapping |
| esp_cam_sensor/CMakeLists.txt | Build system integration for OV02C10 sensor |
| esp_cam_sensor/project_include.cmake | IPA JSON configuration file integration |
| esp_cam_sensor/test_apps/detect/sdkconfig.ci.all_cameras | Test configuration update |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| {0x395d, 0x05}, | ||
| {0x395e, 0x02}, | ||
| {0x395f, 0x00}, | ||
| {0x395f, 0x00}, |
Copilot
AI
Oct 13, 2025
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.
Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.
| {0x395f, 0x00}, |
| {0x395d, 0x05}, | ||
| {0x395e, 0x02}, | ||
| {0x395f, 0x00}, | ||
| {0x395f, 0x00}, |
Copilot
AI
Oct 13, 2025
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.
Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.
| {0x395f, 0x00}, |
| {0X395d, 0X05}, | ||
| {0X395e, 0X02}, | ||
| {0X395f, 0X00}, | ||
| {0X395f, 0X00}, |
Copilot
AI
Oct 13, 2025
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.
Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.
| {0X395f, 0X00}, |
| ((int32_t)(((double)v) * 1000000 / (sf)->fps / (sf)->isp_info->isp_v1_info.vts / EXPOSURE_V4L2_UNIT_US + 0.5)) | ||
|
|
||
| #define OV02C10_PID 0x5602 | ||
| #define OV02C10_SENSOR_NAME "OV02C10" |
Copilot
AI
Oct 13, 2025
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.
The sensor name OV02C10_SENSOR_NAME is defined twice in this file (lines 19 and 68). This duplication should be removed to avoid potential inconsistencies.
| #define OV02C10_SENSOR_NAME "OV02C10" |
| qdesc->type = ESP_CAM_SENSOR_PARAM_TYPE_NUMBER; | ||
| qdesc->number.minimum = s_ov02c10_exp_min; | ||
| qdesc->number.maximum = dev->cur_format->isp_info->isp_v1_info.vts - OV02C10_EXP_MAX_OFFSET; // max = VTS-6 = height+vblank-6, so when update vblank, exposure_max must be updated | ||
| qdesc->number.step = 1;; |
Copilot
AI
Oct 13, 2025
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.
Double semicolon detected. This should be a single semicolon to follow proper C syntax.
| qdesc->number.step = 1;; | |
| qdesc->number.step = 1; |
d333ee3 to
dddc26e
Compare
- Remove duplicate register 0x395f writes in all three format arrays - Remove duplicate OV02C10_SENSOR_NAME definition (line 68) - Fix double semicolon in exposure step assignment (line 1260) These were identified by GitHub Copilot automated code review.
a072f65 to
fa8f15e
Compare
|
Commit fa8f15e - Bug fixes from Copilot review |
| @@ -0,0 +1,27 @@ | |||
| /* | |||
| * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | |||
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.
Please update the date, and other documents as well.
|
@csvke Thank you for your PR. May I know if the current driver can acquire image data on the ESP32-P4? |
Yes it can. Details as follows: 1288x728 @ 30fps worked 1920x1080 1-lane not tested 1920x1080 2-lane 8.2fps My question is: Can ESP32P4's ISP + MIPI CSI + current ESP-IDF v5.5.1 processes 1920x1080 @ 30fps camera image data? I think theoretically yes but perhaps my test case created some bottleneck somewhere. My current test case is to use ESP-Brookesia v0.5.0 with LVGL9, create a camera app, and to show a live preview based on after resolutions. I have safely ruled out the speed of PSRAM, and bitrate of the MIPI CSI bus (400Mbit should be sufficient) so the next logical culprit would be a misconfigured driver in which I would first look at the timings, hence the PCLK, VTS and HTS values. The development board I'm using is GUITION JC4880P443-I-W |
|
@csvke Hi. 1920x1080 @ 30fps? -> Yes. |
Add support for OmniVision OV02C10 2MP MIPI CSI camera sensor with the following features:
Hardware Specifications:
Supported Configurations:
Driver Features:
Implementation includes:
Tested on ESP32-P4 with JC4880P443C display module.
Description
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following: