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

From wiki_veye
Jump to navigation Jump to search
(先保存下,测试插入链接是否正确)
 
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Gx mipi i2c.sh user guide/zh|查看中文]]
 +
 
<big>'''gx_mipi_i2c.sh Shell scripts usage'''</big>
 
<big>'''gx_mipi_i2c.sh Shell scripts usage'''</big>
  
=== Overview ===
+
===Overview===
 
The gx_mipi_i2c.sh script is a tool set for configuring GX MIPI  series cameras through the I2C.
 
The gx_mipi_i2c.sh script is a tool set for configuring GX MIPI  series cameras through the I2C.
  
This script is essentially an access to registers. For registers, please refer to [https://wiki.veye.cc/index.php/Gx_Series_MIPI_Camera_Register_Map/zh GX Series MIPI Camera Register Map.]
+
This script is essentially an access to registers. For registers, please refer to [[Gx Series MIPI Camera Register Map|GX Series MIPI Camera Register Map.]]
  
=== Download ===
+
===Download===
We provide download links for mv_mipi_i2c.sh for different embedded platforms.  
+
We provide download links for gx_mipi_i2c.sh for different embedded platforms.  
  
 
Generally, these links can be found in the respective platform's GitHub repository.  
 
Generally, these links can be found in the respective platform's GitHub repository.  
Line 13: Line 15:
 
Below is the list:
 
Below is the list:
  
==== Nvidia Jetson: ====
+
===Prepare===
https://github.com/veyeimaging/nvidia_jetson_veye_bsp/tree/master/mv_tools_jetson/i2c_tools
+
<code>cd gx_tools_rpi/sources/</code>
 
 
==== Raspberry Pi: ====
 
https://github.com/veyeimaging/raspberrypi_v4l2/tree/main/mv_tools_rpi
 
 
 
==== RK35xx: ====
 
https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/mv_tools_rockchip/i2c_tools
 
 
 
=== Prepare ===
 
<code>cd mv_tools_rpi/sources/</code>
 
  
 
<code>./make.sh</code>
 
<code>./make.sh</code>
Line 31: Line 24:
 
<code>chmod +x *</code>
 
<code>chmod +x *</code>
  
=== mv_mipi_i2c.sh USAGE ===
+
===gx_mipi_i2c.sh USAGE===
<code>$ ./mv_mipi_i2c.sh</code>
+
<code>$ ./gx_mipi_i2c.sh</code>
  
<code>Usage:  ./mv_mipi_i2c.sh [-r/w]  [function name] [param1] [param2 ] [param3] [param4] -b bus</code>
+
<code>Usage:  ./gx_mipi_i2c.sh [-r/w]  [function name] [param1] [param2 ] [param3] [param4] -b bus</code>
  
 
<code>options:</code>
 
<code>options:</code>
Line 62: Line 55:
  
 
[[I2c bus number and video node|i2c bus number on different boards]]
 
[[I2c bus number and video node|i2c bus number on different boards]]
 +
 +
===Common Questions Regarding Scripts===
 +
1.When I2C communication fails, the following error message will be displayed.
 +
 +
./i2c_functions.sh: line 235: Read i2c err: syntax error in expression (error token is "i2c err")
 +
 +
2.When the script cannot find an executable binary file to execute, the following prompt will be shown.
 +
 +
❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vread
 +
 +
❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vwrite
 +
 
===Functions list===
 
===Functions list===
  
==== Note ====
+
====Note====
 
The camera has two states, '''standby''' and '''running''', after the start of image acquisition into the '''running''' state.
 
The camera has two states, '''standby''' and '''running''', after the start of image acquisition into the '''running''' state.
  
Line 71: Line 76:
 
There are some parameters that have strict range restrictions, and it's a good idea to try reading them when you're in doubt.
 
There are some parameters that have strict range restrictions, and it's a good idea to try reading them when you're in doubt.
  
==== Basic Parameters ====
+
====Basic Parameters====
  
===== manufacturer =====
+
=====manufacturer=====
<code>./mv_mipi_i2c_new.sh -r manufacturer -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number</code>
  
 
Get the manufacturer name, which is  '''VEYE'''.
 
Get the manufacturer name, which is  '''VEYE'''.
  
===== model =====
+
=====model=====
<code>./mv_mipi_i2c_new.sh -r model -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r model -b your_i2c_bus_number</code>
 +
 
 +
Get the product model, such as GX-MIPI-IMX662.
 +
 
 +
=====sensorname=====
 +
<code>./gx_mipi_i2c.sh -r sensorname -b your_i2c_bus_number</code>
  
Get the product model, such as '''MV-MIPI-IMX178M''' /  '''MV-MIPI-SC132M'''.
+
Get the sensor model, such as IMX662-AAQR.
  
===== version =====
+
=====version=====
<code>./mv_mipi_i2c_new.sh -r version -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r version -b your_i2c_bus_number</code>
  
 
Get the Controller version number and Logical version number.  
 
Get the Controller version number and Logical version number.  
Line 90: Line 100:
 
The system has two main control chips that serve the control and logic functions respectively.
 
The system has two main control chips that serve the control and logic functions respectively.
  
===== serialno =====
+
=====serialno=====
<code>./mv_mipi_i2c_new.sh -r serialno -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number</code>
  
 
Get the unique serial number of this module.
 
Get the unique serial number of this module.
  
===== timestamp =====
+
=====timestamp=====
<code>./mv_mipi_i2c_new.sh -r timestamp -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number</code>
 
 
Time after system startup in Milliseconds.
 
 
 
This value starts counting again if you call the reboot command, or if the camera reboots unexpectedly.
 
 
 
===== errcode =====
 
<code>./mv_mipi_i2c_new.sh -r errcode -b your_i2c_bus_number</code>
 
 
 
System error code, each bit represents an error type.
 
 
 
bit0: sensor error.
 
 
 
bit1: Logic module startup error.
 
  
bit2: Logic module communication error.
+
Get the time since the system started, in milliseconds.  
  
bit5: AA(AE&AG) regulation cannot reach the target brightness.
+
=====errcode=====
 +
reserved
  
bit6: Authorization failure.
+
=====fmtcap=====
 +
<code>./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number</code>
  
===== fmtcap =====
+
Get the Module supports data formats
<code>./mv_mipi_i2c_new.sh -r fmtcap -b your_i2c_bus_number</code>
 
  
 
Capbility of data formats supported by the camera.
 
Capbility of data formats supported by the camera.
Line 128: Line 126:
 
bit2: Mono12
 
bit2: Mono12
  
bit3: Mono14
+
bit3: Mono14 (reserved)
  
 
bit4: UYVY
 
bit4: UYVY
  
===== readmodecap =====
+
bit5: RGB888
<code>./mv_mipi_i2c_new.sh -r readmodecap -b your_i2c_bus_number</code>
+
 
 +
bit6: Temp (occupied,reserved)
 +
 
 +
bit7: YUYV
 +
 
 +
=====readmodecap=====
 +
<code>./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number</code>
 +
 
 +
Get the  Sensor reads out the capability set of patterns.
  
 
Capbility of read mode supported by the camera.
 
Capbility of read mode supported by the camera.
Line 139: Line 145:
 
bit0: Normal
 
bit0: Normal
  
bit1: Binning
+
bit1: binning mode
 +
 
 +
bit2: subsampling mode
  
bit2: Subsampling
+
=====workmodecap=====
 +
<code>./gx_mipi_i2c.sh -r workmodecap -b your_i2c_bus_number</code>
  
===== trgmodecap =====
+
Get the Video streaming mode capability set
<code>./mv_mipi_i2c_new.sh -r trgmodecap -b your_i2c_bus_number</code>
 
  
 
Capbility of trigger mode supported by the camera.
 
Capbility of trigger mode supported by the camera.
  
bit0:Video streaming mode.
+
bit0: Video streaming mode
  
bit1:Normal trigger mode.
+
bit1: Normal trigger mode.
  
bit2:Rolling shutter multi-frame trigger mode.
+
bit2: Rolling shutter multi-frame trigger mode.
  
 
bit3: Pulse trigger mode.
 
bit3: Pulse trigger mode.
  
===== factoryparam =====
+
bit4: Multi-camera synchronization mode.
<code>./mv_mipi_i2c_new.sh -w factoryparam -b your_i2c_bus_number</code>
+
 
 +
=====lanecap=====
 +
<code>./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number</code>
 +
 
 +
Get the number of MIPI Lanes supported by the camera
 +
 
 +
The number of MIPI lanes supported by the camera .
 +
 
 +
The lower to higher bits correspond to the supported capabilities for 1 lane, 2 lanes, 3 lanes, and 4 lanes, respectively.
 +
 
 +
For example, 0x2 indicates support for 2 lanes, and 0xA indicates support for both 2 lanes and 4 lanes.
  
All parameters restored to factory default values.
+
=====cameramodel0-cameramodel7=====
 +
<code>./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number</code>
  
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
+
Get the camera model, such as: cameramodel0 is 0x47582d4d(ascii is GX-M)
  
Additionally, it is recommended not to perform frequent factoryparam operations.
+
=====temp=====
===== paramsave =====
+
<code>./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w paramsave -b your_i2c_bus_number</code>
 
  
Save all parameters to flash, and they will not be lost when power off.
+
Get the temp is 25K
  
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
+
=====videomodecap=====
 +
<code>./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number</code>
  
Additionally, it is recommended not to perform frequent paramsave operations.
+
Get the videomodecap is 2
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|bit0
 +
|ROI mode
 +
|-
 +
|bit1
 +
|VideoMode mode
 +
|}
  
