Difference between revisions of "CS-MIPI-X i2c"

From wiki_veye
Jump to navigation Jump to search
Line 1: Line 1:
 
[[CS-MIPI-X i2c/zh|查看中文]]
 
[[CS-MIPI-X i2c/zh|查看中文]]
  
<big>'''cs_mipi_i2c.sh 参数配置脚本使用说明'''</big>
+
<big>'''cs_mipi_i2c.sh Shell scripts usage'''</big>
  
===介绍===
+
===Introduction===
cs_mipi_i2c.sh 脚本为通过I2C协议对CS-MIPI-X系列的摄像头进行配置的工具集。
+
The cs_mipi_i2c.sh script is a toolset for configuring CS-MIPI-X series cameras through the I2C.
  
目录下总共4个文件,camera_i2c_config、i2c_read、i2c_write、cs_mipi_i2c.sh。
+
Include the following files,camera_i2c_config、i2c_read、i2c_write、cs_mipi_i2c.sh.
  
你需要先运行
+
Running
  
 
<code>./enable_i2c_vc.sh</code>
 
<code>./enable_i2c_vc.sh</code>
Line 14: Line 14:
 
<code>./camera_i2c_config</code>
 
<code>./camera_i2c_config</code>
  
配置管脚,然后执行cs_mipi_i2c.sh
+
first,it will config IO pin. Then you can run cs_mipi_i2c.sh.
===camera_i2c_config 使用说明===
+
===camera_i2c_config USAGE===
连接树莓派Computer Module情况下,运行
+
 
 +
*for standard RPI, just run
 +
 
 +
<code>./camera_i2c_config</code>
 +
 
 +
*for RPI Computer Module
  
 
<code>./camera_i2c_config [cameranum]</code>
 
<code>./camera_i2c_config [cameranum]</code>
Line 28: Line 33:
 
|1
 
|1
 
|CAM1
 
|CAM1
|}连接树莓派经典版型情况下,直接运行
+
|}
 
+
===cs_mipi_i2c.sh USAGE===
<code>./camera_i2c_config</code>
 
===cs_mipi_i2c.sh 使用说明===
 
 
./cs_mipi_i2c.sh
 
./cs_mipi_i2c.sh
  
Usage: ./veye_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -b bus
+
Usage:  ./cs_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -p3 param3 -b bus
  
 
options:
 
options:
  
-r read
+
    -r                       read
  
-w write
+
    -w                       write
  
-f [function name] function name
+
    -f [function name]       function name
  
-p1 [param1] param1 of each function
+
    -p1 [param1]                           param1 of each function
  
-p2 [param1] param2 of each function
+
    -p2 [param1]                           param2 of each function
  
-b [i2c bus num] i2c bus number
+
    -p3 [param1]                           param3 of each function
  
support functions: devid,hdver,wdrmode,videoformat,mirrormode,denoise,agc,lowlight,daynightmode,ircutdir,irtrigger
+
    -b [i2c bus num]               i2c bus number
  
对于树莓派Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G),使用i2c0, '''对于Compute Module/ CM3,使用i2c1,请添加-b1 选项。'''
+
 
====使用详解====
+
Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G),we use i2c0
 +
 
 +
Compute Module/ CM3,we use i2c1,please add '''-b 1''' option.
 
=====devid=====
 
=====devid=====
 
<code>./cs_mipi_i2c.sh -r -f devid</code>
 
<code>./cs_mipi_i2c.sh -r -f devid</code>
Line 66: Line 71:
 
<code>./cs_mipi_i2c.sh -r -f firmwarever</code>
 
<code>./cs_mipi_i2c.sh -r -f firmwarever</code>
  
获取固件版本号,一般为X.Y格式,如1.0
+
get firmware version, X.Y, 1.0 for example.
 
=====productmodel=====
 
=====productmodel=====
 
<code>./cs_mipi_i2c.sh -r -f productmodel</code>
 
<code>./cs_mipi_i2c.sh -r -f productmodel</code>
  
获取产品型号,如:CS-MIPI-IMX307
+
get product model,for example:CS-MIPI-IMX307
 
=====videofmtcap=====
 
=====videofmtcap=====
 
<code>./cs_mipi_i2c.sh -r -f videofmtcap</code>
 
<code>./cs_mipi_i2c.sh -r -f videofmtcap</code>
  
获取摄像头支持的视频码流格式,如:
+
get camera video format capbility, for example:
  
 
1920*1080 30fps
 
1920*1080 30fps
Line 86: Line 91:
 
<code>./cs_mipi_i2c.sh -w -f videofmt -p1 1280 -p2 720 -p3 60</code>
 
<code>./cs_mipi_i2c.sh -w -f videofmt -p1 1280 -p2 720 -p3 60</code>
  
