Line 35:
Line 35:
./cs_mipi_i2c.sh
./cs_mipi_i2c.sh
−
this shell scripts should be used for CS-MIPI-IMX307!
+
this shell scripts should be used for CS-MIPI-X!
Usage: ./cs_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -p3 param3 -b bus
Usage: ./cs_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -p3 param3 -b bus
Line 56:
Line 56:
-d [i2c addr] i2c addr if not default 0x3b
-d [i2c addr] i2c addr if not default 0x3b
+
===不同板子上的i2c序号 ===
+
请参考下面的文章,确定你所需要使用的-b参数。
−
support functions: devid,hdver,camcap,firmwarever,productmodel,videofmtcap,videofmt,ispcap,i2caddr,streammode,powerhz,
+
[[I2c bus number and video node|i2c bus number on different boards]]
−
+
===功能列表===
−
daynightmode ,hue ,contrast , satu , expostate , wbstate ,expmode , aetarget, aetime,aeagc,metime ,meagain , medgain , awbmode , mwbcolortemp , mwbgain,imagedir,sreg,striggerone,triggeredge,autotgcnt,tgdebncr,tgdly,pickmode,discardfrm,pickone,mipistatus,sysreboot,sysreset,paramsave
−
−
对于树莓派Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G),使用i2c0, '''对于Compute Module/ CM3,使用i2c1,请添加-b1 选项。'''
−
−
====使用详解====
−
=====devid=====
=====devid=====
<code>./cs_mipi_i2c.sh -r -f devid</code>
<code>./cs_mipi_i2c.sh -r -f devid</code>
Line 73:
Line 69:
|}
|}
=====hdver=====
=====hdver=====
−
<code>./veye_mipi_i2c.sh -r -f hdver</code>
+
<code>./cs_mipi_i2c.sh -r -f hdver</code>
获取逻辑固件版本号
获取逻辑固件版本号
Line 128:
Line 124:
<code>./cs_mipi_i2c.sh -r -f videofmt</code>
<code>./cs_mipi_i2c.sh -r -f videofmt</code>
+
====== 老版本码流格式控制 ======
<code>./cs_mipi_i2c.sh -w -f videofmt -p1 1920 -p2 1080 -p3 10</code>
<code>./cs_mipi_i2c.sh -w -f videofmt -p1 1920 -p2 1080 -p3 10</code>
Line 149:
Line 146:
注:sync模式不支持连续帧率可调。
注:sync模式不支持连续帧率可调。
+
+
====== 新版本码流格式控制 ======
+
注:CS-MIPI-IMX307 firmware V2.35版本之后支持。
+
+
<code>./cs_mipi_i2c.sh -w -f videofmt -p1 1920 -p2 1080 -p4 0.20</code>
+
+
p4参数,支持小数帧率功能,用于支持超过1秒的手动曝光模式。
=====ispcap=====
=====ispcap=====
Line 164:
Line 168:
bit4 : MWB manual white balance 手动白平衡配置
bit4 : MWB manual white balance 手动白平衡配置
+
+
bit5 : DME direct manual exposure 直接手动曝光配置
=====powerhz=====
=====powerhz=====
Line 257:
Line 263:
sync模式详见:[[Camera module Stream Mode manual/zh|摄像头模组码流模式说明]]
sync模式详见:[[Camera module Stream Mode manual/zh|摄像头模组码流模式说明]]
−
Note: only supported on camcap bit 0 is 1.
+
sync模式下,不支持帧率连续可调:
+
+
如果powerhz为60,则支持1080p@30,720p@60,vga@130。
+
+
如果powerhz为50,则支持1080p@25,720p@50,vga@130。
+
+
Note: only supported on camcap bit 0 is 1. Streammode是基础,修改streammode后需要重新配置曝光等参数。
*Trigger 模式
*Trigger 模式
Line 346:
Line 358:
1: 手动曝光
1: 手动曝光
+
+
2: 直接手动曝光,跳过isp环节,直接写sensor寄存器。CS-MIPI-SC132有效。此模式配合触发抓拍功能,配置参数的生效时间更快。
=====aetarget=====
=====aetarget=====
Line 363:
Line 377:
AE最长曝光时间,单位us。需'''expmode'''为自动模式下生效。
AE最长曝光时间,单位us。需'''expmode'''为自动模式下生效。
−
range:(100,1/framerate],如帧率为30,则范围是(100,33333].
+
expfrmmode为固定帧率模式下:range:(100,1/framerate],如帧率为30,则范围是(100,33333].
+
+
expfrmmode为慢快门模式下:range:(100,0xFFFFFFFF)
特殊值:0xFFFFFFFF=1/framerate,自动根据camera工作模式调整。
特殊值:0xFFFFFFFF=1/framerate,自动根据camera工作模式调整。
=====aeagc=====
=====aeagc=====
−
<code>./cs_mipi_i2c.sh -w -f aeagc-p1 X -p2 Y</code>
+
<code>./cs_mipi_i2c.sh -w -f aeagc -p1 X -p2 Y</code>
<code>./cs_mipi_i2c.sh -r -f aeagc</code>
<code>./cs_mipi_i2c.sh -r -f aeagc</code>
Line 416:
Line 432:
手动数字增益,单位dB,需'''expmode'''为手动模式下生效。
手动数字增益,单位dB,需'''expmode'''为手动模式下生效。
+
+
X is the integer part and Y is the decimal part, for example X is 2 and Y is 3 means 2.3dB.
+
+
X range: depending on sensor.
+
+
Y range: [0-9].
+
+
IMX307,dgain range is[0,42]dB, step 0.3dB.
+
+
=====dmetime=====
+
<code>./cs_mipi_i2c.sh -r -f dmetime</code>
+
+
<code>./cs_mipi_i2c.sh -w -f dmetime -p1 10000</code>
+
+
手动曝光时间,需'''expmode'''为直接手动模式下生效, us.
+
+
range:[0-1000000/framerate]
+
+
=====dmeagain=====
+
<code>./cs_mipi_i2c.sh -w -f dmeagain -p1 X -p2 Y</code>
+
+
<code>./cs_mipi_i2c.sh -r -f dmeagain</code>
+
+
手动模拟增益,单位dB,需'''expmode'''为直接手动模式下生效。
+
+
X is the integer part and Y is the decimal part, for example X is 2 and Y is 3 means 2.3dB.
+
+
X range: depending on sensor.
+
+
Y range: [0-9].
+
+
IMX307,agc range is[0,27]dB, step 0.3dB.
+
+
=====dmedgain=====
+
<code>./cs_mipi_i2c.sh -w -f dmedgain -p1 X -p2 Y</code>
+
+
<code>./cs_mipi_i2c.sh -r -f dmedgain</code>
+
+
手动数字增益,单位dB,需'''expmode'''为直接手动模式下生效。
X is the integer part and Y is the decimal part, for example X is 2 and Y is 3 means 2.3dB.
X is the integer part and Y is the decimal part, for example X is 2 and Y is 3 means 2.3dB.
Line 441:
Line 496:
<code>./cs_mipi_i2c.sh -r -f mwbgain</code>
<code>./cs_mipi_i2c.sh -r -f mwbgain</code>
−
manual white balance mode, set rgain and dgain manually, ggain is always 1.
+
manual white balance mode, set rgain and bgain manually, ggain is always 1.
GAIN is 4-bit decimal precision, for example: 0x23 means 2+3/16=2.19.
GAIN is 4-bit decimal precision, for example: 0x23 means 2+3/16=2.19.
Line 455:
Line 510:
<code>./cs_mipi_i2c.sh -r -f expostate</code>
<code>./cs_mipi_i2c.sh -r -f expostate</code>
−
readonly, get the current exposure state. exposure time, again and dgain.
+
readonly, get the current exposure state. exposure time, again and dgain. 直接曝光模式下无效。
=====wbstate=====
=====wbstate=====
Line 540:
Line 595:
note: 仅CS-MIPI-SC132支持。
note: 仅CS-MIPI-SC132支持。
=====pickmode=====
=====pickmode=====
−
<code>./cs_mipi_i2c.sh -w -f pickmode -p1 enable</code>
+
<code>./cs_mipi_i2c.sh -w -f pickmode -p1 [0/1]</code>
<code>./cs_mipi_i2c.sh -r -f pickmode</code>
<code>./cs_mipi_i2c.sh -r -f pickmode</code>
Line 572:
Line 627:
如果使能,则在Strobe IO引脚在传感器曝光时输出高电平。
如果使能,则在Strobe IO引脚在传感器曝光时输出高电平。
+
[[File:Trigger and Led-strobe.png|alt=Trigger and Led-strobe|none|thumb|Trigger and Led-strobe]]
note: 仅CS-MIPI-SC132支持。
note: 仅CS-MIPI-SC132支持。
Line 590:
Line 646:
|固定帧率模式(默认)
|固定帧率模式(默认)
|}
|}
−
自动曝光模式有效,慢快门模式通常用于低照度场景下进行自动降帧,以减少画面噪声。需要配合'''aetime'''参数使用。
+
自动曝光模式有效,慢快门模式通常用于低照度场景下进行自动降帧,以减少画面噪声。需要配合'''aetime,slowshuttergain'''参数使用。
+
+
===== slowshuttergain =====
+
<code>./cs_mipi_i2c.sh -w -f slowshuttergain -p1 X -p2 Y</code>
+
+
<code>./cs_mipi_i2c.sh -r -f slowshuttergain</code>
+
+
慢快门模式下,开始降低帧率的增益阈值,单位dB,需'''expfrmmode'''为慢快门模式下生效。
+
+
在慢快门模式下,场景逐渐变暗,AE算法会首先提高曝光时间,达到'''aetime'''上限后,再提高增益,达到'''slowshuttergain'''值后,开始继续提高曝光时间,此时帧率会降低。
+
+
X is the integer part and Y is the decimal part, for example X is 2 and Y is 3 means 2.3dB.
+
+
X range: depending on sensor.
+
+
Y range: [0-9].
+
+
===== yuvseq =====
+
<code>./veye_mipi_i2c.sh -w -f yuvseq -p1 YUYV</code>
+
+
<code>./veye_mipi_i2c.sh -w -f yuvseq -p1 UYVY</code>
+
+
<code>./veye_mipi_i2c.sh -r -f yuvseq</code>
+
+
配置摄像头的yuv顺序。<br />Note: only supported on firmware version >= 2.38.