===== reboot =====
+
=====videomodenum=====
<code>./mv_mipi_i2c_new.sh -w reboot -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number</code>
  
Reboot the camera.
+
Get the videomodenum 1
  
===== i2caddr =====
+
=====vidoemodewh1-vidoemodewh8=====
<code>./mv_mipi_i2c_new.sh -w i2caddr  [new] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r i2caddr -b your_i2c_bus_number</code> <br />This module support i2c address changed by software, i2c address range[0x3,0x77].
+
Get the videomodewh1 is  0x7800438 (1920*1080)
  
Will really take effect only after paramsave and reboot .
+
In the first mode, the width is represented by the high 16 bits and the height by the low 16 bits.
  
===== slavemode =====
+
=====videomodeparam1-videomodeparam8=====
<code>./mv_mipi_i2c_new.sh -w slavemode  [0/1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r slavemode -b your_i2c_bus_number</code>
+
Get the videomodeparam1 is  0x1003c
  
Whether the sensor is operating in slave mode. In slave mode, the camera relies on external signals to provide XVS and XHS.
+
The frame rate and reading method of the first mode. The high 8-bit standby, the middle 8-bit is for reading mode, and the low 16-bit is for the maximum frame rate.
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0
 +
|ordinary
 +
|-
 +
|1
 +
|binning
 +
|-
 +
|2
 +
|subsampling
 +
|}
 +
=====factoryparam=====
 +
<code>./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number</code>
  
Writing this parameter will cause the camera to automatically save the current settings and reboot.  
+
All parameters restored to factory default values.
  
Currently, only RAW-MIPI-IMX462M support this function.  
+
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
  
===== minwh =====
+
Additionally, it is recommended not to perform frequent factoryparam operations.
<code>./mv_mipi_i2c_new.sh -r minwh -b your_i2c_bus_number</code>
+
=====paramsave=====
 +
<code>./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number</code>
  
Get the minimum width and height supported by the camera.
+
Save all parameters to flash, and they will not be lost when power off.
  
===== temp =====
+
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
<code>./mv_mipi_i2c_new.sh -r temp -b your_i2c_bus_number</code>
 
  
For cameras that support temperature sensors, obtain the temperature inside the camera chip.
+
Additionally, it is recommended not to perform frequent paramsave operations.
  
===== minfps =====
+
=====reboot=====
<code>./mv_mipi_i2c_new.sh -r minfps -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number</code>
  
Read the minimum frame rate supported by the current module.
+
Reboot the camera.
  
==== Image Acquisition ====
+
====Image Acquisition====
  
===== imgacq =====
+
=====imgacq=====
<code>./mv_mipi_i2c_new.sh -w imgacq  [0/1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w imgacq  [0/1] -b your_i2c_bus_number</code>
  
 
Start/Stop acquisition
 
Start/Stop acquisition
Line 224: Line 268:
 
Writing 0 will stop the output image and enter the standby state.
 
Writing 0 will stop the output image and enter the standby state.
  
===== trgmode* =====
+
=====workmode=====
<code>./mv_mipi_i2c_new.sh -w trgmode  [0,2] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w workmode [0,1,4] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r trgmode -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r workmode -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 238: Line 282:
 
|Normal trigger mode
 
|Normal trigger mode
 
|-
 
|-
|2
+
|4
|Rolling shutter multi-frame trigger mode
+
|Multi-camera synchronization mode
|-
 
|3
 
|Pulse trigger mode
 
 
|}
 
|}
 
See product manual for details.
 
See product manual for details.
  
===== trgsrc* =====
+
=====trgsrc=====
<code>./mv_mipi_i2c_new.sh -w trgsrc  [0,1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgsrc  [0,1] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r trgsrc -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r trgsrc -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 261: Line 302:
 
|}
 
|}
  
===== trgnum* =====
+
=====trgnum=====
<code>./mv_mipi_i2c_new.sh -w trgnum  [1,255] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgnum  [1,255] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r trgnum -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r trgnum -b your_i2c_bus_number</code>
  
 
The number of image frames output by one trigger signal in trigger mode.  
 
The number of image frames output by one trigger signal in trigger mode.  
  
===== trginterval* =====
+
=====trginterval=====
<code>./mv_mipi_i2c_new.sh -w trginterval [us] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trginterval [us] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r trginterval -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r trginterval -b your_i2c_bus_number</code>
  
 
Trigger interval in normal trigger mode, in microseconds. Range:[0.0xFFFFFF].
 
Trigger interval in normal trigger mode, in microseconds. Range:[0.0xFFFFFF].
  
===== trgcycle =====
+
=====trgone=====
<code>./mv_mipi_i2c_new.sh -r trgcycle -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
 
 
Reads the lowest trigger cycle in the current trigger mode.
 
 
 
===== trgone =====
 
<code>./mv_mipi_i2c_new.sh -w trgone -b your_i2c_bus_number</code>
 
  
 
Software trigger command.One execution will perform a soft trigger.
 
Software trigger command.One execution will perform a soft trigger.
  
===== trgcount =====
+
=====trgcount=====
<code>./mv_mipi_i2c_new.sh -r trgcount -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r trgcount -b your_i2c_bus_number</code>
  
 
Trigger count statistics.
 
Trigger count statistics.
Line 292: Line 328:
 
Get the total number of triggers and the number of trigger loss.
 
Get the total number of triggers and the number of trigger loss.
  
<code>./mv_mipi_i2c_new.sh -w trgcountclr -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgcount [1] -b your_i2c_bus_number</code>
  
 
Clear trigger count.
 
Clear trigger count.
  
===== framecount =====
+
=====i2caddr=====
<code>./mv_mipi_i2c_new.sh -r framecount -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w i2caddr  [new] -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -r i2caddr -b your_i2c_bus_number</code> <br />This module support i2c address changed by software, i2c address range[0x3,0x77].
 +
 
 +
Will really take effect only after paramsave and reboot .
 +
 
 +
=====nondiscontinuousmode=====
 +
<code>./gx_mipi_i2c.sh -w nondiscontinuousmode [0/1] -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -r nondiscontinuousmode -b your_i2c_bus_number</code>
 +
 
 +
Indicates whether the clock lan of the mipi signal is in continuous clock mode.
 +
 
 +
0: discontinuous mode
 +
 
 +
1: continuous mode
 +
 
 +
=====slavemode=====
 +
<code>./gx_mipi_i2c.sh -w slavemode  [0/1] -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -r slavemode -b your_i2c_bus_number</code>  
  
Frame count statistics.
+
Whether the sensor is operating in slave mode. In slave mode, the camera relies on external signals to provide XVS and XHS. 
  
The number of frames output by the sensor and the number of frames output by the camera module. Cyclic counting.
+
Writing this parameter will cause the camera to automatically save the current settings and reboot.  
  
==== IO Control ====
+
=====framecount=====
For RAW series cameras, the input IO supports trigger edge and trigger delay, and does not support trigger filtering function. The output IO is the strobe out pin of the sensor that leads directly.
+
<code>./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number</code> <br />Get the Sensor_Frame_Count is 434 , Out_Frame_Count is 436
  
===== trgdelay* =====
+
Sensor_Frame_Count:
<code>./mv_mipi_i2c_new.sh -r trgdelay -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w trgdelay  [us] -b your_i2c_bus_number</code>
+
The number of frames collected from the sensor is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.
  
Trigger delay, effective under both soft trigger and hard trigger mode.
+
Out_Frame_Count:
  
range: 0 to 1000000 (unit: microsecond)
+
The number of frames output is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.
  
===== trgedge* =====
+
=====triggercyclemin=====
<code>./mv_mipi_i2c_new.sh -r trgedge -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r triggercyclemin -b your_i2c_bus_number</code>  
  
<code>./mv_mipi_i2c_new.sh -w trgedge  [0,1] -b your_i2c_bus_number</code>
+
Get the Trigger_Cycle_Min is 0
  
Effective trigger edge in hard trigger mode.
+
=====daynightmode=====
{| class="wikitable"
+
<code>./gx_mipi_i2c.sh -w daynightmode [0,2] -b your_i2c_bus_number</code>
!value
 
!description
 
|-
 
|0
 
|Rising edge
 
|-
 
|1
 
|Falling edge
 
|}
 
  
===== trgfilter_enable* =====
+
<code>./gx_mipi_i2c.sh -r daynightmode -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -r trgfilter_enable -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w trgfilter_enable  [0,2] -b your_i2c_bus_number</code>
+
daynightmode type
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 341: Line 386:
 
|-
 
|-
 
|0
 
|0
|No filtering
+
|Color mode
 
|-
 
|-
 
|1
 
|1
|Rising edge filtering (filtering out low-level interference signals)
+
|Black and white mode
 
|-
 
|-
 
|2
 
|2
|Falling edge filtering (filtering out high level interference signals)
+
|External trigger mode
|-
 
|3
 
|Both rising edge and falling edge filtering
 
 
|}
 
|}
  
===== trgfilter_time* =====
+
=====ircutdir=====
<code>./mv_mipi_i2c_new.sh -r trgfilter_time -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w ircutdir [0/1] -b your_i2c_bus_number</code>
 
 
<code>./mv_mipi_i2c_new.sh -w trgfilter_time  [us] -b your_i2c_bus_number</code>
 
  
Trigger signal filtering window width.
+
<code>./gx_mipi_i2c.sh -r ircutdir -b your_i2c_bus_number</code>
  
