Line 1: |
Line 1: |
| + | [[5m mipi i2c user guide|English]] |
| | | |
| + | === 介绍 === |
| + | 本脚本为开源程序,通过是对i2c寄存器的直接访问达到配置摄像头模组的目的。 |
| + | |
| + | 适用型号:VEYE-MIPI-IMX335 |
| + | |
| + | === veye5_mipi_i2c.sh使用说明 === |
| + | Usage: ./veye_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -b bus |
| + | |
| + | options: |
| + | |
| + | -r read |
| + | |
| + | -w write |
| + | |
| + | -f [function name] function name |
| + | |
| + | -p1 [param1] param1 of each function |
| + | |
| + | -p2 [param1] param2 of each function |
| + | |
| + | -b [i2c bus num] i2c bus number |
| + | |
| + | -d [i2c addr] i2c addr if not default 0x3b |
| + | ===不同板子上的i2c序号=== |
| + | 请参考下面的文章,确定你所需要使用的-b参数。 |
| + | |
| + | [http://wiki.veye.cc/index.php/I2c_bus_number_and_video_node i2c bus number on different boards] |
| + | ===功能列表=== |
| + | 下列代码中[param]方括号中的部分,表示变量。 |
| + | |
| + | ===== manufacturer ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f manufacturer</code> |
| + | |
| + | 读取厂家信息,总是返回: |
| + | |
| + | Manufacturer is VEYE |
| + | |
| + | ===== model ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f model</code> |
| + | |
| + | 读取设备型号,比如:VEYE_MIPI_IMX335 |
| + | |
| + | ===== version ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f version</code> |
| + | |
| + | 读取版本号,比如: |
| + | |
| + | control version is 01.03 , isp version 01.00 |
| + | |
| + | ===== timestamp ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f timestamp</code> |
| + | |
| + | 获取模组启动时刻开始计算的时间,循环递增,单位为毫秒。 |
| + | |
| + | ===== factoryparam ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f factoryparam</code> |
| + | |
| + | 所有参数恢复默认值。 |
| + | |
| + | ===== paramsave ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f paramsave</code> |
| + | |
| + | 保存参数。所有参数修改后,必须执行此命令,参数才会保存到flash中,掉电不再丢失。 |
| + | |
| + | ===== reboot ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f reboot</code> |
| + | |
| + | 摄像头模组重启。 |
| + | |
| + | ===== errcode ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f errcode</code> |
| + | |
| + | 获取摄像头错误码。正常情况下应该为0。 |
| + | |
| + | ===== i2caddr ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f i2caddr -p1 [new i2caddr] -d [old i2c addr]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f i2caddr -d [current i2c addr]</code> |
| + | |
| + | 摄像机i2c地址,paramsave并reboot后生效。 |
| + | |
| + | ===== i2cport ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f i2cport -p1 [i2c port]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f i2cport</code> |
| + | |
| + | 摄像机i2c端口,paramsave并reboot后生效。 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | !接口位置 |
| + | |- |
| + | |0x00 |
| + | |FFC 排线 i2c端口 |
| + | |'''[[VEYE-MIPI-IMX335数据手册#.E6.8E.A5.E5.8F.A3.E5.BC.95.E8.84.9A.E5.8A.9F.E8.83.BD.E8.AF.B4.E6.98.8E|J1 IIC]]''' |
| + | |- |
| + | | 0x01 |
| + | |备用白端子i2c端口 |
| + | |'''[[VEYE-MIPI-IMX335数据手册#.E6.8E.A5.E5.8F.A3.E5.BC.95.E8.84.9A.E5.8A.9F.E8.83.BD.E8.AF.B4.E6.98.8E|J5 辅助IIC]]''' |
| + | |} |
| + | |
| + | ===== daynightmode ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f daynightmode -p1 [0,2]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f daynightmode</code> |
| + | |
| + | 日夜模式配置 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | |- |
| + | |0x00 |
| + | |彩色模式 |
| + | |- |
| + | | 0x01 |
| + | |黑白模式 |
| + | |- |
| + | |0x02 |
| + | |外触发模式 |
| + | |} |
| + | |
| + | ===== ircutdir ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f ircutdir -p1 [0,1]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f ircutdir</code> |
| + | |
| + | IRCUT控制pin脚电平反向配置。 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | !备注 |
| + | |- |
| + | |0x00 |
| + | |默认方向 |
| + | |'''[[VEYE-MIPI-IMX335数据手册#.E6.8E.A5.E5.8F.A3.E5.BC.95.E8.84.9A.E5.8A.9F.E8.83.BD.E8.AF.B4.E6.98.8E|J4 Day/Night 日夜切换外部同步信号]]''' |
| + | |- |
| + | | 0x01 |
| + | |逆转IRCUT控制pin脚电平 |
| + | | |
| + | |} |
| + | |
| + | ===== irtrigger ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f irtrigger -p1 [0,1]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f irtrigger</code> |
| + | |
| + | 日夜切换外触发模式的触发信号高低电平配置。 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | !备注 |
| + | |- |
| + | |0x00 |
| + | |低电平为黑白模式,高电平为彩色模式 |
| + | | rowspan="2" |'''[[VEYE-MIPI-IMX335数据手册#.E6.8E.A5.E5.8F.A3.E5.BC.95.E8.84.9A.E5.8A.9F.E8.83.BD.E8.AF.B4.E6.98.8E|J4 : Day/Night 日夜切换外部同步信号]]''' |
| + | |- |
| + | | 0x01 |
| + | |低电平为彩色模式,高电平为黑白模式 |
| + | |} |
| + | |
| + | ===== sensor_reg ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f sensor_reg -p1 [sensor reg addr]</code> |
| + | |
| + | 读取sensor寄存器 |
| + | |
| + | ===== videomode ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f videomode -p1 [video mode]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f videomode</code> |
| + | |
| + | 摄像头分辨率模式配置 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | |- |
| + | |0x01 |
| + | |5M 2592x1944@20fps |
| + | |- |
| + | | 0x02 |
| + | |5M 2592x1944@12.5fps |
| + | |- |
| + | |0x03 |
| + | |4M 2560x1440@25fps |
| + | |- |
| + | |0x04 |
| + | |4M 2560x1440@30fps |
| + | |} |
| + | |
| + | ===== test_pattern ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f test_pattern -p1 [test_enable] -p2 [type]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f test_pattern</code> |
| + | |
| + | 图像测试模式配置 |
| + | |
| + | ===== awb_mode ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f awb_mode -p1 [0,1]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f awb_mode</code> |
| + | |
| + | AWB 模式配置 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | |- |
| + | |0x00 |
| + | |自动 |
| + | |- |
| + | | 0x01 |
| + | |oneset,触发一次白平衡运算 |
| + | |} |
| + | |
| + | ===== antiflicker ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f antiflicker -p1 [0,1]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f antiflicker</code> |
| + | |
| + | 抗闪烁功能是否开启。 |
| + | |
| + | ===== agc_max ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f agc_max -p1 [0,0xf]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f agc_max</code> |
| + | |
| + | 自动增益功能的上限。 |
| + | |
| + | ===== ae_target ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f ae_target -p1 [0,0x64]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f ae_target</code> |
| + | |
| + | 自动曝光的目标亮度。 |
| + | |
| + | ===== ae_speed ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f ae_speed -p1 [0,0x64]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f ae_speed</code> |
| + | |
| + | 自动曝光的调节速度。 |
| + | |
| + | ===== agc_speed ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f agc_speed -p1 [0,0x64]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f agc_speed</code> |
| + | |
| + | 自动增益的调节速度。 |
| + | |
| + | ===== exp_val ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f exp_val</code> |
| + | |
| + | 当前曝光值。 |
| + | |
| + | ===== agc_val ===== |
| + | <code>./veye5_mipi_i2c.sh -r -f agc_val</code> |
| + | |
| + | 当前增益值。 |
| + | |
| + | ===== mshutter ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f mshutter -p1 [0,0x0A]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f mshutter</code> |
| + | |
| + | 手动曝光是否开启及手动曝光配置。 |
| + | |
| + | <nowiki>#</nowiki>0,auto; others, manual value |
| + | {| class="wikitable" |
| + | ! rowspan="3" |手动快门参数 |
| + | (manual value) |
| + | ! colspan="5" |曝光时间 |
| + | |- |
| + | ! rowspan="2" |4M 30FPS |
| + | ! rowspan="2" |4M 25FPS |
| + | ! colspan="2" |5M 20FPS |
| + | ! rowspan="2" |5M 12.5FPS |
| + | |- |
| + | !antiflicker=0 |
| + | !antiflicker=1 |
| + | |- |
| + | |0x00 |
| + | |自动快门 |
| + | |自动快门 |
| + | |自动快门 |
| + | |自动快门 |
| + | |自动快门 |
| + | |- |
| + | | 0x01 |
| + | |1/30 |
| + | |1/25 |
| + | |1/30 |
| + | |1/40 |
| + | |1/25 |
| + | |- |
| + | |0x02 |
| + | |1/60 |
| + | |1/50 |
| + | |1/60 |
| + | |1/80 |
| + | |1/50 |
| + | |- |
| + | |0x03 |
| + | |1/120 |
| + | |1/100 |
| + | |1/120 |
| + | |1/160 |
| + | |1/100 |
| + | |- |
| + | |0x04 |
| + | |1/240 |
| + | |1/200 |
| + | |1/240 |
| + | |1/240 |
| + | |1/200 |
| + | |- |
| + | |0x05 |
| + | |1/480 |
| + | |1/400 |
| + | |1/480 |
| + | |1/480 |
| + | |1/400 |
| + | |- |
| + | |0x06 |
| + | |1/1000 |
| + | |1/1000 |
| + | |1/1000 |
| + | |1/1000 |
| + | |1/1000 |
| + | |- |
| + | |0x07 |
| + | |1/2000 |
| + | |1/2000 |
| + | |1/2000 |
| + | |1/2000 |
| + | |1/2000 |
| + | |- |
| + | |0x08 |
| + | |1/3000 |
| + | |1/5000 |
| + | |1/5000 |
| + | |1/5000 |
| + | |1/5000 |
| + | |- |
| + | |0x09 |
| + | |1/5000 |
| + | |1/10000 |
| + | |1/10000 |
| + | |1/10000 |
| + | |1/12375 |
| + | |- |
| + | |0x0A |
| + | |1/10000 |
| + | |1/76923 |
| + | |1/76923 |
| + | |1/76923 |
| + | |1/50000 |
| + | |- |
| + | |0x0B - 0x0F |
| + | |1/30 |
| + | |1/25 |
| + | |1/20 |
| + | |1/20 |
| + | |1/12.5 |
| + | |} |
| + | |
| + | ===== mirrormode ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f mirrormode -p1 [0,0x03]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f mirrormode</code> |
| + | |
| + | 视频翻转配置。 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | |- |
| + | |0x00 |
| + | |正常方向 |
| + | |- |
| + | | 0x01 |
| + | |左右翻转 |
| + | |- |
| + | |0x02 |
| + | |上下翻转 |
| + | |- |
| + | |0x03 |
| + | |左右上下翻转 |
| + | |} |
| + | |
| + | ===== denoise_2d ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f denoise_2d -p1 [0,0x3]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f denoise_2d</code> |
| + | |
| + | 2D降噪强度。 |
| + | |
| + | ===== denoise_3d ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f denoise_3d -p1 [0,0x3]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f denoise_3d</code> |
| + | |
| + | 3D降噪强度。 |
| + | |
| + | ===== sharppen ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f sharppen -p1 [0x10,0x1D]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f sharppen</code> |
| + | |
| + | 锐化强度配置。 |
| + | {| class="wikitable" |
| + | !value |
| + | !description |
| + | |- |
| + | |0x10 |
| + | |关闭 |
| + | |- |
| + | | 0x19 |
| + | |low |
| + | |- |
| + | |0x1B |
| + | |middle |
| + | |- |
| + | |0x1D |
| + | |high |
| + | |} |
| + | |
| + | ===== saturation ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f saturation -p1 [0,0x0A]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f saturation</code> |
| + | |
| + | 饱和度配置,默认为0xA。 |
| + | |
| + | ===== extra_color_gain ===== |
| + | <code>./veye5_mipi_i2c.sh -w -f extra_color_gain -p1 [0,0xFF]</code> |
| + | |
| + | <code>./veye5_mipi_i2c.sh -r -f extra_color_gain</code> |
| + | |
| + | 额外色彩增益,默认为0xC0。 |