Difference between revisions of "Mv mipi i2c.sh user guide"

From wiki_veye
Jump to navigation Jump to search
Line 116: Line 116:
 
<code>./mv_mipi_i2c.sh -r -f i2caddr</code> <br />This module support i2c address changed by software, i2c address range[0x3,0x77].  
 
<code>./mv_mipi_i2c.sh -r -f i2caddr</code> <br />This module support i2c address changed by software, i2c address range[0x3,0x77].  
  
Only after paramsave and reboot will it really take effect.
+
Will really take effect only after paramsave and reboot .
  
 
==== Image Acquisition ====
 
==== Image Acquisition ====
 +
 +
===== imgacq =====
 +
<code>./mv_mipi_i2c.sh -w -f imgacq -p1 [0/1]</code>
 +
 +
 +
./mv_mipi_i2c.sh -r -f maxwh
 +
 +
./mv_mipi_i2c.sh -r -f maxfps
 +
 +
0 normal,
 +
 +
1 mirror,
 +
 +
2 flip,
 +
 +
3 flip&mirror
 +
 +
./mv_mipi_i2c.sh -w -f imgdir -p1 [0,3]
 +
 +
./mv_mipi_i2c.sh -r -f imgdir
 +
 +
0 raw8
 +
 +
1 raw10
 +
 +
2 raw12
 +
 +
3 raw14
 +
 +
4 UYVY
 +
 +
./mv_mipi_i2c.sh -w -f pixelformat -p1 [0,2]
 +
 +
./mv_mipi_i2c.sh -r -f pixelformat
 +
 +
./mv_mipi_i2c.sh -w -f blacklevel -p1 []
 +
 +
./mv_mipi_i2c.sh -r -f blacklevel
 +
 +
./mv_mipi_i2c.sh -w -f roi -p1 [x] -p2 [y] -p3 [width] -p4 [height]
 +
 +
./mv_mipi_i2c.sh -r -f roi
 +
 +
1 宽竖条纹
 +
 +
2 细密竖条纹
 +
 +
./mv_mipi_i2c.sh -w -f testimg -p1 []
 +
 +
./mv_mipi_i2c.sh -r -f testimg
 +
 +
./mv_mipi_i2c.sh -w -f fps -p1 []
 +
 +
./mv_mipi_i2c.sh -r -f fps
 +
 
<br />
 
<br />
  

Revision as of 21:19, 7 March 2022

mv_mipi_i2c.sh Shell scripts usage

1 Overview

The mv_mipi_i2c.sh script is a tool set for configuring MV MIPI series cameras through the I2C.

This script is essentially an access to registers. For registers, please refer to MV Series MIPI Camera Register Map.

2 Raspberry Pi Only, Set IO config

Running

./enable_i2c_vc.sh

./camera_i2c_config

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

3 mv_mipi_i2c.sh USAGE

./mv_mipi_i2c.sh

Usage:  ./mv_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

    -p3 [param3]                           param3 of each function

    -p4 [param4]                           param4 of each function

    -b [i2c bus num]               i2c bus number

    -d [i2c addr]                  i2c addr if not default 0x3b

Please open this srcipt and read the COMMENT on top for support functions and samples

4 i2c bus number on different board

Please refer to the following article to determine which -b parameter you need to use.

i2c bus number on different boards

5 Functions list

5.1 Note

The camera has two states, standby and running, after the start of image acquisition into the running state.

There are some registers that are write-protected in the running state, which will be marked with an asterisk. For example: trgsrc* .

There are some parameters that have strict range restrictions, and it's a good idea to try reading them when you're in doubt.

5.2 Basic Parameters

5.2.1 manufacturer

./mv_mipi_i2c.sh -r -f manufacturer

Get the manufacturer name, which is VEYE.

5.2.2 model

./mv_mipi_i2c.sh -r -f model

Get the product model, such as MV-MIPI-IMX178.

5.2.3 version

./mv_mipi_i2c.sh -r -f version

Get the Controller version number and Logical version number.

The system has two main control chips that serve the control and logic functions respectively.

5.2.4 timestamp

./mv_mipi_i2c.sh -r -f timestamp

Time after system startup in Milliseconds.

This value starts counting again if you call the reboot command, or if the camera reboots unexpectedly.

5.2.5 errcode

./mv_mipi_i2c.sh -r -f errcode

System error code, each bit represents an error type.

bit0: sensor error.

bit1: Logic module startup error.

bit2: Logic module communication error.

bit5: AA(AE&AG) regulation cannot reach the target brightness.

bit6: Authorization failure.

5.2.6 factoryparam

./mv_mipi_i2c.sh -w -f factoryparam

All parameters restored to factory default values.

5.2.7 paramsave

./mv_mipi_i2c.sh -w -f paramsave

Save all parameters to flash, and they will not be lost when power off.

5.2.8 reboot

./mv_mipi_i2c.sh -w -f reboot

Reboot the camera.

5.2.9 i2caddr

./mv_mipi_i2c.sh -w -f i2caddr -p1 [new]

./mv_mipi_i2c.sh -r -f i2caddr
This module support i2c address changed by software, i2c address range[0x3,0x77].

Will really take effect only after paramsave and reboot .

5.3 Image Acquisition

5.3.1 imgacq

./mv_mipi_i2c.sh -w -f imgacq -p1 [0/1]


./mv_mipi_i2c.sh -r -f maxwh

./mv_mipi_i2c.sh -r -f maxfps

0 normal,

1 mirror,

2 flip,

3 flip&mirror

./mv_mipi_i2c.sh -w -f imgdir -p1 [0,3]

./mv_mipi_i2c.sh -r -f imgdir

0 raw8

1 raw10

2 raw12

3 raw14

4 UYVY

./mv_mipi_i2c.sh -w -f pixelformat -p1 [0,2]

./mv_mipi_i2c.sh -r -f pixelformat

./mv_mipi_i2c.sh -w -f blacklevel -p1 []

./mv_mipi_i2c.sh -r -f blacklevel

./mv_mipi_i2c.sh -w -f roi -p1 [x] -p2 [y] -p3 [width] -p4 [height]

./mv_mipi_i2c.sh -r -f roi

1 宽竖条纹

2 细密竖条纹

./mv_mipi_i2c.sh -w -f testimg -p1 []

./mv_mipi_i2c.sh -r -f testimg

./mv_mipi_i2c.sh -w -f fps -p1 []

./mv_mipi_i2c.sh -r -f fps


5.4 Image Features


5.5 ISP


5.6 IO Control


5.7 Special Functions