range: 1 to 1000000 (unit: microsecond)
+
By default, if the voltage at port A is higher than that at port B (A > B), the IRCUT module will drive the filter to enter the optical path. When the direction is switched so that the voltage at port B becomes higher than that at port A (A < B), the polarity of the electromagnetic coil reverses, and the filter is driven to exit the optical path.
  
===== trgexp_delay* =====
+
=====pinpolarity=====
<code>./mv_mipi_i2c_new.sh -r trgexp_delay -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w pinpolarity [0/1] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w trgexp_delay  [us] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r pinpolarity -b your_i2c_bus_number</code>
  
Exposure delay, i.e. the time to turn on the Strobe signal in advance.
+
Trigger pin polarity reversal day and night. By default, a low level indicates night. After setting this value to 1, a high level indicates night.
  
range: 0 to 1000000 (unit: microsecond)
+
=====ircuttimer=====
 +
<code>./gx_mipi_i2c.sh -w ircuttimer [0/1] -b your_i2c_bus_number</code>
  
The difference between trgexp_delay and trgdelay, see manual for details.
+
<code>./gx_mipi_i2c.sh -r ircuttimer -b your_i2c_bus_number</code>
  
===== gpios_status =====
+
Whether to enable IRCUT periodic control; If enabled, IRCUT control will be performed according to the default cycle. If not enabled, control will only be carried out once during mode switching.
<code>./mv_mipi_i2c_new.sh -r gpios_status -b your_i2c_bus_number</code>
 
  
Get TriggerIN_IO, OUT_IO1 and OUT_IO2 status.
+
====Image Properties====
  
===== outio1_mode =====
+
=====testimg=====
<code>./mv_mipi_i2c_new.sh -r outio1_mode -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w testimg [0/1] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w outio1_mode  [0,1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r testimg -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 387: Line 427:
 
|-
 
|-
 
|0
 
|0
|strobe
+
|Common image
 
|-
 
|-
 
|1
 
|1
|user out
+
|Vertical color stripes
 
|}
 
|}
strobe: High level active.
 
 
user out: defined by '''outio1_usr.'''
 
  
===== outio1_usr =====
+
=====pixelformat=====
<code>./mv_mipi_i2c_new.sh -r outio1_usr -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w pixelformat [4/5/6/7] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w outio1_usr  [0,1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r pixelformat -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 405: Line 442:
 
|-
 
|-
 
|0
 
|0
|low
+
|Mono8
 
|-
 
|-
 
|1
 
|1
|high
+
|Mono10
|}
 
 
 
===== outio1_rvs =====
 
<code>./mv_mipi_i2c_new.sh -r outio1_rvs -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -w outio1_rvs  [0,1] -b your_i2c_bus_number</code>
 
 
 
Reverse OUT_IO1 high and low levels if set to 1.
 
 
 
===== outio2_mode =====
 
<code>./mv_mipi_i2c_new.sh -r outio2_mode -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -w outio2_mode  [0,5] -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
!value
 
!description
 
|-
 
|0
 
|strobe
 
|-
 
|1
 
|user out
 
 
|-
 
|-
 
|2
 
|2
|trigger wait
+
|Mono12
 
|-
 
|-
 
|3
 
|3
|XVS
+
|Mono14 (reserved)
 
|-
 
|-
 
|4
 
|4
|XHS
+
|UYVY
 
|-
 
|-
 
|5
 
|5
|Effective trigger signal (Sony's global shutter sensor only)
+
|RGB888
|}
 
strobe: High level active.
 
 
 
user out: defined by '''outio2_usr.'''
 
 
 
trigger wait: High level active. Indicate that the camera is not busy now, able to respond to the trigger signal.
 
 
 
XHS, XVS: The signal from the corresponding pin of the sensor. (For rolling shutter only).
 
 
 
===== outio2_usr =====
 
<code>./mv_mipi_i2c_new.sh -r outio2_usr -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -w outio2_usr  [0,1] -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
!value
 
!description
 
 
|-
 
|-
|0
+
|6
|low
+
|Temp (reserved)
 
|-
 
|-
|1
+
|7
|high
+
|YUYV
 
|}
 
|}
  
===== outio2_rvs =====
+
=====maxwh=====
<code>./mv_mipi_i2c_new.sh -r outio2_rvs -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r maxwh -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w outio2_rvs  [0,1] -b your_i2c_bus_number</code>
+
Get the maximum width and height supported by the sensor
  
Reverse OUT_IO1 high and low levels if set to 1.
+
=====minwh=====
 +
<code>./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number</code>
  
==== Image Features ====
+
Get the minimum width and height supported by the camera.
 
 
===== maxwh =====
 
<code>./mv_mipi_i2c_new.sh -r maxwh -b your_i2c_bus_number</code>
 
 
 
Get the maximum supported resolution of the sensor.
 
  
===== maxfps =====
+
=====maxfps=====
<code>./mv_mipi_i2c_new.sh -r maxfps -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r maxfps -b your_i2c_bus_number</code>
  
 
The maximum frame rate supported in the current mode.
 
The maximum frame rate supported in the current mode.
Line 488: Line 483:
 
Depending on the configured ROI, the maximum frame rate will be different. This parameter supports decimals.
 
Depending on the configured ROI, the maximum frame rate will be different. This parameter supports decimals.
  
===== fps* =====
+
=====minfps=====
<code>./mv_mipi_i2c_new.sh -w fps  [framerate] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r minfps -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r fps -b your_i2c_bus_number</code>
+
Read the minimum frame rate supported by the current module.
 
 
Configure the actual frame rate of the camera in the current mode. 
 
 
 
Range:(0,maxfps].
 
 
 
In video streaming mode, this parameter determines the actual frame rate.
 
 
 
In normal trigger mode, it is recommended to set the '''fps''' to the '''maxfps''' value to ensure the highest trigger signal responsiveness.
 
 
 
===== fps_ex* =====
 
<code>./mv_mipi_i2c_new.sh -w fps_ex [framerate] -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -r fps_ex -b your_i2c_bus_number</code>
 
 
 
Extended functionality of fps: '''fps_ex''' supports a precision of up to 1/10,000, primarily for more accurate exposure time control in long exposure mode. 
 
 
 
===== roi* =====
 
<code>./mv_mipi_i2c_new.sh -w roi  [x]  [y]  [width]  [height] -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -r roi -b your_i2c_bus_number</code>
 
 
 
ROI(region of interest) is the sensor output area, and the default is full screen output.
 
 
 
Parameter requirements:
 
 
 
[x]  [y] [height] must be 4-aligned;
 
 
 
[width] must be 8-aligned;
 
 
 
The minimum ROI resolution will be different for different sensors.  
 
  
For example, MV-MIPI-IMX178M minimum  resolution is: 376*320;MV-MIPI-SC130M minimum resolution is 64*64.
+
=====curwh=====
 +
<code>./gx_mipi_i2c.sh -r curwh -b your_i2c_bus_number</code>
  
The camera will make necessary adjustments to the user parameters to meet the parameter requirements.
+
Get the current width and height
  
So it is highly recommended that you read out the actual ROI parameters after writing them.
+
=====imgdir=====
 +
<code>./gx_mipi_i2c.sh -r imgdir -b your_i2c_bus_number</code>
  
===== imgdir =====
+
<code>./gx_mipi_i2c.sh -w imgdir [0/1/2/3] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w imgdir [0,3] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r imgdir -b your_i2c_bus_number</code>
+
Image orientation:
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 549: Line 515:
 
|flip&mirror
 
|flip&mirror
 
|}
 
|}
The image is first flipped/mirrored and then ROI cropped. For details, please refer to the manual.
 
  
===== pixelformat =====
+
=====videomode=====
<code>./mv_mipi_i2c_new.sh -w pixelformat  [0,2] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r videomode -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -w videomode [0-7] -b your_i2c_bus_number</code>
 +
 
 +
For cameras that use the VideoMode mode to select the frame rate of width and height, which mode to choose, Range [0-7],The corresponding capability set is VideomodeCap.
 +
 
 +
=====readmode=====
 +
<code>./gx_mipi_i2c.sh -r readmode -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r pixelformat -b your_i2c_bus_number</code>
+
image model:
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 560: Line 532:
 
|-
 
|-
 
|0
 
|0
|Mono8
+
|normal mode
 
|-
 
|-
 
|1
 
|1
|Mono10
+
|2x2binning mode
 +
|-
 +
|2
 +
|subsampling mode
 +
|}
 +
 
 +
=====lanenum=====
 +
<code>./gx_mipi_i2c.shsh -r lanenum -b your_i2c_bus_number</code>
 +
 
 +
Configuration of the number of LANs outputting MIPI signals
 +
{| class="wikitable"
 +
!value
 +
!description
 
|-
 
|-
 
|2
 
|2
|Mono12
+
|2lane
 
|-
 
|-
 
|4
 
|4
|UYVY
+
|4lane
 
|}
 
|}
Note that for the MV-MIPI-IMX178M, the AD bits of the sensor is always 12 bits, and the logic unit performs data rounding to achieve a different pixel format.
 
  
===== blacklevel =====
+
=====mipidatarate=====
<code>./mv_mipi_i2c_new.sh -w blacklevel  [blacklevel] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.shh -r mipidatarate -b your_i2c_bus_number</code>
 +
 
 +
The rate of each LAN in the MIPI system is measured in kbps.
 +
 
 +
