3. System Control

3.1. Function Overview

The system control part includes the configuration of ISP public properties, initialization of ISP firmware, running of ISP firmware, exiting of ISP firmware, setting of ISP modules and other functions.

3.2. API Reference

The interface in this document does not support multi process unless otherwise specified.

3.2.1. CVI_ISP_MemInit

【Description】

Initialize the ISP external register.

【Syntax】

CVI_S32 CVI_ISP_MemInit(VI_PIPE ViPipe);

【Parameter】

Parameter

Description

ViPipe

ViPipe number

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.2. CVI_ISP_Init

【Description】

Initialize ISP firmware.

【Syntax】

CVI_S32 CVI_ISP_Init(VI_PIPE ViPipe);

【Parameter】

Parameter

Description

ViPipe

ViPipe number

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.3. CVI_ISP_Run

【Description】

Run ISP firmware.

【Syntax】

CVI_S32 CVI_ISP_Run(VI_PIPE ViPipe);

【Parameter】

Parameter

Description

ViPipe

ViPipe number

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.4. CVI_ISP_RunOnce

【Description】

Run ISP firmware once.

【Syntax】

CVI_S32 CVI_ISP_RunOnce(VI_PIPE ViPipe);

【Parameter】

Parameter

Description

ViPipe

ViPipe number

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.5. CVI_ISP_Exit

【Description】

Exit ISP firmware.

【Syntax】

CVI_S32 CVI_ISP_RunOnce(VI_PIPE ViPipe);

【Parameter】

Parameter

Description

ViPipe

ViPipe number

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.6. CVI_ISP_SetPubAttr

【Description】

Set ISP public properties.

【Syntax】

CVI_S32 CVI_ISP_SetPubAttr(VI_PIPE ViPipe, const ISP_PUB_ATTR_S *pstPubAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstPubAttr

ISP public properties.

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.7. CVI_ISP_GetPubAttr

【Description】

Get ISP public properties.

【Syntax】

CVI_S32 CVI_ISP_GetPubAttr(VI_PIPE ViPipe, ISP_PUB_ATTR_S *pstPubAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstPubAttr

ISP public properties.

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.8. CVI_ISP_SetFMWState

【Description】

Set ISP firmware status.

【Syntax】

CVI_S32 CVI_ISP_SetFMWState(VI_PIPE ViPipe, const ISP_FMW_STATE_E enState);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

enState

ISP firmware state

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.9. CVI_ISP_GetFMWState

【Description】

Get ISP firmware status.

【Syntax】

CVI_S32 CVI_ISP_GetFMWState(VI_PIPE ViPipe, ISP_FMW_STATE_E *penState);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

enState

ISP firmware state

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.10. CVI_ISP_SetModuleControl

【Description】

Set control of ISP function module.

【Syntax】

CVI_S32 CVI_ISP_SetModuleControl(VI_PIPE ViPipe, const ISP_MODULE_CTRL_U *punModCtrl);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

punModCtrl

Control of ISP function module

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.11. CVI_ISP_GetModuleControl

【Description】

Get control of ISP function module.

【Syntax】

CVI_S32 CVI_ISP_GetModuleControl(VI_PIPE ViPipe, ISP_MODULE_CTRL_U *punModCtrl);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

punModCtrl

Control of ISP function module

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.12. CVI_ISP_GetVDTimeOut

【Description】

Get ISP interrupt information.

【Syntax】

CVI_S32 CVI_ISP_GetVDTimeOut(VI_PIPE ViPipe, ISP_VD_TYPE_E enIspVDType, CVI_U32 u32MilliSec);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

enIspVDType

Field synchronization signal

Input

u32MilliSec

Timeout time, in ms.

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

None.

3.2.13. CVI_ISP_SensorRegCallBack

【Description】

The callback interface of sensor registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_SensorRegCallBack(VI_PIPE ViPipe, ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo, ISP_SENSOR_REGISTER_S *pstRegister);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstSnsAttrInfo

Properties of sensor registered with ISP

Input

pstRegister

Sensor register structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

_images/System004.png

Fig. 3.1 Figure 2-1 Interface between ISP library and sensor Library

【Example】

None.

【Related Topic】

3.2.14. CVI_ISP_SensorUnRegCallBack

【Description】

The callback interface of sensor anti registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_SensorUnRegCallBack(VI_PIPE ViPipe, SENSOR_ID SensorId);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

SensorId

The ID of the sensor registered with the ISP.

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.15. CVI_ISP_AELibRegCallBack

【Description】

The callback interface of AE library registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_AELibRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ISP_AE_REGISTER_S *pstRegister);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstAeLib

AWB library structure pointer

Input

pstRegister

AWB library register structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

_images/image2.png

Fig. 3.2 Figure 2-2 Interface between ISP library and AE Library

【Example】

None.

【Related Topic】

3.2.16. CVI_ISP_AELibUnRegCallBack

【Description】

The callback interface of AE library anti registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_AELibUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstAeLib

AE library structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.17. CVI_ISP_AWBLibRegCallBack

【Description】

Callback interface for AWB library registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_AWBLibRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib, ISP_AWB_REGISTER_S *pstRegister);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstAwbLib

AWB library structure pointer

Input

pstRegister

AWB library register structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

_images/System005.png

Fig. 3.3 Figure 2-3 Interface between ISP library and AWB Library

【Example】

None.

【Related Topic】

3.2.18. CVI_ISP_AWBLibUnRegCallBack

【Description】

The callback interface of AWB library anti registration provided by ISP.

【Syntax】

CVI_S32 CVI_ISP_AWBLibUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstAwbLib

AWB library structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

_images/System005.png

Fig. 3.4 Figure 2-3 Interface between ISP library and AWB Library

【Example】

None.

【Related Topic】

3.2.19. CVI_ISP_SetBindAttr

【Description】

Set the binding relationship between ISP library, 3A library and sensor.

【Syntax】

CVI_S32 CVI_ISP_SetBindAttr(VI_PIPE ViPipe, const ISP_BIND_ATTR_S *pstBindAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstBindAttr

Binding structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.20. CVI_ISP_GetBindAttr

【Description】

Get the binding relationship between ISP library, 3A library and sensor.

【Syntax】

CVI_S32 CVI_ISP_GetBindAttr(VI_PIPE ViPipe, ISP_BIND_ATTR_S *pstBindAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstBindAttr

Binding structure pointer

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

  • This interface does not support multiprocess operations.

  • This interface is not supported on the linux side of the dual-os SDK.

【Example】

None.

【Related Topic】

3.2.21. CVI_ISP_SetCtrlParam

【Description】

Set ISP control parameters.

【Syntax】

CVI_S32 CVI_ISP_SetCtrlParam(VI_PIPE ViPipe, const ISP_CTRL_PARAM_S *pstIspCtrlParam);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstIspCtrlParam

ISP control parameter structure pointer.

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.22. CVI_ISP_GetCtrlParam

【Description】

Get ISP control parameters.

【Syntax】

CVI_S32 CVI_ISP_GetCtrlParam(VI_PIPE ViPipe, ISP_CTRL_PARAM_S *pstIspCtrlParam);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstIspCtrlParam

ISP control parameter structure pointer.

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.23. CVI_ISP_SetModParam

【Description】

Set ISP module parameters.

【Syntax】

CVI_S32 CVI_ISP_SetModParam(const ISP_MOD_PARAM_S *pstModParam);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ViPipe number

Input

pstIspModParam

ISP module parameter structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.24. CVI_ISP_GetModParam

【Description】

Get ISP module parameters.

【Syntax】

CVI_S32 CVI_ISP_GetModParam(ISP_MOD_PARAM_S *pstModParam);

【Parameter】

Parameter

Description

Input/Output

pstIspCtrlParam

ISP module parameter structure pointer

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h

  • Library files: libisp.a

【Note】

None.

【Example】

None.

【Related Topic】

3.2.25. CVI_BIN_ExportBinData

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.26. CVI_BIN_ImportBinData

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.27. CVI_BIN_GetBinExtraAttr

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.28. CVI_BIN_GetBinTotalLen

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.29. CVI_BIN_SetBinName

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.30. CVI_BIN_GetBinName

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.31. CVI_BIN_SaveParamToBin

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.32. CVI_BIN_LoadParamFromBin

【Description】

For details, see section 3.1.2 of the 《PQ Tools User Guide》.

3.2.33. CVI_ISP_IrAutoRunOnce

【Description】

Run the infrared automatic switching function.

【Syntax】

CVI_S32 CVI_ISP_IrAutoRunOnce(ISP_DEV IspDev, ISP_IR_AUTO_ATTR_S *pstIrAttr);

【Parameter】

Parameter

Description

Input/Output

IspDev

ISP device number

Input

pstIrAttr

Infrared automatic switching properties

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_comm_isp.h, cvi_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

ISP_DEV IspDev = 0;

ISP_IR_AUTO_ATTR_S stIrAttr;

stIrAttr.bEnable = 1;

stIrAttr.u32Normal2IrIsoThr = 3200;

stIrAttr.u32Ir2NormalIsoThr = 100;

stIrAttr.u32RGMin = 256;

stIrAttr.u32RGMax = 512;

stIrAttr.u32BGMin = 256;

stIrAttr.u32BGMax = 512;

CVI_ISP_IrAutoRunOnce(IspDev, &stIrAttr);

【Related Topic】

None.

3.2.34. CVI_ISP_SetSmartInfo

【Description】

Set the coordinates recognized by Deep Learning (face, human form, object) for AE metering.

【Syntax】

CVI_S32 CVI_ISP_SetSmartInfo(VI_PIPE ViPipe, const ISP_SMART_INFO_S *pstSmartInfo, CVI_U8 TimeOut);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ISP device number

Input

pstSmartInfo

AE Deep Learning recognition coordinate information structure pointer

Input

TimeOut

The frame number of the recognition coordinate information is not updated, and the normal AE mode will be restored after exceeding

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_ae.h

  • Library files: libae.a

【Note】

None.

【Example】

//Set the coordinate position of the face in the raw domain (X, Y , W, H) =(0, 0, 100, 100)

// and frame width/height 1920/1080 information to AE

//Return to normal AE after the recognition result is not updated for 4 frames

VI_PIPE ViPipe = 0;

ISP_SMART_INFO_S stSmartInfo;

CVI_ISP_GetSmartInfo(ViPipe, &stSmartInfo);

stSmartInfo.stROI[0].bEnable = 1;

stSmartInfo.stROI[0].bAvailable = 1;

stSmartInfo.stROI[0].u8Num = 1;

stSmartInfo.stROI[0].u16PosX[0] = 0;

stSmartInfo.stROI[0].u16PosY[0] = 0;

stSmartInfo.stROI[0].u16Width[0] = 100;

stSmartInfo.stROI[0].u16Height[0] = 100;

stSmartInfo.stROI[0].u16FrameWidth = 1920;

stSmartInfo.stROI[0].u16FrameHeight = 1080;

CVI_ISP_SetSmartInfo(ViPipe, &stSmartInfo, 4);

【Related Topic】

3.2.35. CVI_ISP_GetSmartInfo

【Description】

Get the coordinates recognized by Deep Learning (face, human form, object) for AE metering.

【Syntax】

CVI_S32 CVI_ISP_GetSmartInfo(VI_PIPE ViPipe, ISP_SMART_INFO_S *pstSmartInfo);

【Parameter】

Parameter

Description

Input/Output

ViPipe

ISP device number

Input

pstSmartInfo

AE Deep Learning recognition coordinate information structure pointer

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_ae.h

  • Library files: libae.a

【Note】

None.

【Example】

None.

【Related Topic】

3.3. Data Types

Variables in this document that do not explicitly specify a range of values default to the range of values corresponding to the data type. For example, Variables of CVI_U8 data type range from [0, 255]. Variables in this document, such as data precision, are not explicitly specified. Default is 1.

3.3.1. RECT_S

【Description】

Define the start position of the clipping window and the image width and height

【Syntax】

typedef struct _RECT_S {

CVI_S32 s32X;

CVI_S32 s32Y;

CVI_U32 u32Width;

CVI_U32 u32Height;

} RECT_S;

【Member】

Member

Description

s32X

Horizontal starting position

s32Y

Vertical starting position

u32Width

Image Width

u32Height

Image Height

【Note】

None.

【Related Data Type and Interface】

None.

3.3.2. SIZE_S

【descriptiob】

Defines the width and height of the sensor output.

【Syntax】

typedef struct _SIZE_S {

CVI_U32 u32Width;

CVI_U32 u32Height;

} SIZE_S;

【Member】

Member

Description

u32Width

Sensor output width

u32Height

Sensor output height

【Note】

None.

【Related Data Type and Interface】

None.

3.3.3. ISP_BAYER_FORMAT_E

【Description】

Defines the format type of the Bayer array for the input ISP image

【Syntax】

typedef enum _ISP_BAYER_FORMAT_E {
  BAYER_BGGR,
  BAYER_GBRG,
  BAYER_GRBG,
  BAYER_RGGB,
  //for RGBIR sensor
  BAYER_GRGBI = 8,
  BAYER_RGBGI,
  BAYER_GBGRI,
  BAYER_BGRGI,
  BAYER_IGRGB,
  BAYER_IRGBG,
  BAYER_IBGRG,
  BAYER_IGBGR,
  BAYER_BUTT
} ISP_BAYER_FORMAT_E;

【Member】

Member

Description

BAYER_XX

The format types of the various Bayer arrays, and the names indicate how the pixels are arranged

【Note】

None.

【Related Data Type and Interface】

None.

3.3.4. WDR_MODE_E

【Description】

Defines the operation mode of the sensor

【Syntax】

typedef enum _WDR_MODE_E {
  WDR_MODE_NONE = 0,
  WDR_MODE_BUILT_IN,
  WDR_MODE_QUDRA,

  WDR_MODE_2To1_LINE,
  WDR_MODE_2To1_FRAME,
  WDR_MODE_2To1_FRAME_FULL_RATE,

  WDR_MODE_3To1_LINE,
  WDR_MODE_3To1_FRAME,
  WDR_MODE_3To1_FRAME_FULL_RATE,
  WDR_MODE_4To1_LINE,
  WDR_MODE_4To1_FRAME,
  WDR_MODE_4To1_FRAME_FULL_RATE,

  WDR_MODE_MAX,
} WDR_MODE_E;

【Member】

Member

Description

WDR_MODE_NONE

Linear mode.

WDR_MODE_BUILT_IN

Sensor synthetic WDR mode.

WDR_MODE_QUDRA

Qudra mode

WDR_MODE_2To1_LINE

2-frame composite row WDR mode.

WDR_MODE_2To1_FRAME

2-frame composite frame WDR mode.

WDR_MODE_2To1_FRAME_FULL_RATE

2-Frame Composite Frame WDR Full Frame Rate Mode.

WDR_MODE_3To1_LINE

3-frame composite row WDR mode

WDR_MODE_3To1_FRAME

3-frame composite frame WDR mode.

WDR_MODE_3To1_FRAME_FULL_RATE

3-Frame Composite Frame WDR Full Frame Rate Mode.

WDR_MODE_4To1_LINE

4-frame composite row WDR mode.

WDR_MODE_4To1_FRAME

4-frame composite frame WDR mode.

WDR_MODE_4To1_FRAME_FULL_RATE

4-Frame Composite Frame WDR Full Frame Rate Mode.

【Note】

None.

【Related Data Type and Interface】

None.

3.3.5. ISP_PUB_ATTR_S

【Description】

Define ISP Common Properties

【Syntax】

typedef struct _ISP_PUB_ATTR_S {
  RECT_S stWndRect;
  SIZE_S stSnsSize;
  CVI_FLOAT f32FrameRate;
  ISP_BAYER_FORMAT_E enBayer;
  WDR_MODE_E enWDRMode;
  CVI_U8 u8SnsMode;
} ISP_PUB_ATTR_S;

【Member】

Member

Description

stWndRect

rect of Isp output

stSnsSize

image size of sensor

f32FrameRate

Sensor frame rate

enBayer

Bayer format for Sensor

enWDRMode

Wide dynamic mode

u8SnsMode

Used for selection of Sensor initialization sequences,

different u8SnsModes are configured to correspond to different initialization

sequences at the same resolution and frame rate.Otherwise,

u8SnsModel is configured as 0 by default and can

be selected through stSnsSize and f32FrameRate for initialization sequence selection.

【Note】

None.

【Related Data Type and Interface】

3.3.6. ISP_FMW_STATE_E

【Description】

Define the ISP firmware state.

【Syntax】

typedef enum _ISP_FMW_STATE_E {
  ISP_FMW_STATE_RUN,
  ISP_FMW_STATE_FREEZE,
  ISP_FMW_STATE_BUTT
} ISP_FMW_STATE_E;

【Member】

Member

Description

ISP_FMW_STATE_RUN

The Firmware runs properly

ISP_FMW_STATE_FREEZE

Firmware Freeze State

【Note】

None.

【Related Data Type and Interface】

3.3.7. ISP_MODULE_CTRL_U

【Description】

Define control of ISP function modules

【Syntax】

typedef union _ISP_MODULE_CTRL_U {
  CVI_U64 u64Key;
  struct {
    CVI_U64 bitBypassBlc : 1; /* RW;[0] */
    CVI_U64 bitBypassRlsc : 1; /* RW;[1] */
    CVI_U64 bitBypassFpn : 1; /* RW;[2] */
    CVI_U64 bitBypassDpc : 1; /* RW;[3] */
    CVI_U64 bitBypassCrosstalk : 1; /* RW;[4] */
    CVI_U64 bitBypassWBGain : 1; /* RW;[5] */
    CVI_U64 bitBypassDis : 1; /* RW;[6] */
    CVI_U64 bitBypassBnr : 1; /* RW;[7] */
    CVI_U64 bitBypassDemosaic : 1; /* RW;[8] */
    CVI_U64 bitBypassRbgcac : 1; /* RW;[9] */
    CVI_U64 bitBypassMlsc : 1; /* RW;[10] */
    CVI_U64 bitBypassCcm : 1; /* RW;[11] */
    CVI_U64 bitBypassFusion : 1; /* RW;[12] */
    CVI_U64 bitBypassDrc : 1; /* RW;[13] */
    CVI_U64 bitBypassGamma : 1; /* RW;[14] */
    CVI_U64 bitBypassDehaze : 1; /* RW;[15] */
    CVI_U64 bitBypassClut : 1; /* RW;[16] */
    CVI_U64 bitBypassCsc : 1; /* RW;[17] */
    CVI_U64 bitBypassDci : 1; /* RW;[18] */
    CVI_U64 bitBypassCa : 1; /* RW;[19] */
    CVI_U64 bitBypassPreyee : 1; /* RW;[20] */
    CVI_U64 bitBypassMotion : 1; /* RW;[21] */
    CVI_U64 bitBypass3dnr : 1; /* RW;[22] */
    CVI_U64 bitBypassYnr : 1; /* RW;[23] */
    CVI_U64 bitBypassCnr : 1; /* RW;[24] */
    CVI_U64 bitBypassCac : 1;   /*RW:[25]*/
    CVI_U64 bitBypassCa2 : 1;   /*RW:[26]*/
    CVI_U64 bitBypassYee : 1;   /*RW:[27]*/
    CVI_U64 bitBypassYcontrast : 1;   /*RW:[28]*/
    CVI_U64 bitBypassMono : 1;   /*RW:[29]*/
    CVI_U64 bitRsv : 34; /* H  ; [30:63] */
  };
} ISP_MODULE_CTRL_U;

【Member】

Member

Description

u64Key

Integer value for structure enumeration

bitbypassxxx

Each module function controls bit

【Note】

None.

【Related Data Type and Interface】

3.3.8. ISP_VD_TYPE_E

【Description】

Define synchronization signal with ISP

【Syntax】

typedef enum _ISP_VD_TYPE_E {
  ISP_VD_FE_START = 0,
  ISP_VD_FE_END,
  ISP_VD_BE_END,
  ISP_VD_MAX
} ISP_VD_TYPE_E;

【Member】

Member

Description

ISP_VD_FE_START

Starting signal of FE frame

ISP_VD_FE_END

End signal of FE frame

ISP_VD_BE_END

End signal of BE frame

【Note】

None.

【Related Data Type and Interface】

3.3.9. ISP_SNS_ATTR_INFO_S

【Description】

Define ISP sensor properties.

【Syntax】

typedef struct _ISP_SNS_ATTR_INFO_S {
  CVI_U32 eSensorId;
} ISP_SNS_ATTR_INFO_S;

【Member】

Member

Description

eSensorid

Sensor ID number

【Note】

None.

【Related Data Type and Interface】

3.3.10. ALG_LIB_S

【Description】

Used library information

【Syntax】

typedef struct _ALG_LIB_S {
  CVI_S32 s32Id;
  CVI_CHAR acLibName[ALG_LIB_NAME_SIZE_MAX];
} ALG_LIB_S;

【Member】

Member

Description

s32Id

Id of the algorithm library instance.

acLibName

An array of characters identifying the name of the algorithm library.

【Note】

None.

【Related Data Type and Interface】

3.3.11. ISP_AE_EXP_FUNC_S

【Description】

Defines the AE callback function structure.

【Syntax】

typedef struct _ISP_AE_EXP_FUNC_S {
  CVI_S32 (*pfn_ae_init)(VI_PIPE ViPipe, const ISP_AE_PARAM_S *pstAeParam);
  CVI_S32 (*pfn_ae_run)(VI_PIPE ViPipe, const ISP_AE_INFO_S *pstAeInfo, ISP_AE_RESULT_S *pstAeResult, CVI_S32 s32Rsv);
  CVI_S32 (*pfn_ae_ctrl)(VI_PIPE ViPipe, CVI_U32 u32Cmd, void *pValue);
  CVI_S32 (*pfn_ae_exit)(VI_PIPE ViPipe);
} ISP_AE_EXP_FUNC_S;

【Member】

Member

Description

pfn_ae_init

Initializes the callback function pointer for AE.

pfn_ae_run

Callback function pointer that runs AE.

pfn_ae_ctrl

Callback function pointer that controls the internal state of AE.

pfn_ae_exit

Destroy the callback function pointer for AE.

【Note】

None.

【Related Data Type and Interface】

3.3.12. ISP_AE_REGISTER_S

【Description】

【Syntax】

typedef struct _ISP_AE_REGISTER_S {
  ISP_AE_EXP_FUNC_S stAeExpFunc;
} ISP_AE_REGISTER_S;

【Member】

Member

Description

stAeExpFunc

AE registered callback function structure.

【Note】

None.

【Related Data Type and Interface】

3.3.13. ISP_SENSOR_EXP_FUNC_S

【Description】

Define sensor callback function structure

【Syntax】

typedef struct _ISP_SENSOR_EXP_FUNC_S {
  CVI_VOID (*pfn_cmos_sensor_init)(VI_PIPE ViPipe);
  CVI_VOID (*pfn_cmos_sensor_exit)(VI_PIPE ViPipe);
  CVI_VOID (*pfn_cmos_sensor_global_init)(VI_PIPE ViPipe);
  CVI_S32 (*pfn_cmos_set_image_mode)(VI_PIPE ViPipe, ISP_CMOS_SENSOR_IMAGE_MODE_S *pstSensorImageMode);
  CVI_S32 (*pfn_cmos_set_wdr_mode)(VI_PIPE ViPipe, CVI_U8 u8Mode);

  /* the algs get data which is associated with sensor, except 3a */
  CVI_S32 (*pfn_cmos_get_isp_default)(VI_PIPE ViPipe, ISP_CMOS_DEFAULT_S *pstDef);
  CVI_S32 (*pfn_cmos_get_isp_black_level)(VI_PIPE ViPipe, ISP_CMOS_BLACK_LEVEL_S *pstBlackLevel);
  CVI_S32 (*pfn_cmos_get_sns_reg_info)(VI_PIPE ViPipe, ISP_SNS_SYNC_INFO_S *pstSnsRegsInfo);

  /* the function of sensor set pixel detect */
  //CVI_VOID (*pfn_cmos_set_pixel_detect)(VI_PIPE ViPipe, bool bEnable);
} ISP_SENSOR_EXP_FUNC_S;

【Member】

Member

Description

pfn_cmos_sensor_init

Initialize sensor’s callback function pointer.

pfn_cmos_sensor_exit

Sensor’s callback exits the function pointer.

pfn_cmos_sensor_global_init

Initializes a callback function pointer to a global variable.

pfn_cmos_set_image_mode

Sets the callback function pointer for resolution and frame rate switching.

pfn_cmos_set_wdr_mode

Sets the callback function pointer in wdr mode.

pfn_cmos_get_isp_default

A callback function pointer that gets the initial value of an ISP-based algorithm.

pfn_cmos_get_isp_black_level

A callback function pointer to get the black level value of the sensor, which supports dynamic adjustment of the black level value based on the sensor gain.

pfn_cmos_get_sns_reg_info

A callback function pointer for sensor register information to implement kernel state configuration AE information.

pfn_cmos_set_pixel_detect

Sets the callback function pointer of the bad point correction switch.

【Note】

None.

【Related Data Type and Interface】

None.

3.3.14. ISP_SENSOR_REGISTER_S

【Description】

【Syntax】

typedef struct bmISP_SENSOR_REGISTER_S {

  ISP_SENSOR_EXP_FUNC_S stSnsExp;

} ISP_SENSOR_REGISTER_S;

【Member】

Member

Description

stSnsExp

Sensor registered callback function structure.

【Note】

None.

【Related Data Type and Interface】

3.3.15. ISP_AWB_EXP_FUNC_S

【Description】

【Syntax】

typedef struct _ISP_AWB_EXP_FUNC_S {

  CVI_S32 (*pfn_awb_init)(VI_PIPE ViPipe, const ISP_AWB_PARAM_S *pstAwbParam);

  CVI_S32 (*pfn_awb_run)(VI_PIPE ViPipe, const ISP_AWB_INFO_S *pstAwbInfo, ISP_AWB_RESULT_S *pstAwbResult,

  CVI_S32 s32Rsv);

  CVI_S32 (*pfn_awb_ctrl)(VI_PIPE ViPipe, CVI_U32 u32Cmd, CVI_VOID * pValue);

  CVI_S32 (*pfn_awb_exit)(VI_PIPE ViPipe);

} ISP_AWB_EXP_FUNC_S;

【Member】

【Note】

None.

【Related Data Type and Interface】

None.

3.3.16. ISP_AWB_REGISTER_S

【Description】

【Syntax】

typedef struct _ISP_AWB_REGISTER_S {

  ISP_AWB_EXP_FUNC_S stAwbExpFunc;

} ISP_AWB_REGISTER_S;

【Member】

【Note】

None.

【Related Data Type and Interface】

3.3.17. ISP_BIND_ATTR_S

【Description】

【Syntax】

typedef struct _ISP_BIND_ATTR_S {

  CVI_S32 sensorId;

  ALG_LIB_S stAeLib;

  ALG_LIB_S stAfLib;

  ALG_LIB_S stAwbLib;

} ISP_BIND_ATTR_S;

【Member】

Member

Description

SensorId

registered Sensor Id

stAeLib

AE library structure.

stAwbLib

AF library structure.

stAfLib

AWB library structure.

【Note】

None.

【Related Data Type and Interface】

3.3.18. ISP_CTRL_PARAM_S

【Description】

Define the ISP control parameter structure.

【Syntax】

typedef struct _ISP_CTRL_PARAM_S {

  CVI_U32 u32AEStatIntvl;

  CVI_U32 u32AWBStatIntvl;

  CVI_U32 u32AFStatIntvl;

  CVI_U32 u32ProcParam;

  CVI_U32 u32ProcLevel;

  CVI_U32 u32UpdatePos;

  CVI_U32 u32IntTimeOut;

  CVI_U32 u32PwmNumber;

  CVI_U32 u32PortIntDelay;

} ISP_CTRL_PARAM_S;

【Member】

Member

Description

u32AEStatIntvl

ISP 3A AE statistics update frequency, unit is frame. Value range: (0,0xffffffff]

u32AWBStatIntvl

Update frequency of ISP 3A AWB statistics in frames. Range of values: (0,0xffffff]

u32AFStatIntvl

Update frequency of ISP 3A AF statistics in frames. Range of values: (0,0xffffff]

u32ProcParam

The frequency at which ISP collects information, in frames, with a default value of 30. The higher this value, the lower the RISC-V utilization of the ISP. Range of values: (0,0xffffff]

u32ProcLevel

ISP’s proc prints Level, Level 0, proc function is off, Level 1, Simplified information, Level 2, More information, Level 3, Very much information (will also print 3A statistics)

u32UpdatePos

Currently cvitek only supports configuring sensor registers at the beginning of a frame with a default value of 0

u32IntTimeOut

Represents the time (ms) at which the interrupt timed out. Cvitek is not currently in use

u32PwmNumber

Represents a PWM number. Cvitek is not currently in use

u32PortIntDelay

Represents Port interrupt delay time

【Note】

None.

【Related Data Type and Interface】

3.3.19. ISP_MOD_PARAM_S

【Description】

Define ISP module parameter structure.

【Syntax】

typedef struct _ISP_MOD_PARAM_S {

 CVI_U32 u32IntBotHalf;

} ISP_MOD_PARAM_S;

【Member】

Member

Description

u32intbothalf

Indicates whether the ISP interrupt processing adopts the lower half mechanism,

and the default value is 0.

Currently, cvitek only supports (reading statistics and configuring sensor and ISP synchronization registers) to be completed in the interrupt service routine;

【Note】

None.

【Related Data Type and Interface】

3.3.20. ISP_IR_AUTO_ATTR_S

【Description】

Defines the infrared auto-switching properties.

【Syntax】

typedef struct _ISP_IR_AUTO_ATTR_S

{

 CVI_BOOL bEnable;

 CVI_U32 u32Normal2IrIsoThr;

 CVI_U32 u32Ir2NormalIsoThr;

 CVI_U32 u32RGMax;

 CVI_U32 u32RGMin;

 CVI_U32 u32BGMax;

 CVI_U32 u32BGMin;

 ISP_IR_STATUS_E enIrStatus;

 ISP_IR_SWITCH_STATUS_E enIrSwitch;

} ISP_IR_AUTO_ATTR_S;

【Member】

Member

Description

benable:

Infrared automatic switching enable.

CVI_FALSE: off;

CVI_TRUE: enable.

u32Normal2IrIsoThr

The ISO threshold for switching from normal to infrared.

When the actual effective ISO is greater than this threshold, the system needs to switch to the infrared state.

Value range: [0, 0xFFFFFFFF].

u32Ir2NormalIsoThr

The ISO threshold for switching from infrared state to normal state.

When the actual effective ISO is lower than this threshold, the system needs to switch to the normal state.

Value range: [0, 0xFFFFFFFF].

u32RGMax

R/G maximum value in infrared state. When the R/G of the actual image is greater than this parameter, the system needs to switch to the normal state. 4.8 format. Value range: [0, 0xFFF].

u32RGMin

R/G minimum value in infrared state.

When the R/G of the actual image is smaller than this parameter, the system needs to switch to the normal state. 4.8 format.

Value range: [0, u32RGMax].

u32BGMax

The maximum value of B/G in the infrared state. When the B/G of the actual image is greater than this parameter, the system needs to switch to the normal state. 4.8 format. Value range: [0, 0xFFF].

u32BGMin

B/G minimum value in infrared state. When the B/G of the actual image is smaller than this parameter, the system needs to switch to the normal state. 4.8 format. Value range: [0, u32BGMax].

enIrStatus

The current infrared state of the device. It should be configured as the actual infrared state of the device, and the user needs to ensure the correctness of the state.

enIrSwitch

The infrared switching status of the device, which is read-only.

【Note】

None.

【Related Data Type and Interface】

None.