Allied Vision CSI V4L2 I2C Subdevice Driver Features

Allied Vision CSI V4L2 Subdevice Driver v1.3

Contents

V4L2 controls

The standard controls only support 32-bit integer values. Therefore, most controls use the extended v4l2 control interface.

Standard controls

The Subdevice driver provides the following standard compliant controls:

Additionally, it exposes the following standard V4L2 controls as 64-bit controls:

These controls are only accessible through the extended controls API.

Custom controls

The base address of the custom controls in the Subdevice driver is V4L2_CID_CAMERA_CLASS_BASE+40. All Allied Vision custom v4l2 controls use the prefix AVT instead of V4L2.

The following custom controls are available in the Subdevice driver:

Mapping table: V4L2 controls <-> BCRM registers

V4L2 Control Value Register Minimum Register Maximum Register Increment Register Comment
V4L2_CID_AUTOGAIN Gain Auto (0x1E8) N/A N/A N/A Optional, feature inquiry bit 12.
V4L2_CID_AUTO_WHITE_BALANCE White Balance Auto (0x2E0) N/A N/A N/A Optional, feature inquiry bit 13.
Value Mapping:
False <-> Off (0)
True <-> Continuous (2)
V4L2_CID_DO_WHITE_BALANCE White Balance Auto (0x2E0) N/A N/A N/A Optional, feature inquiry bit 13.
Value Mapping:
Triggered <-> Once (1)
V4L2_CID_EXPOSURE_ABSOLUTE Exposure Time (0x180) Exposure Time Min Value (0x188) Exposure Time Max Value (0x190) Fixed to 1 Control value in 100 us units, converted to register unit (ns).
A fixed increment of 1 is used, because the exposure time increment is variable.
Flags:
Volatile
V4L2_CID_EXPOSURE_AUTO Exposure Auto (0x1A0) N/A N/A N/A Optional, feature inquiry bit 11.
Value Mapping:
V4L2_EXPOSURE_AUTO <-> Continuous (2)
V4L2_EXPOSURE_MANUAL <-> Off (0)
V4L2_CID_BRIGHTNESS Black Level (0x1B8) Black Level Min Value (0x1BC) Black Level Max Value (0x1C0) Black Level Increment (0x1C4) Optional, feature inquiry bit 3.
Disabled during streaming.
V4L2_CID_SATURATION Saturation (0x240) Saturation Min Value (0x244) Saturation Max Value (0x248) Saturation Increment (0x24C) Optional, feature inquiry bit 7.
V4L2_CID_CONTRAST Contrast Value (0x214) Contrast Value Min Value (0x218) Contrast Value Max Value (0x21C) Contrast Value Increment (0x220) Optional, feature inquiry bit 6.
V4L2_CID_HUE Hue (0x250) Hue Min Value (0x254) Hue Max Value (0x258) Hue Increment (0x25C) Optional, feature inquiry bit 8.
V4L2_CID_RED_BALANCE Red Balance Ratio (0x280) Red Balance Ratio Min Value (0x288) Red Balance Ratio Max Value (0x290) Red Balance Increment (0x298) Optional, feature inquiry bit 9.
Only available for color cameras.
Flags:
Volatile
V4L2_CID_BLUE_BALANCE Blue Balance Ratio (0x2C0) Blue Balance Ratio Min Value (0x2C8) Blue Balance Ratio Max Value (0x2D0) Blue Balance Increment (0x2D8) Optional, feature inquiry bit 9.
Only available for color cameras.
Flags:
Volatile
V4L2_CID_GAMMA Gamma (0x1F0) Gamma Min Value (0x1F8) Gamma Max Value (0x200) Gamma Increment (0x208) Optional, feature inquiry bit 5.
V4L2_CID_EXPOSURE Exposure Time (0x180) Exposure Time Min Value (0x188) Exposure Time Max Value (0x190) Fixed to 1 A fixed increment of 1 is used, because the exposure time increment is variable.
Disabled if V4L2_CID_EXPOSURE_AUTO is set to V4L2_EXPOSURE_AUTO.
Flags:
Volatile
V4L2_CID_GAIN Gain (0x1C8) Gain Min Value (0x1D0) Gain Max Value (0x1D8) Gain Increment (0x1E0) Optional, feature inquiry bit 4.
Disabled if V4L2_CID_AUTOGAIN is set to true.
Flags:
Volatile
V4L2_CID_HFLIP Reverse X (0x158) N/A N/A N/A Optional, feature inquiry bit 0.
V4L2_CID_VFLIP Reverse Y (0x15C) N/A N/A N/A Optional, feature inquiry bit 1.
AVT_CID_EXPOSURE_AUTO_MIN Exposure Auto Min (0x330) Exposure Time Min Value (0x188) Exposure Auto Max (0x338) Fixed 1. Optional, feature inquiry bit 11.
A fixed increment of 1 is used, because the exposure time increment is variable.
AVT_CID_EXPOSURE_AUTO_MAX Exposure Auto Max (0x338) Exposure Auto Min (0x330) Exposure Time Max Value (0x190) Fixed 1. Optional, feature inquiry bit 11.
A fixed increment of 1 is used, because the exposure time increment is variable.
AVT_CID_GAIN_AUTO_MIN Gain Auto Min (0x340) Gain Min Value (0x1D0) Gain Auto Max (0x348) Gain Increment (0x1E0) Optional, feature inquiry bit 12.
AVT_CID_GAIN_AUTO_MAX Gain Auto Max (0x348) Gain Auto Min (0x338) Gain Max Value (0x1D8) Gain Increment (0x1E0) Optional, feature inquiry bit 12.
AVT_CID_EXPOSURE_ACTIVE_LINE_MODE Exposure Active Line Mode (0x0C4) N/A N/A N/A Optional, feature inquiry bit 18.
AVT_CID_EXPOSURE_ACTIVE_LINE_SELECTOR Exposure Active Output Line (0x0CC) N/A N/A N/A Optional, feature inquiry bit 18.
AVT_CID_EXPOSURE_ACTIVE_INVERT Line Configuration (0x0D0) N/A N/A N/A Optional, feature inquiry bit 18.
Set the inverted/not inverted bit for the line selected by the “exposure active line selector” control.
AVT_CID_TRIGGER_MODE Frame Start Trigger Mode (0x0B4) N/A N/A N/A Optional, feature inquiry bit 17.
Disabled during streaming.
AVT_CID_TRIGGER_ACTIVATION Frame Start Trigger Activation (0x0BC) N/A N/A N/A Optional, feature inquiry bit 17.
Disabled during streaming.
Disable when trigger mode is true.
AVT_CID_TRIGGER_SOURCE Frame Start Trigger Source (0x0B8) N/A N/A N/A Optional, feature inquiry bit 17.
Disabled during streaming.
Disable when trigger mode is true.
AVT_CID_TRIGGER_SOFTWARE Frame Start Trigger Software (0x0C0) N/A N/A N/A Optional, feature inquiry bit 17.
Writes 1 to the register on execute.
Only enable when trigger mode is true, trigger source is software and acquisition is started
AVT_CID_DEVICE_TEMPERATURE Device Temperature (0x310) N/A N/A N/A Optional, feature inquiry bit 14.
Flags:
Volatile
Read only
AVT_CID_BINNING_MODE Binning Mode (0x178) N/A N/A N/A Disabled during streaming.
AVT_CID_BINNING_SETTING Binning Setting (0x174) N/A N/A N/A Register value mapped to corresponding v4l2 area.
Flags:
Volatile
Read only
AVT_CID_FIRMWARE_VERSION Device Firmware Version (0x010) N/A N/A N/A Flags:
Read only
AVT_CID_ACQUISITION_STATUS Acquisition Status (0x08C) N/A N/A N/A Flags:
Volatile
Read only
AVT_CID_BINNING_SELECTOR Binning Setting (0x174) N/A N/A N/A Disabled during streaming.
Depending on the value either the Digital or Sensor binning settings can be used.
AVT_CID_INTENSITY_AUTO_PRECEDENCE Intensity Auto Precedence (0x1A4) N/A N/A N/A Optional, feature inquiry bit 2.
AVT_CID_INTENSITY_AUTO_PRECEDENCE_TARGET Intensity Auto Precedence Target Value (0x1A8) Intensity Auto Precedence Min Target Value (0x1AC) Intensity Auto Precedence Max Target Value (0x1B0) Intensity Auto Precedence Increment Target Value (0x1B4) Optional, feature inquiry bit 2.
AVT_CID_TEST_PATTERN Test Pattern Setting (0x3B4) N/A N/A N/A Available options defined by “Test Pattern Inquiry (0x3B0)”.
Minimum Firmware Version 14.
AVT_CID_COLOR_TRANSFORM_MATRIX_ENABLE Color Transform Matrix Enable (0x2E4) N/A N/A N/A Optional, feature inquiry bit 21.
AVT_CID_COLOR_TRANSFORMAT_MATRIX Color Transform Matrix Values (0x2E8 – 0x2F8) N/A N/A N/A Optional, feature inquiry bit 21.
AVT_CID_DEVICE_STATUS Device Status (0x0024) N/A N/A N/A Optional, feature inquiry bit 23.
AVT_CID_REVISION_ID Reserved (0x0028) N/A N/A N/A Optional, feature inquiry bit 24.
AVT_CID_USER_DATA_STORAGE User Data Index (0x001c)
User Data Value (0x0020)
N/A N/A N/A Optional, feature inquiry bit 22.
User data slots mapped to array control in driver.
AVT_CID_FRAME_TRIGGER_WAIT_LINE_MODE Frame Trigger Wait Line Mode (0x00DC) N/A N/A N/A Optional, feature inquiry bit 20.
AVT_CID_FRAME_TRIGGER_WAIT_LINE_SELECTOR Frame Trigger Wait Output Line (0x00D8) N/A N/A N/A Optional, feature inquiry bit 20.
AVT_CID_FRAME_TRIGGER_WAIT_INVERT Line Configuration (0x0D0) N/A N/A N/A Optional, feature inquiry bit 20.
Line invert activated based on line selected as frame trigger wait output.
Line configuration handling shared with trigger and exposure active output.
AVT_CID_AUTO_REGION_LEFT Auto Region Offset X (0x0370) Auto Region Offset X Min Value (0x0374) Auto Region Offset X Max Value (0x0378) Auto Region Offset X Increment (0x037C) Optional, feature inquiry bit 19.
AVT_CID_AUTO_REGION_TOP Auto Region Offset Y (0x0380) Auto Region Offset Y Min Value (0x0384) Auto Region Offset Y Max Value (0x0388) Auto Region Offset Y Increment (0x038C) Optional, feature inquiry bit 19.
AVT_CID_AUTO_REGION_WIDTH Auto Region Width (0x0350) Auto Region Width Min Value (0x0354) Auto Region Width Max Value (0x0358) Auto Region Width Increment (0x35C) Optional, feature inquiry bit 19.
AVT_CID_AUTO_REGION_HEIGHT Auto Region Height (0x0360) Auto Region Height Min Value (0x0364) Auto Region Height Max Value (0x0368) Auto Region Height Increment (0x036C) Optional, feature inquiry bit 19.
AVT_CID_SENSORBOARD_TEMPERATURE Sensorboard Temperature (0x0390) N/A N/A N/A Optional, feature inquiry bit 28.
AVT_CID_MAINBOARD_TEMPERATURE_WARNING_LEVEL Mainboard Temperature Warning Level (0x0394) N/A N/A N/A Optional, feature inquiry bit 29.
AVT_CID_DPC_ENABLE DPC Enable (0x00E4) N/A N/A N/A Optional, feature inquiry bit 31.
AVT_CID_EXPOSURE_GAIN Exposure Time & Gain combined (0x0224) N/A N/A N/A Optional, feature inquiry bit 30.
AVT_CID_POWER_SAVE_MODE Device Power Save Mode (0x0034) N/A N/A N/A Optional, feature inquiry bit 27.
AVT_CID_INTENSITY_CONROLLER_REGION Intensity Controller Region (0x022C) N/A N/A N/A Optional, feature inquiry bit 19.
AVT_CID_SENSORBOARD_TEMPERATURE_WARNING_LEVEL Sensorboard Temperature Warning Level (0x0398) N/A N/A N/A Optional, feature inquiry bit 32.

Mapping table: V4L2 controls <-> CCI registers

V4L2 Control Value Register Minimum Register Maximum Register Increment Register Comment
AVT_CID_CAMERA_NAME Model Name (0x098)
Family name (0x0D8)
- - - Value: “
Flags: Read only
AVT_CID_SERIAL_NUMBER Serial Number (0x198) - - - Flags: Read only

Configuration

CSI configuration

The configuration of the camera CSI2 interface (clock frequency and lane count) is read from the device tree during initialization and cannot be changed.

Using these standard properties ensures compatibility to mainline video drivers.

Setting pixel format / roi / binning

Pixel format

The pixel format can be read / changed using the get_/set_fmt v4l2 subdevice pad operations. With get_fmt v4l2 operation, it is also possible to read current width and height of the image.

ROI and binning