=====fps=====
 +
<code>./gx_mipi_i2c.sh -r fps -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r blacklevel -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w fps -b [framerate] your_i2c_bus_number</code>
  
This black level value will be set directly to the sensor.
+
Configure the actual frame rate of the camera in the current mode.
  
===== blcmode =====
+
Range:(0,maxfps].
<code>./mv_mipi_i2c_new.sh -w blcmode  [0/1] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r blcmode -b your_i2c_bus_number</code>
+
In video streaming mode, this parameter determines the actual frame rate.
  
Black level calibration modes:
+
In normal trigger mode, it is recommended to set the fps to the maxfps value to ensure the highest trigger signal responsiveness.
  
0: Sensor automatic calibration or use default black level.
+
====Image Processing====
  
1: Manually specify black level.  
+
=====expmode=====
 +
<code>./gx_mipi_i2c.sh -r expmode -b your_i2c_bus_number</code>
  
===== testimg =====
+
<code>./gx_mipi_i2c.sh -w expmode [0/2] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w testimg  [0,2] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r testimg -b your_i2c_bus_number</code>
+
Exposure type
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 600: Line 587:
 
|-
 
|-
 
|0
 
|0
|Normal image
+
|manual exposure
|-
 
|1
 
|Test image 1
 
 
|-
 
|-
 
|2
 
|2
|Test image 2
+
|auto exposure
 
|}
 
|}
  
===== readmode* =====
+
=====aetarget=====
<code>./mv_mipi_i2c_new.sh -w readmode [0/1/2] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r aetarget -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r readmode -b your_i2c_bus_number</code>  
+
<code>./gx_mipi_i2c.sh -w aetarget  [0,255] -b your_i2c_bus_number</code>
  
Read mode:
+
The target brightness of AE algorithm.
  
0: Normal
+
Within the set range, the algorithm will prioritize the increase in exposure time,
  
1: Binning
+
and increase the gain if the exposure time reaches the maximum and still cannot reach the set target brightness value.
  
2: Subsampling
+
=====aestrategy=====
 +
<code>./gx_mipi_i2c.sh -r aestrategy -b your_i2c_bus_number</code>
  
===== lanenum* =====
+
<code>./gx_mipi_i2c.sh -w aestrategy [0/1] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w lanenum  [2/4] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r lanenum -b your_i2c_bus_number</code><br />For modules that support lane number configuration, use this register to modify the lane number.
+
Automatic exposure strategy
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0
 +
|Bright Area Priority mode (High Light priority
 +
|-
 +
|1
 +
|Dark zone priority mode (low light priority)
 +
|}
  
===== mipidatarate =====
+
=====metime=====
<code>./mv_mipi_i2c_new.sh -r mipidatarate -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r metime -b your_i2c_bus_number</code>
  
The MIPI datarate for each lane, measured in Kbps.
+
<code>./gx_mipi_i2c.sh -w metime [us] -b your_i2c_bus_number</code>
  
===== osdmode =====
+
Range (0,1000000/fps].Because of <u>Note1</u> and range limitation, please read back to confirm the real metime take effect.
<code>./mv_mipi_i2c_new.sh -r osdmode -b your_i2c_bus_number</code>
 
  
OSD mode bit definition:
+
Unit: microseconds.
  
0: Disabled
+
=====aemaxtime=====
 +
<code>./gx_mipi_i2c.sh -r aemaxtime -b your_i2c_bus_number</code>
  
1: Crosshair enabled, overlays a crosshair at the center of the image for assisting with coordinate calibration.
+
<code>./gx_mipi_i2c.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number</code>
  
==== ISP ====
+
Automatic maximum exposure time range: 16 to 1,000,000/fps (unit: microseconds)
  
===== Special Note =====
+
=====exptime=====
Generally, only manual exposure and manual gain are supported by RAW series cameras in this section. However, RAW-MIPI-AR0234M does support AEC control.
+
<code>./gx_mipi_i2c.sh -r exptime -b your_i2c_bus_number</code>
  
Commands supported by RAW-MIPI-AR0234M include:
+
Get the current exposure time. This command is valid in any exposure mode.
  
expmode,metime,gainmode,mgain,aatarget,aemaxtime,exptime,curgain,aaroi,aaroienable.
+
Unit: microseconds.
  
===== gamma =====
+
=====curgain=====
<code>./mv_mipi_i2c_new.sh -r gamma -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r curgain -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w gamma  [gamma] -b your_i2c_bus_number</code>
+
Gets the current gain. This command is valid in any exposure mode.
  
Range (0,4.0],accurate is 0.01.
+
=====mgain=====
 +
<code>./gx_mipi_i2c.sh -r mgain -b your_i2c_bus_number</code>
  
For now, gamma only works on 8bit depth image.
+
<code>./gx_mipi_i2c.sh -w mgain [gain] -b your_i2c_bus_number</code>
  
===== gammaenable =====
+
The manual gain value, range and step size vary by model.
<code>./mv_mipi_i2c_new.sh -r gammaenable -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w gammaenable  [0,1] -b your_i2c_bus_number</code>
+
=====aemaxgain=====
 +
<code>./gx_mipi_i2c.sh -r aemaxgain -b your_i2c_bus_number</code>
  
Enable/Disable gamma function.
+
<code>./gx_mipi_i2c.sh -w aemaxgain  [0,maxgain] -b your_i2c_bus_number</code>
  
===== dpcenable =====
+
Maximum value of auto gain. The range and step vary according to the model.
<code>./mv_mipi_i2c_new.sh -r dpcenable -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w dpcenable  [0,1] -b your_i2c_bus_number</code>
+
Most sensors have a gain step of 0.1dB, some are 0.3dB.
 
 
Enable/Disable DPC(Defect Point Correction) function.
 
 
 
===== lutenable =====
 
<code>./mv_mipi_i2c_new.sh -r lutenable -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w lutenable  [0,1] -b your_i2c_bus_number</code>
+
=====wbmode=====
 +
<code>./gx_mipi_i2c.sh -r wbmode -b your_i2c_bus_number</code>
  
Enable/Disable LUT(Look-Up-Table) function.
+
<code>./gx_mipi_i2c.sh -w wbmode [0/2] -b your_i2c_bus_number</code>
  
===== lut =====
+
wbmode type
<code>./mv_mipi_i2c_new.sh -r lut  [lutfilename] -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -w lut  [lutfilename] -b your_i2c_bus_number</code>
 
 
 
Import or export a lut curve to a file, refer to the provided lut_linear.txt for the file format.
 
 
 
===== expmode =====
 
<code>./mv_mipi_i2c_new.sh -r expmode -b your_i2c_bus_number</code>
 
 
 
<code>./mv_mipi_i2c_new.sh -w expmode  [0,2] -b your_i2c_bus_number</code>
 
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 696: Line 676:
 
|-
 
|-
 
|0
 
|0
|ME: manual exposure
+
|manual white balance
|-
 
|1
 
|AE once: auto exposure once
 
 
|-
 
|-
 
|2
 
|2
|AE: auto exposure continuous
+
|auto white balance
 
|}
 
|}
Both ME and AE are easy to understand.
 
  
AE once: Execute automatic exposure in the set range once, then stop the adjustment.
+
=====awbcolortempmin=====
 +
<code>./gx_mipi_i2c.sh -r awbcolortempmin -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -w awbcolortempmin [1000,15000] -b your_i2c_bus_number</code>
 +
 
 +
White balance minimum color temperature (K),Range[1000,15000].
 +
 
 +
=====awbcolortempmax=====
 +
<code>./gx_mipi_i2c.sh -r awbcolortempmax -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -w awbcolortempmax [1000,15000] -b your_i2c_bus_number</code>
 +
 
 +
White balance maximum color temperature (K),Range[1000,15000].
 +
 
 +
=====mwbbgain=====
 +
<code>./gx_mipi_i2c.sh -r mwbbgain -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -w mwbbgain [0,4095] -b your_i2c_bus_number</code>
 +
 
 +
Manual white balance B gain [0,4095]
 +
 
 +
=====mwbrgain=====
 +
<code>./gx_mipi_i2c.sh -r mwbrgain -b your_i2c_bus_number</code>
 +
 
 +
<code>./gx_mipi_i2c.sh -w mwbrgain [0,4095] -b your_i2c_bus_number</code>
 +
 
 +
Manual white balance R gain [0,4095]
 +
 
 +
=====colortemp=====
 +
<code>./gx_mipi_i2c.sh -r colortemp -b your_i2c_bus_number</code>
 +
 
 +
Current color temperature (k)
 +
 
 +
=====currgain=====
 +
<code>./gx_mipi_i2c.sh -r currgain -b your_i2c_bus_number</code>
 +
 
 +
Current white balance R gain [0,4095]
 +
 
 +
=====curbgain=====
 +
<code>./gx_mipi_i2c.sh -r curbgain -b your_i2c_bus_number</code>
 +
 
 +
Current white balance B gain [0,4095]
 +
 
 +
=====aemintime=====
 +
<code>./gx_mipi_i2c.sh -r aemintime -b your_i2c_bus_number</code>
  
RAW-MIPI-AR0234M do not support AE once mode.
+
<code>./gx_mipi_i2c.sh -w aemintime [16,1000000/fps] -b your_i2c_bus_number</code>
  
===== metime =====
+
Automatic minimum exposure time range: 16 to 1,000,000/fps (unit: microseconds)
<code>./mv_mipi_i2c_new.sh -w metime  [us] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r metime -b your_i2c_bus_number</code>
+
=====gamma_index=====
 +