获取和设置摄像头当前的视频码流格式,如:
+
get and set current video format,for example:
  
 
1920*1080 30fps
 
1920*1080 30fps
Line 94: Line 99:
 
<code>./cs_mipi_i2c.sh -r -f ispcap</code>
 
<code>./cs_mipi_i2c.sh -r -f ispcap</code>
  
获取当前模组支持的isp配置能力集,详细说明后续补充。
+
get camera isp capbility. Will add details later.
 
=====powerhz=====
 
=====powerhz=====
 
<code>./cs_mipi_i2c.sh -r -f powerhz</code>
 
<code>./cs_mipi_i2c.sh -r -f powerhz</code>
Line 106: Line 111:
 
|-
 
|-
 
|50
 
|50
|工频为50Hz
+
|Power frequency is 50Hz
 
|-
 
|-
 
|60
 
|60
|工频为60Hz
+
|Power frequency is 60Hz
|}配置当前模组使用环境的工频频率。50Hz环境对应帧率为25、50、100,60Hz环境对应帧率为30、60、120。
+
|}Configure the power frequency of the environment in which the camera is used.
 +
 
 +
50Hz framerate is 25、50、100;60Hz framerate is 30、60、120.
 
=====paramsave=====
 
=====paramsave=====
 
<code>./cs_mipi_i2c.sh -w -f paramsave</code>
 
<code>./cs_mipi_i2c.sh -w -f paramsave</code>
  
将已经配置的参数写入到flash。断电保存。
+
Write the configured parameters to flash. So parameters will not be lost when poweroff.
 
=====sysreset=====
 
=====sysreset=====
 
<code>./cs_mipi_i2c.sh -w -f sysreset</code>
 
<code>./cs_mipi_i2c.sh -w -f sysreset</code>
  
摄像头恢复出厂默认参数。
+
The camera reset to the factory default parameters.

Revision as of 20:35, 2 December 2019

查看中文

cs_mipi_i2c.sh Shell scripts usage

1 Introduction

The cs_mipi_i2c.sh script is a toolset for configuring CS-MIPI-X series cameras through the I2C.

Include the following files,camera_i2c_config、i2c_read、i2c_write、cs_mipi_i2c.sh.

Running

./enable_i2c_vc.sh

./camera_i2c_config

first,it will config IO pin. Then you can run cs_mipi_i2c.sh.

2 camera_i2c_config USAGE

  • for standard RPI, just run

./camera_i2c_config

  • for RPI Computer Module

./camera_i2c_config [cameranum]

cameranum description
0 CAM0
1 CAM1

3 cs_mipi_i2c.sh USAGE

./cs_mipi_i2c.sh

Usage:  ./cs_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -p3 param3 -b bus

options:

    -r                       read

    -w                       write

    -f [function name]       function name

    -p1 [param1]                           param1 of each function

    -p2 [param1]                           param2 of each function

    -p3 [param1]                           param3 of each function

    -b [i2c bus num]               i2c bus number


Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G),we use i2c0

Compute Module/ CM3,we use i2c1,please add -b 1 option.

3.1 devid

./cs_mipi_i2c.sh -r -f devid

value description
0x210 CS-MIPI-IMX307
3.2 firmwarever

./cs_mipi_i2c.sh -r -f firmwarever

get firmware version, X.Y, 1.0 for example.

3.3 productmodel

./cs_mipi_i2c.sh -r -f productmodel

get product model,for example:CS-MIPI-IMX307

3.4 videofmtcap

./cs_mipi_i2c.sh -r -f videofmtcap

get camera video format capbility, for example:

1920*1080 30fps

1280*720 60fps

3.5 videofmt

./cs_mipi_i2c.sh -r -f videofmt

./cs_mipi_i2c.sh -w -f videofmt -p1 1920 -p2 1080 -p3 30

./cs_mipi_i2c.sh -w -f videofmt -p1 1280 -p2 720 -p3 60

get and set current video format,for example:

1920*1080 30fps

1280*720 60fps

3.6 ispcap

./cs_mipi_i2c.sh -r -f ispcap

get camera isp capbility. Will add details later.

3.7 powerhz

./cs_mipi_i2c.sh -r -f powerhz

./cs_mipi_i2c.sh -w -f powerhz -p1 50

./cs_mipi_i2c.sh -w -f powerhz -p1 60

value description
50 Power frequency is 50Hz
60 Power frequency is 60Hz

Configure the power frequency of the environment in which the camera is used.

50Hz framerate is 25、50、100;60Hz framerate is 30、60、120.

3.8 paramsave

./cs_mipi_i2c.sh -w -f paramsave

Write the configured parameters to flash. So parameters will not be lost when poweroff.

3.9 sysreset

./cs_mipi_i2c.sh -w -f sysreset

The camera reset to the factory default parameters.