Skip to content

Commit

Permalink
* support gcore_gc02m1
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed Jan 6, 2025
1 parent b36179c commit f9f4091
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/3rd_party/sophgo-middleware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ append_srcs_dir(middleware_src_dir ${middleware_src_path}/v2/sample/common
${middleware_src_path}/v2/component/isp/sensor/sg200x/ov_ov2685
${middleware_src_path}/v2/component/isp/sensor/sg200x/lontium_lt6911
${middleware_src_path}/v2/component/isp/sensor/sg200x/ov_os04a10
${middleware_src_path}/v2/component/isp/sensor/sg200x/gcore_gc02m1
)
list(APPEND ADD_SRCS ${middleware_src_dir})
set_property(SOURCE ${middleware_src_dir} PROPERTY GENERATED 1)
Expand Down Expand Up @@ -70,4 +71,5 @@ list(APPEND ADD_DEFINITIONS_PRIVATE -DSENSOR_SMS_SC035GS
list(APPEND ADD_DEFINITIONS_PRIVATE -DSENSOR_OV_OV2685)
list(APPEND ADD_DEFINITIONS_PRIVATE -DSENSOR_LONTIUM_LT6911)
list(APPEND ADD_DEFINITIONS_PRIVATE -DSENSOR_OV_OS04A10)
list(APPEND ADD_DEFINITIONS_PRIVATE -DSENSOR_GCORE_GC02M1)
register_component(DYNAMIC)
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef struct _ISP_SNS_OBJ_S {
extern ISP_SNS_OBJ_S stSnsBG0808_Obj;
extern ISP_SNS_OBJ_S stSnsBF2253L_Obj;
extern ISP_SNS_OBJ_S stSnsCV4001_Obj;
extern ISP_SNS_OBJ_S stSnsGc02m1b_Obj;
extern ISP_SNS_OBJ_S stSnsGc02m1_Obj;
extern ISP_SNS_OBJ_S stSnsGc0312_Obj;
extern ISP_SNS_OBJ_S stSnsGc0329_Obj;
extern ISP_SNS_OBJ_S stSnsGc1054_Obj;
Expand Down
24 changes: 24 additions & 0 deletions components/vision/port/maixcam/maix_camera_mmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ namespace maix::camera
// log::info("find ov_os04a10, addr %#x", addr_list[i]);
snprintf(name, sizeof(name), "ov_os04a10");
return {true, name};
case 0x37:
// log::info("find ov_os04a10, addr %#x", addr_list[i]);
snprintf(name, sizeof(name), "gcore_gc02m1");
return {true, name};
case 0x48:// fall through
case 0x3c:
// log::info("find ov_ov2685, addr %#x", addr_list[i]);
Expand Down Expand Up @@ -516,6 +520,16 @@ namespace maix::camera
vi_format = PIXEL_FORMAT_NV21;
vi_vpss_format = PIXEL_FORMAT_NV21;
err::check_bool_raise(!CVI_BIN_SetBinName(WDR_MODE_NONE, "/mnt/cfg/param/cvi_sdr_bin.os04a10"), "set config path failed!");
} else if (!strcmp(sensor_name, "gcore_gc02m1")) {
sensor_cfg.sns_type = GCORE_GC02M1_MIPI_2M_30FPS_10BIT;
sensor_cfg.lane_id = {0, 1, -1, -1, -1};
sensor_cfg.pn_swap = {1, 1, 0, 0, 0};
sensor_cfg.mclk_en = 1;
sensor_cfg.i2c_addr = 0x37;
sensor_cfg.exptime_max = 363636;
sensor_cfg.exptime_min = 33333;
vi_format = PIXEL_FORMAT_NV21;
vi_vpss_format = PIXEL_FORMAT_NV21;
} else { // default is gcore_gc4653
if (width <= 1280 && height <= 720 && fps > 30) {
sensor_cfg.sns_type = GCORE_GC4653_MIPI_720P_60FPS_10BIT;
Expand Down Expand Up @@ -575,6 +589,16 @@ namespace maix::camera
vi_format = PIXEL_FORMAT_NV21;
vi_vpss_format = PIXEL_FORMAT_NV21;
err::check_bool_raise(!CVI_BIN_SetBinName(WDR_MODE_NONE, "/mnt/cfg/param/cvi_sdr_bin.os04a10"), "set config path failed!");
} else if (!strcmp(sensor_name, "gcore_gc02m1")) {
sensor_cfg.sns_type = GCORE_GC02M1_MIPI_2M_30FPS_10BIT;
sensor_cfg.lane_id = {4, 3, -1, -1, -1};
sensor_cfg.pn_swap = {0, 0, 0, 0, 0};
sensor_cfg.mclk_en = 1;
sensor_cfg.i2c_addr = 0x37;
sensor_cfg.exptime_max = 363636;
sensor_cfg.exptime_min = 33333;
vi_format = PIXEL_FORMAT_NV21;
vi_vpss_format = PIXEL_FORMAT_NV21;
} else { // default is gcore_gc4653
if (width <= 1280 && height <= 720 && fps > 30) {
sensor_cfg.sns_type = GCORE_GC4653_MIPI_720P_60FPS_10BIT;
Expand Down

0 comments on commit f9f4091

Please sign in to comment.