<code>./gx_mipi_i2c.sh -r gamma_index -b your_i2c_bus_number</code>
  
Range (0,1000000/fps].Because of <u>Note1</u> and range limitation, please read back to confirm the real metime take effect.
+
<code>./gx_mipi_i2c.sh -w gamma_index [0,12] -b your_i2c_bus_number</code>
  
Unit: microseconds.
+
The GX series has preset gamma options, with different values representing different gamma settings:
  
===== gainmode =====
+
0: Gamma off, that is, linear format.
<code>./mv_mipi_i2c_new.sh -r gainmode -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w gainmode  [0,3] -b your_i2c_bus_number</code>
+
1: Default gamma.
{| class="wikitable"
 
!value
 
!description
 
|-
 
|0
 
|MG: manual gain
 
|-
 
|1
 
|AG once: auto gain once
 
|-
 
|2
 
|AG: auto gain continuous
 
|}
 
Both MG and AG are easy to understand.
 
  
AG once: Execute automatic gain in the set range once, then stop the adjustment.
+
2: gamma_1.6
  
RAW-MIPI-AR0234M do not support AG once mode.
+
3: gamma_1.8
  
RAW-MIPI-AR0234M can not enable AG in ME mode.
+
4: gamma_2.0
  
===== mgain =====
+
5: gamma_2.2
<code>./mv_mipi_i2c_new.sh -w mgain  [gain] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r mgain -b your_i2c_bus_number</code>
+
6: Style 1
  
Range [0,MAX_Gain],MAX_Gain varies from sensor to sensor, for example, IMX178 is 48dB.
+
7: Style 2
  
Read back to confirm the real mgain take effect.
+
8: Style 3
  
===== aatarget =====
+
9: Style 4
<code>./mv_mipi_i2c_new.sh -r aatarget -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w aatarget  [1,255] -b your_i2c_bus_number</code>
+
10: Style 5
  
The target brightness of AE and AG algorithm.
+
11: Style 6
  
Within the set range, the algorithm will prioritize the increase in exposure time,
+
12: User-defined gamma (TODO)
  
and increase the gain if the exposure time reaches the maximum and still cannot reach the set target brightness value.
+
=====antiflicker=====
 +
<code>./gx_mipi_i2c.sh -r antiflicker -b your_i2c_bus_number</code>
  
===== aemaxtime =====
+
<code>./gx_mipi_i2c.sh -w antiflicker [0/1] [50/60/100/120/200/240] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -r aemaxtime -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w aemaxtime  [16,1000000/fps] -b your_i2c_bus_number</code>
+
param1:Whether the antiflicker function is enabled [0/1]
  
Maximum exposure time in AE mode.Range[16,1000000]. <u>Note1.</u>
+
param2:
  
Please read back to confirm the real aemaxtime take effect.
+
Anti-flicker frequency.  
  
Unit: microseconds.
+
Options: 50, 60, 100, 120, 200, 240.  
  
===== agmaxgain =====
+
Once set, the camera's exposure time will be an integer multiple of (1s/(freq*2)) to avoid banding.  
<code>./mv_mipi_i2c_new.sh -r agmaxgain -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w agmaxgain  [0,maxgain] -b your_i2c_bus_number</code>
+
For stronger lighting, it is recommended to use a higher value to prevent overexposure.
  
Maximum value of auto gain. The range and step vary according to the model.
+
=====wdrparam=====
 +
<code>./gx_mipi_i2c.sh -r wdrparam -b your_i2c_bus_number</code>
  
Most sensors have a gain step of 0.1dB, some are 0.3dB.
+
<code>./gx_mipi_i2c.sh -w wdrparam [0/1] [0,255] -b your_i2c_bus_number</code>
  
Note:For RAW-MIPI-AR0234M, agmaxgain cannot be configured and remains fixed at 24dB.
+
param1:Whether the WDR function is enabled [0/1]
  
===== exptime =====
+
param2:WDR intensity [0-255]
<code>./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number</code>
 
  
Get the current exposure time. This command is valid in any exposure mode.
+
=====sharppen=====
 +
<code>./gx_mipi_i2c.sh -r sharppen -b your_i2c_bus_number</code>
  
Unit: microseconds.
+
<code>./gx_mipi_i2c.sh -w sharppen [0,255] -b your_i2c_bus_number</code>
  
===== curgain =====
+
Sharpening intensity [0-255]
<code>./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number</code>
 
  
Gets the current gain. This command is valid in any exposure mode.
+
=====denoise2d=====
 +
<code>./gx_mipi_i2c.sh -r denoise2d -b your_i2c_bus_number</code>
  
===== aaroienable =====
+
<code>./gx_mipi_i2c.sh -w denoise2d [0,255] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w aaroienable  [0,1] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r aaroienable -b your_i2c_bus_number</code>
+
2D noise reduction intensity [0-255]
  
Whether to enable AAROI statistics function, not enable means full ROI statistics.
+
=====denoise3d=====
 +
<code>./gx_mipi_i2c.sh -r denoise3d -b your_i2c_bus_number</code>
  
===== aaroi =====
+
<code>./gx_mipi_i2c.sh -w denoise3d [0,255] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w aaroi  [x]  [y]  [width]  [height] -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -r aaroi -b your_i2c_bus_number</code>
+
3D noise reduction intensity [0-255]
  
The AAROI coordinates are relative coordinates within the ROI area. So the area must be smaller than the image ROI.
+
=====saturation=====
 +
<code>./gx_mipi_i2c.sh -r saturation -b your_i2c_bus_number</code>
  
===== exptime_range =====
+
<code>./gx_mipi_i2c.sh -w saturation [0,100] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -r exptime_range -b your_i2c_bus_number</code>
 
  
Maximum and minimum exposure time in the current mode.
+
Saturation [0-100]
  
Unit: microseconds.
+
=====contrast=====
 +
<code>./gx_mipi_i2c.sh -r contrast -b your_i2c_bus_number</code>
  
===== aeag_run_once_save =====
+
<code>./gx_mipi_i2c.sh -w contrast [0,100] -b your_i2c_bus_number</code>
<code>./mv_mipi_i2c_new.sh -w aeag_run_once_save -b your_i2c_bus_number</code>
 
  
Execute AE&AG once operation and save the results to the camera as manual values!<br />This is a function that is useful when the camera is installed.
+
contrast [0-100]
  
Please make sure that the image preview has already been started before executing this command.
+
=====hue=====
 +
<code>./gx_mipi_i2c.sh -r hue -b your_i2c_bus_number</code>
  
It performs the following operations:
+
<code>./gx_mipi_i2c.sh -w hue [0-100] -b your_i2c_bus_number</code>
  
# Set AE and AG range to MAX.
+
hue [0-100]
# Run AE once and AG once.
 
# Wait 5 seconds.
 
# Check AE once and AG once result.
 
# Save the previous result to manual mode.
 
#Run paramsave,save to flash.
 
  
===== snsreg =====
+
=====slowshutter=====
<code>./mv_mipi_i2c_new.sh -r snsreg  [sensor reg addr] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r slowshutter -b your_i2c_bus_number</code>
  
Read the sensor's register indirectly via the camera controller unit.
+
<code>./gx_mipi_i2c.sh -w slowshutter [0/1] [20] -b your_i2c_bus_number</code>
  
==== Notes ====
+
Parameter 1: Selects '''automatic frame rate reduction mode''' (1) or '''fixed frame rate mode''' (0).
Note1: All parameters of exposure time are in microseconds. However, due to the properties of the sensor, the actual exposure time unit of the sensor is 1 line, can not be accurate to 1us.
 
  
Note2: AE: Auto exposure; AG: Auto Gain; AA: AE and AG.
+
Parameter 2: Sets the gain threshold at which frame rate reduction starts in automatic frame rate reduction mode. The unit is 0.1 dB.
  
Note3: The AAROI coordinates are relative coordinates within the ROI area.
+
Note: Automatic frame rate reduction mode is only effective in '''auto-exposure mode + video streaming mode'''. When using this function, it must be used together with the maximum exposure time setting (<code>aemaxtime</code>).
  
Note4: For RAW Series, there are some functions that are not supported, please refer to the register list for details.
+
In automatic frame rate reduction mode, during auto-exposure adjustment the system prioritizes increasing the exposure time to minimize gain as much as possible. When the sensor gain reaches the user-defined maximum value (Parameter 2), the auto-exposure algorithm will gradually reduce the frame rate and further extend the exposure time, until the exposure time reaches the auto-exposure maximum (<code>aemaxtime</code>).
  
<br />
+
In low-light environments, this results in lower noise, but the frame rate will be reduced.
  
=== Configuration Method for Typical Application Scenarios: ===
+
=====ldc=====
 +
<code>./gx_mipi_i2c.sh -r ldc -b your_i2c_bus_number</code>
  
==== Manual Exposure Mode: ====
+
<code>./gx_mipi_i2c.sh -w ldc [0,255] -b your_i2c_bus_number</code>
 <code>./mv_mipi_i2c_new.sh -w expmode  0 -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w gainmode  0 -b your_i2c_bus_number</code>
+
Lens Distortion Correction [0-255], abbreviated as LDC, with 0 indicating disable.
  
<code>./mv_mipi_i2c_new.sh -w metime  exptime_you_want_to_set_us -b your_i2c_bus_number</code>
+
Note: The parameters of this function setting must be set before the camera captures images to be effective.
  
