Hello,6by9 .
Use v4l2 device for OV2311, everything is OK . Did you try the 2x2binning function?
I add the Regs for Binning like this:
And add a mode:When stream on ,there is no data.~~~
How to change HTS&VTS when resolution changed? hts_def =< 0x380c / 0x380d * 2> , why double it?
OV2311 default value is 0x388, but VTS=V_active+V_blank, then V_active default to 1300, So i confused for this~~
Use v4l2 device for OV2311, everything is OK . Did you try the 2x2binning function?
I add the Regs for Binning like this:
Code:
static const struct regval ov2311_640x480_2x2binning_regs[] = {{ 0x3800, 0x00 },//X start=(1600-640*2)/2=160{ 0x3801, 0xA0 },{ 0x3802, 0x00 },//Y_start=(1300-480*2)/2=170{ 0x3803, 0xAA },{ 0x3804, 0x05 },//X_end 1615-160=1455{ 0x3805, 0xaf },{ 0x3806, 0x04 },//Y_end= 1145, 1315-170=1145{ 0x3807, 0x79 },{ 0x3808, 0x02 },//X_output_size=640{ 0x3809, 0x80 },{ 0x380a, 0x01 },//Y_output_size=480{ 0x380b, 0xe0 },{ 0x3820, 0x02 },//Vbinning enable{ 0x3821, 0x01 }, //Hbinning enable{REG_NULL, 0x00},};
And add a mode:
Code:
{.width = 640,.height = 480,.exp_def = 0x0320,.brightness_def = 0,.binning = true,.hts_def = (0x0388 * 2),/* Registers 0x380c / 0x380d * 2 */.vts_def = 0x5c2 - (1300 - 480*2),// Registers 0x380e / 0x380f .crop = {.left =160 + OV2311_PIXEL_ARRAY_LEFT,.top = 170 + OV2311_PIXEL_ARRAY_TOP,.width = 640*2,.height = 480*2},.reg_list = ov2311_640x480_2x2binning_regs,},
How to change HTS&VTS when resolution changed? hts_def =< 0x380c / 0x380d * 2> , why double it?
OV2311 default value is 0x388, but VTS=V_active+V_blank, then V_active default to 1300, So i confused for this~~
Statistics: Posted by zhenlinfan — Fri Jul 12, 2024 1:07 pm