5m mipi i2c user guide/zh

From wiki_veye
Jump to navigation Jump to search

1 介绍

本脚本为开源程序,通过是对i2c寄存器的直接访问达到配置摄像头模组的目的。

适用型号:VEYE-MIPI-IMX335

2 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

2.1 i2c bus的说明

jetson平台i2cbus的说明

2.2 使用详解

2.2.1 manufacturer

./veye5_mipi_i2c.sh -r -f manufacturer

读取厂家信息,总是返回:

Manufacturer is VEYE

2.2.2 model

./veye5_mipi_i2c.sh -r -f model

读取设备型号,比如:VEYE_MIPI_IMX335

2.2.3 version

./veye5_mipi_i2c.sh -r -f version

读取版本号,比如:

control version is 01.03 , isp version 01.00

2.2.4 timestamp

./veye5_mipi_i2c.sh -r -f timestamp

获取模组启动时刻开始计算的时间,循环递增,单位为毫秒。

2.2.5 factoryparam

./veye5_mipi_i2c.sh -w -f factoryparam

所有参数恢复默认值。

2.2.6 paramsave

./veye5_mipi_i2c.sh -w -f paramsave

保存参数。所有参数修改后,必须执行此命令,参数才会保存到flash中,掉电不再丢失。

2.2.7 reboot

./veye5_mipi_i2c.sh -w -f reboot

摄像头模组重启。

2.2.8 errcode

./veye5_mipi_i2c.sh -r -f errcode

获取摄像头错误码。正常情况下应该为0。

2.2.9 i2caddr

./veye5_mipi_i2c.sh -w -f i2caddr -p1 [new i2caddr] -d [old i2c addr]

./veye5_mipi_i2c.sh -r -f i2caddr -d [current i2c addr]

摄像机i2c地址,paramsave并reboot后生效。

2.2.10 i2cport

./veye5_mipi_i2c.sh -w -f i2cport -p1 [i2c port]

./veye5_mipi_i2c.sh -r -f i2cport

摄像机i2c端口,paramsave并reboot后生效。

value description
0x00 FFC 排线 i2c端口
0x01 备用白端子i2c端口
2.2.11 daynightmode

./veye5_mipi_i2c.sh -w -f daynightmode -p1 [0,2]

./veye5_mipi_i2c.sh -r -f daynightmode

日夜模式配置

value description
0x00 彩色模式
0x01 黑白模式
0x02 外触发模式
2.2.12 ircutdir

./veye5_mipi_i2c.sh -w -f ircutdir -p1 [0,1]

./veye5_mipi_i2c.sh -r -f ircutdir

IRCUT控制pin脚电平反向配置。

value description
0x00 默认方向
0x01 逆转IRCUT控制pin脚电平
2.2.13 irtrigger

./veye5_mipi_i2c.sh -w -f irtrigger -p1 [0,1]

./veye5_mipi_i2c.sh -r -f irtrigger

日夜切换外触发模式的触发信号高低电平配置。

value description
0x00 低电平为黑白模式,高电平为彩色模式
0x01 低电平为彩色模式,高电平为黑白模式
2.2.14 sensor_reg

./veye5_mipi_i2c.sh -r -f sensor_reg -p1 [sensor reg addr]

读取sensor寄存器

VIDEO_2592x1944p_20 = 1,//5M@20fps

VIDEO_2592x1944p_12_5 = 2,//5M@12.5fps

VIDEO_2560x1440p_25 = 3,//4M@25fps

VIDEO_2560x1440p_30 = 4,//4M@30fps

VIDEO_3840x2160p_12_5 = 5,//4K@12.5

VIDEO_3840x2160p_15 = 6,//4K@15

./veye5_mipi_i2c.sh -w -f videomode -p1 1

./veye5_mipi_i2c.sh -r -f videomode

./veye5_mipi_i2c.sh -w -f test_pattern -p1 [test_enable] -p2 [type]

./veye5_mipi_i2c.sh -r -f test_pattern

#0,auto;1,oneset

./veye5_mipi_i2c.sh -w -f awb_mode -p1 [0,1]

./veye5_mipi_i2c.sh -r -f awb_mode

./veye5_mipi_i2c.sh -w -f antiflicker -p1 [0,1]

./veye5_mipi_i2c.sh -r -f antiflicker

./veye5_mipi_i2c.sh -w -f agc_max -p1 [0,0xf]

./veye5_mipi_i2c.sh -r -f agc_max

./veye5_mipi_i2c.sh -w -f ae_target -p1 [0,0x64]

./veye5_mipi_i2c.sh -r -f ae_target

./veye5_mipi_i2c.sh -w -f ae_speed -p1 [0,0x64]

./veye5_mipi_i2c.sh -r -f ae_speed

./veye5_mipi_i2c.sh -w -f agc_speed -p1 [0,0x64]

./veye5_mipi_i2c.sh -r -f agc_speed

./veye5_mipi_i2c.sh -r -f exp_val

./veye5_mipi_i2c.sh -r -f agc_val

#0,auto; others, manual value

./veye5_mipi_i2c.sh -w -f mshutter -p1 [0,0x0B]

./veye5_mipi_i2c.sh -r -f mshutter

#0x0 : Off(Normal Image)  0x1 : Mirror  0x2 : V-Flip  0x3 : 180 Degree Rotate  

./veye5_mipi_i2c.sh -w -f mirrormode -p1 [0,0x03]

./veye5_mipi_i2c.sh -r -f mirrormode

./veye5_mipi_i2c.sh -w -f denoise_2d -p1 [0,0x3]

./veye5_mipi_i2c.sh -r -f denoise_2d

./veye5_mipi_i2c.sh -w -f denoise_3d -p1 [0,0x3]

./veye5_mipi_i2c.sh -r -f denoise_3d

#0x0 : OFF  0x09 :auto LOW  0x0B :auto MIDDLE  0x0C : auto HIGH

./veye5_mipi_i2c.sh -w -f sharppen -p1 [0,0x0f]

./veye5_mipi_i2c.sh -r -f sharppen