<code>./mv_mipi_i2c_new.sh -w mgain  gain_you_want_to_set_dB -b your_i2c_bus_number</code>
+
=====dehaze=====
 +
<code>./gx_mipi_i2c.sh -r dehaze -b your_i2c_bus_number</code>
  
 After configuration, read the parameters with the following commands to confirm they have taken effect:
+
<code>./gx_mipi_i2c.sh -w dehaze [0,255] -b your_i2c_bus_number</code>
  
 <code>./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number</code>
+
Defogging intensity [0-255], 0 indicates off.
  
<code>./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number</code>
+
=====drc=====
 +
<code>./gx_mipi_i2c.sh -r drc -b your_i2c_bus_number</code>
  
  '''Note:''' The maximum exposure time must be strictly less than the reciprocal of the '''fps'''.
+
<code>./gx_mipi_i2c.sh -w drc [0,255] -b your_i2c_bus_number</code>
  
==== Continuous Auto Exposure Mode: ====
+
Digital wide dynamic range. Range [0-255], 0 indicates off.
<code>./mv_mipi_i2c_new.sh -w expmode  2 -b your_i2c_bus_number</code>
 
  
<code>./mv_mipi_i2c_new.sh -w gainmode  2 -b your_i2c_bus_number</code>
+
====IO Control====
  
<code>./mv_mipi_i2c_new.sh -w aatarget  brightness_target -b your_i2c_bus_number</code>
+
=====trgdelay=====
 +
<code>./gx_mipi_i2c.sh -r trgdelay -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgdelay [0,1000000] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w agmaxgain  [0,maxgain] -b your_i2c_bus_number</code>
+
Trigger delay, effective under both soft trigger and hard trigger mode.
  
  After continuous imaging for a while, you can read the current actual exposure time and gain using the following commands:
+
range: 0 to 1000000 (unit: microsecond)
  
<code>./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number</code>
+
=====trgedge=====
 +
<code>./gx_mipi_i2c.sh -r trgedge -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgedge  [0,1] -b your_i2c_bus_number</code>
  
==== Normal Trigger Mode: ====
+
Effective trigger edge in hard trigger mode.
   First, stop the image acquisition to enter a state where the trigger mode can be modified:
+
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0
 +
|Rising edge
 +
|-
 +
|1
 +
|Falling edge
 +
|}
  
   <code>./mv_mipi_i2c_new.sh -w imgacq  0 -b your_i2c_bus_number</code>
+
=====trgexp_delay=====
 +
<code>./gx_mipi_i2c.sh -r trgexp_delay -b your_i2c_bus_number</code>
  
   In the following example, configure the camera for normal hardware trigger mode, where each trigger signal captures 1 image:
+
<code>./gx_mipi_i2c.sh -w trgexp_delay  [0,100000] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w trgmode  1 -b your_i2c_bus_number</code>
+
Exposure delay, i.e. the time to turn on the Strobe signal in advance.
  
<code>./mv_mipi_i2c_new.sh -w trgsrc  1 -b your_i2c_bus_number</code>
+
range: 0 to 1000000 (unit: microsecond)
  
<code>./mv_mipi_i2c_new.sh -w trgnum  1 -b your_i2c_bus_number</code>
+
The difference between trgexp_delay and trgdelay, see manual for details.
  
   You may optionally execute the following two commands to set the trigger edge and delay:
+
=====outio1_rvs=====
 +
<code>./gx_mipi_i2c.sh -r outio1_rvs -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w trgedge [0,1] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w outio1_rvs [0,1] -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w trgdelay  [us] -b your_i2c_bus_number</code>
+
Reverse OUT_IO1 high and low levels if set to 1.
  
   After configuration, you can start the image acquisition to accept trigger signals:
+
===Notes===
 +
Note1: All parameters of exposure time are in microseconds. However, due to the properties of the sensor, the actual exposure time unit of the sensor is 1 line, can not be accurate to 1us.
  
 <code>./mv_mipi_i2c_new.sh -w imgacq  1 -b your_i2c_bus_number</code>
+
===Configuration Method for Typical Application Scenarios:===
  
==== Long Exposure Mode ====
+
====Stream mode:====
Some models support long exposure times, such as the MV-MIPI-IMX178M, which supports exposure times up to 100 seconds. The usage is as follows:
+
 <code>./gx_mipi_i2c.sh -w imgacq  1 -b your_i2c_bus_number</code>
  
1. Stop image acquisition.
+
====Trigger mode:====
 +
<code>./gx_mipi_i2c.sh -w imgacq 0 -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w imgacq 0 -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w workmode 1 -b your_i2c_bus_number</code>
  
2. Set exposure and gain to manual mode:
+
<code>./gx_mipi_i2c.sh -w trgsrc 0 -b your_i2c_bus_number</code>
  
 <code>./mv_mipi_i2c_new.sh -w expmode 0 -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trgnum 1 -b your_i2c_bus_number</code>
  
<code>./mv_mipi_i2c_new.sh -w gainmode 0 -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w trginterval 0 -b your_i2c_bus_number</code>
  
3. Read the minimum frame rate:
+
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
  
   <code>./mv_mipi_i2c_new.sh -r minfps -b your_i2c_bus_number</code>
+
According to the above command, you can take a picture.
  
   r minfps @ current setting is 0.0100 fps
+
====Sync mode:====
 +
Note: The synchronous mode requires two cameras.
  
4. Set the current frame rate to 0.016:
+
<code>./gx_mipi_i2c.sh -w slavemode 0 -b your_i2c_bus_number</code>
  
   <code>./mv_mipi_i2c_new.sh -w fps_ex 0.016 -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w slavemode 1 -b your_i2c_bus_number</code>
  
   <code>./mv_mipi_i2c_new.sh -r fps_ex -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number</code>
  
5. Read the current exposure time range:
+
<code>./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number</code>
  
   <code>./mv_mipi_i2c_new.sh -r exptime_range-b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number</code>
  
6. Set the exposure time:
+
<code>./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number</code>
  
 <code>./mv_mipi_i2c_new.sh -w metime 10000000 -b your_i2c_bus_number</code>
+
./veye_raspipreview -cs 1 -p '0,0,1000,520' -t -1
  
<code>./mv_mipi_i2c_new.sh -r exptime-b your_i2c_bus_number</code>
+
./veye_raspipreview -cs 0 -p '600,0,1280,720' -t -1
  
 
After completing the above configuration, you can proceed to start capturing images.
 
After completing the above configuration, you can proceed to start capturing images.

Latest revision as of 09:34, 4 January 2026

查看中文

gx_mipi_i2c.sh Shell scripts usage

1 Overview

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

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

2 Download

We provide download links for gx_mipi_i2c.sh for different embedded platforms.

Generally, these links can be found in the respective platform's GitHub repository.

Below is the list:

3 Prepare

cd gx_tools_rpi/sources/

./make.sh

cd ..

chmod +x *

4 gx_mipi_i2c.sh USAGE

$ ./gx_mipi_i2c.sh

Usage:  ./gx_mipi_i2c.sh [-r/w]  [function name] [param1] [param2 ] [param3] [param4] -b bus

options:

    -r                       read

    -w                       write

    [function name]       function name

    [param1]                        param1 of each function

    [param1]                        param2 of each function

    [param3]                        param3 of each function

    [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

5 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

6 Common Questions Regarding Scripts

1.When I2C communication fails, the following error message will be displayed.

./i2c_functions.sh: line 235: Read i2c err: syntax error in expression (error token is "i2c err")

2.When the script cannot find an executable binary file to execute, the following prompt will be shown.

❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vread

❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vwrite

7 Functions list

7.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.

7.2 Basic Parameters

7.2.1 manufacturer

./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number

Get the manufacturer name, which is VEYE.

7.2.2 model

./gx_mipi_i2c.sh -r model -b your_i2c_bus_number

Get the product model, such as GX-MIPI-IMX662.

7.2.3 sensorname

./gx_mipi_i2c.sh -r sensorname -b your_i2c_bus_number

Get the sensor model, such as IMX662-AAQR.

7.2.4 version

./gx_mipi_i2c.sh -r version -b your_i2c_bus_number

Get the Controller version number and Logical version number.

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

7.2.5 serialno

./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number

Get the unique serial number of this module.

7.2.6 timestamp

./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number

Get the time since the system started, in milliseconds.

7.2.7 errcode

reserved

7.2.8 fmtcap

./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number

Get the Module supports data formats

Capbility of data formats supported by the camera.

bit0: Mono8

bit1: Mono10

bit2: Mono12

bit3: Mono14 (reserved)

bit4: UYVY

bit5: RGB888

bit6: Temp (occupied,reserved)

bit7: YUYV

7.2.9 readmodecap

./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number

Get the Sensor reads out the capability set of patterns.

Capbility of read mode supported by the camera.

bit0: Normal

bit1: binning mode

bit2: subsampling mode

7.2.10 workmodecap

./gx_mipi_i2c.sh -r workmodecap -b your_i2c_bus_number

Get the Video streaming mode capability set

Capbility of trigger mode supported by the camera.

bit0: Video streaming mode

bit1: Normal trigger mode.

bit2: Rolling shutter multi-frame trigger mode.

bit3: Pulse trigger mode.

bit4: Multi-camera synchronization mode.

7.2.11 lanecap

./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number

Get the number of MIPI Lanes supported by the camera

The number of MIPI lanes supported by the camera .

The lower to higher bits correspond to the supported capabilities for 1 lane, 2 lanes, 3 lanes, and 4 lanes, respectively.

For example, 0x2 indicates support for 2 lanes, and 0xA indicates support for both 2 lanes and 4 lanes.

7.2.12 cameramodel0-cameramodel7

./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number

Get the camera model, such as: cameramodel0 is 0x47582d4d(ascii is GX-M)

7.2.13 temp

./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number

Get the temp is 25K

7.2.14 videomodecap

./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number

Get the videomodecap is 2

value description
bit0 ROI mode
bit1 VideoMode mode
7.2.15 videomodenum

./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number

Get the videomodenum 1

7.2.16 vidoemodewh1-vidoemodewh8

./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number

Get the videomodewh1 is 0x7800438 (1920*1080)

In the first mode, the width is represented by the high 16 bits and the height by the low 16 bits.

7.2.17 videomodeparam1-videomodeparam8

./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number

Get the videomodeparam1 is 0x1003c

The frame rate and reading method of the first mode. The high 8-bit standby, the middle 8-bit is for reading mode, and the low 16-bit is for the maximum frame rate.

value description
0 ordinary
1 binning
2 subsampling
7.2.18 factoryparam

./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number

All parameters restored to factory default values.

This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.

Additionally, it is recommended not to perform frequent factoryparam operations.

7.2.19 paramsave

./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number

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

This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.

Additionally, it is recommended not to perform frequent paramsave operations.

7.2.20 reboot

./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number

Reboot the camera.

7.3 Image Acquisition

7.3.1 imgacq

./gx_mipi_i2c.sh -w imgacq [0/1] -b your_i2c_bus_number

Start/Stop acquisition

There is no image output after the camera is powered on, which means it is in the standby state.

After writing 1 to this register, it enters the running state and starts outputting images or waiting for the trigger signal.

Writing 0 will stop the output image and enter the standby state.

7.3.2 workmode

./gx_mipi_i2c.sh -w workmode [0,1,4] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r workmode -b your_i2c_bus_number

value description
0 Video streaming mode
1 Normal trigger mode
4 Multi-camera synchronization mode

See product manual for details.

7.3.3 trgsrc

./gx_mipi_i2c.sh -w trgsrc [0,1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trgsrc -b your_i2c_bus_number

value description
0 Software trigger
1 Hardware trigger
7.3.4 trgnum

./gx_mipi_i2c.sh -w trgnum [1,255] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trgnum -b your_i2c_bus_number

The number of image frames output by one trigger signal in trigger mode.

7.3.5 trginterval

./gx_mipi_i2c.sh -w trginterval [us] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trginterval -b your_i2c_bus_number

Trigger interval in normal trigger mode, in microseconds. Range:[0.0xFFFFFF].

7.3.6 trgone

./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number

Software trigger command.One execution will perform a soft trigger.

7.3.7 trgcount

./gx_mipi_i2c.sh -r trgcount -b your_i2c_bus_number

Trigger count statistics.

Get the total number of triggers and the number of trigger loss.

./gx_mipi_i2c.sh -w trgcount [1] -b your_i2c_bus_number

Clear trigger count.

7.3.8 i2caddr

./gx_mipi_i2c.sh -w i2caddr [new] -b your_i2c_bus_number

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

Will really take effect only after paramsave and reboot .

7.3.9 nondiscontinuousmode

./gx_mipi_i2c.sh -w nondiscontinuousmode [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r nondiscontinuousmode -b your_i2c_bus_number

Indicates whether the clock lan of the mipi signal is in continuous clock mode.

0: discontinuous mode

1: continuous mode

7.3.10 slavemode

./gx_mipi_i2c.sh -w slavemode [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r slavemode -b your_i2c_bus_number

Whether the sensor is operating in slave mode. In slave mode, the camera relies on external signals to provide XVS and XHS.

Writing this parameter will cause the camera to automatically save the current settings and reboot.

7.3.11 framecount

./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number
Get the Sensor_Frame_Count is 434 , Out_Frame_Count is 436

Sensor_Frame_Count:

The number of frames collected from the sensor is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.

Out_Frame_Count:

The number of frames output is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.

7.3.12 triggercyclemin

./gx_mipi_i2c.sh -r triggercyclemin -b your_i2c_bus_number

Get the Trigger_Cycle_Min is 0

7.3.13 daynightmode

./gx_mipi_i2c.sh -w daynightmode [0,2] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r daynightmode -b your_i2c_bus_number

daynightmode type

value description
0 Color mode
1 Black and white mode
2 External trigger mode
7.3.14 ircutdir

./gx_mipi_i2c.sh -w ircutdir [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r ircutdir -b your_i2c_bus_number

By default, if the voltage at port A is higher than that at port B (A > B), the IRCUT module will drive the filter to enter the optical path. When the direction is switched so that the voltage at port B becomes higher than that at port A (A < B), the polarity of the electromagnetic coil reverses, and the filter is driven to exit the optical path.

7.3.15 pinpolarity

./gx_mipi_i2c.sh -w pinpolarity [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r pinpolarity -b your_i2c_bus_number

Trigger pin polarity reversal day and night. By default, a low level indicates night. After setting this value to 1, a high level indicates night.

7.3.16 ircuttimer

./gx_mipi_i2c.sh -w ircuttimer [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r ircuttimer -b your_i2c_bus_number

Whether to enable IRCUT periodic control; If enabled, IRCUT control will be performed according to the default cycle. If not enabled, control will only be carried out once during mode switching.

7.4 Image Properties

7.4.1 testimg

./gx_mipi_i2c.sh -w testimg [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r testimg -b your_i2c_bus_number

value description
0 Common image
1 Vertical color stripes
7.4.2 pixelformat

./gx_mipi_i2c.sh -w pixelformat [4/5/6/7] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r pixelformat -b your_i2c_bus_number

value description
0 Mono8
1 Mono10
2 Mono12
3 Mono14 (reserved)
4 UYVY
5 RGB888
6 Temp (reserved)
7 YUYV
7.4.3 maxwh

./gx_mipi_i2c.sh -r maxwh -b your_i2c_bus_number

Get the maximum width and height supported by the sensor

7.4.4 minwh

./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number

Get the minimum width and height supported by the camera.

7.4.5 maxfps

./gx_mipi_i2c.sh -r maxfps -b your_i2c_bus_number

The maximum frame rate supported in the current mode.

Depending on the configured ROI, the maximum frame rate will be different. This parameter supports decimals.

7.4.6 minfps

./gx_mipi_i2c.sh -r minfps -b your_i2c_bus_number

Read the minimum frame rate supported by the current module.

7.4.7 curwh

./gx_mipi_i2c.sh -r curwh -b your_i2c_bus_number

Get the current width and height

7.4.8 imgdir

./gx_mipi_i2c.sh -r imgdir -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgdir [0/1/2/3] -b your_i2c_bus_number

Image orientation:

value description
0 normal
1 mirror
2 flip
3 flip&mirror
7.4.9 videomode

./gx_mipi_i2c.sh -r videomode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w videomode [0-7] -b your_i2c_bus_number

For cameras that use the VideoMode mode to select the frame rate of width and height, which mode to choose, Range [0-7],The corresponding capability set is VideomodeCap.

7.4.10 readmode

./gx_mipi_i2c.sh -r readmode -b your_i2c_bus_number

image model:

value description
0 normal mode
1 2x2binning mode
2 subsampling mode
7.4.11 lanenum

./gx_mipi_i2c.shsh -r lanenum -b your_i2c_bus_number

Configuration of the number of LANs outputting MIPI signals

value description
2 2lane
4 4lane
7.4.12 mipidatarate

./gx_mipi_i2c.shh -r mipidatarate -b your_i2c_bus_number

The rate of each LAN in the MIPI system is measured in kbps.

7.4.13 fps

./gx_mipi_i2c.sh -r fps -b your_i2c_bus_number

./gx_mipi_i2c.sh -w fps -b [framerate] your_i2c_bus_number

Configure the actual frame rate of the camera in the current mode.

Range:(0,maxfps].

In video streaming mode, this parameter determines the actual frame rate.

In normal trigger mode, it is recommended to set the fps to the maxfps value to ensure the highest trigger signal responsiveness.

7.5 Image Processing

7.5.1 expmode

./gx_mipi_i2c.sh -r expmode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w expmode [0/2] -b your_i2c_bus_number

Exposure type

value description
0 manual exposure
2 auto exposure
7.5.2 aetarget

./gx_mipi_i2c.sh -r aetarget -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aetarget [0,255] -b your_i2c_bus_number

The target brightness of AE algorithm.

Within the set range, the algorithm will prioritize the increase in exposure time,

and increase the gain if the exposure time reaches the maximum and still cannot reach the set target brightness value.

7.5.3 aestrategy

./gx_mipi_i2c.sh -r aestrategy -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aestrategy [0/1] -b your_i2c_bus_number

Automatic exposure strategy

value description
0 Bright Area Priority mode (High Light priority
1 Dark zone priority mode (low light priority)
7.5.4 metime

./gx_mipi_i2c.sh -r metime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w metime [us] -b your_i2c_bus_number

Range (0,1000000/fps].Because of Note1 and range limitation, please read back to confirm the real metime take effect.

Unit: microseconds.

7.5.5 aemaxtime

./gx_mipi_i2c.sh -r aemaxtime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number

Automatic maximum exposure time range: 16 to 1,000,000/fps (unit: microseconds)

7.5.6 exptime

./gx_mipi_i2c.sh -r exptime -b your_i2c_bus_number

Get the current exposure time. This command is valid in any exposure mode.

Unit: microseconds.

7.5.7 curgain

./gx_mipi_i2c.sh -r curgain -b your_i2c_bus_number

Gets the current gain. This command is valid in any exposure mode.

7.5.8 mgain

./gx_mipi_i2c.sh -r mgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mgain [gain] -b your_i2c_bus_number

The manual gain value, range and step size vary by model.

7.5.9 aemaxgain

./gx_mipi_i2c.sh -r aemaxgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemaxgain [0,maxgain] -b your_i2c_bus_number

Maximum value of auto gain. The range and step vary according to the model.

Most sensors have a gain step of 0.1dB, some are 0.3dB.

7.5.10 wbmode

./gx_mipi_i2c.sh -r wbmode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w wbmode [0/2] -b your_i2c_bus_number

wbmode type

value description
0 manual white balance
2 auto white balance
7.5.11 awbcolortempmin

./gx_mipi_i2c.sh -r awbcolortempmin -b your_i2c_bus_number

./gx_mipi_i2c.sh -w awbcolortempmin [1000,15000] -b your_i2c_bus_number

White balance minimum color temperature (K),Range[1000,15000].

7.5.12 awbcolortempmax

./gx_mipi_i2c.sh -r awbcolortempmax -b your_i2c_bus_number

./gx_mipi_i2c.sh -w awbcolortempmax [1000,15000] -b your_i2c_bus_number

White balance maximum color temperature (K),Range[1000,15000].

7.5.13 mwbbgain

./gx_mipi_i2c.sh -r mwbbgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mwbbgain [0,4095] -b your_i2c_bus_number

Manual white balance B gain [0,4095]

7.5.14 mwbrgain

./gx_mipi_i2c.sh -r mwbrgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mwbrgain [0,4095] -b your_i2c_bus_number

Manual white balance R gain [0,4095]

7.5.15 colortemp

./gx_mipi_i2c.sh -r colortemp -b your_i2c_bus_number

Current color temperature (k)

7.5.16 currgain

./gx_mipi_i2c.sh -r currgain -b your_i2c_bus_number

Current white balance R gain [0,4095]

7.5.17 curbgain

./gx_mipi_i2c.sh -r curbgain -b your_i2c_bus_number

Current white balance B gain [0,4095]

7.5.18 aemintime

./gx_mipi_i2c.sh -r aemintime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemintime [16,1000000/fps] -b your_i2c_bus_number

Automatic minimum exposure time range: 16 to 1,000,000/fps (unit: microseconds)

7.5.19 gamma_index

./gx_mipi_i2c.sh -r gamma_index -b your_i2c_bus_number

./gx_mipi_i2c.sh -w gamma_index [0,12] -b your_i2c_bus_number

The GX series has preset gamma options, with different values representing different gamma settings:

0: Gamma off, that is, linear format.

1: Default gamma.

2: gamma_1.6

3: gamma_1.8

4: gamma_2.0

5: gamma_2.2

6: Style 1

7: Style 2

8: Style 3

9: Style 4

10: Style 5

11: Style 6

12: User-defined gamma (TODO)

7.5.20 antiflicker

./gx_mipi_i2c.sh -r antiflicker -b your_i2c_bus_number

./gx_mipi_i2c.sh -w antiflicker [0/1] [50/60/100/120/200/240] -b your_i2c_bus_number

param1:Whether the antiflicker function is enabled [0/1]

param2:

Anti-flicker frequency.  

Options: 50, 60, 100, 120, 200, 240.  

Once set, the camera's exposure time will be an integer multiple of (1s/(freq*2)) to avoid banding.  

For stronger lighting, it is recommended to use a higher value to prevent overexposure.

7.5.21 wdrparam

./gx_mipi_i2c.sh -r wdrparam -b your_i2c_bus_number

./gx_mipi_i2c.sh -w wdrparam [0/1] [0,255] -b your_i2c_bus_number

param1:Whether the WDR function is enabled [0/1]

param2:WDR intensity [0-255]

7.5.22 sharppen

./gx_mipi_i2c.sh -r sharppen -b your_i2c_bus_number

./gx_mipi_i2c.sh -w sharppen [0,255] -b your_i2c_bus_number

Sharpening intensity [0-255]

7.5.23 denoise2d

./gx_mipi_i2c.sh -r denoise2d -b your_i2c_bus_number

./gx_mipi_i2c.sh -w denoise2d [0,255] -b your_i2c_bus_number

2D noise reduction intensity [0-255]

7.5.24 denoise3d

./gx_mipi_i2c.sh -r denoise3d -b your_i2c_bus_number

./gx_mipi_i2c.sh -w denoise3d [0,255] -b your_i2c_bus_number

3D noise reduction intensity [0-255]

7.5.25 saturation

./gx_mipi_i2c.sh -r saturation -b your_i2c_bus_number

./gx_mipi_i2c.sh -w saturation [0,100] -b your_i2c_bus_number

Saturation [0-100]

7.5.26 contrast

./gx_mipi_i2c.sh -r contrast -b your_i2c_bus_number

./gx_mipi_i2c.sh -w contrast [0,100] -b your_i2c_bus_number

contrast [0-100]

7.5.27 hue

./gx_mipi_i2c.sh -r hue -b your_i2c_bus_number

./gx_mipi_i2c.sh -w hue [0-100] -b your_i2c_bus_number

hue [0-100]

7.5.28 slowshutter

./gx_mipi_i2c.sh -r slowshutter -b your_i2c_bus_number

./gx_mipi_i2c.sh -w slowshutter [0/1] [20] -b your_i2c_bus_number

Parameter 1: Selects automatic frame rate reduction mode (1) or fixed frame rate mode (0).

Parameter 2: Sets the gain threshold at which frame rate reduction starts in automatic frame rate reduction mode. The unit is 0.1 dB.

Note: Automatic frame rate reduction mode is only effective in auto-exposure mode + video streaming mode. When using this function, it must be used together with the maximum exposure time setting (aemaxtime).

In automatic frame rate reduction mode, during auto-exposure adjustment the system prioritizes increasing the exposure time to minimize gain as much as possible. When the sensor gain reaches the user-defined maximum value (Parameter 2), the auto-exposure algorithm will gradually reduce the frame rate and further extend the exposure time, until the exposure time reaches the auto-exposure maximum (aemaxtime).

In low-light environments, this results in lower noise, but the frame rate will be reduced.

7.5.29 ldc

./gx_mipi_i2c.sh -r ldc -b your_i2c_bus_number

./gx_mipi_i2c.sh -w ldc [0,255] -b your_i2c_bus_number

Lens Distortion Correction [0-255], abbreviated as LDC, with 0 indicating disable.

Note: The parameters of this function setting must be set before the camera captures images to be effective.

7.5.30 dehaze

./gx_mipi_i2c.sh -r dehaze -b your_i2c_bus_number

./gx_mipi_i2c.sh -w dehaze [0,255] -b your_i2c_bus_number

Defogging intensity [0-255], 0 indicates off.

7.5.31 drc

./gx_mipi_i2c.sh -r drc -b your_i2c_bus_number

./gx_mipi_i2c.sh -w drc [0,255] -b your_i2c_bus_number

Digital wide dynamic range. Range [0-255], 0 indicates off.

7.6 IO Control

7.6.1 trgdelay

./gx_mipi_i2c.sh -r trgdelay -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgdelay [0,1000000] -b your_i2c_bus_number

Trigger delay, effective under both soft trigger and hard trigger mode.

range: 0 to 1000000 (unit: microsecond)

7.6.2 trgedge

./gx_mipi_i2c.sh -r trgedge -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgedge [0,1] -b your_i2c_bus_number

Effective trigger edge in hard trigger mode.

value description
0 Rising edge
1 Falling edge
7.6.3 trgexp_delay

./gx_mipi_i2c.sh -r trgexp_delay -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgexp_delay [0,100000] -b your_i2c_bus_number

Exposure delay, i.e. the time to turn on the Strobe signal in advance.

range: 0 to 1000000 (unit: microsecond)

The difference between trgexp_delay and trgdelay, see manual for details.

7.6.4 outio1_rvs

./gx_mipi_i2c.sh -r outio1_rvs -b your_i2c_bus_number

./gx_mipi_i2c.sh -w outio1_rvs [0,1] -b your_i2c_bus_number

Reverse OUT_IO1 high and low levels if set to 1.

8 Notes

Note1: All parameters of exposure time are in microseconds. However, due to the properties of the sensor, the actual exposure time unit of the sensor is 1 line, can not be accurate to 1us.

9 Configuration Method for Typical Application Scenarios:

9.1 Stream mode:

 ./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

9.2 Trigger mode:

./gx_mipi_i2c.sh -w imgacq 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgsrc 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgnum 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trginterval 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number

According to the above command, you can take a picture.

9.3 Sync mode:

Note: The synchronous mode requires two cameras.

./gx_mipi_i2c.sh -w slavemode 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w slavemode 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

./veye_raspipreview -cs 1 -p '0,0,1000,520' -t -1

./veye_raspipreview -cs 0 -p '600,0,1280,720' -t -1

After completing the above configuration, you can proceed to start capturing images.

Please note that if you need to adjust the frame rate during the image acquisition process, you must first stop the acquisition before making the changes.  

After stopping the acquisition, the camera will still complete the capture of the current frame.

The newly set parameters will only take effect afterward.