hi_isp_sensor_exp_func

Description

Defines the sensor callback function structure.

Definition

typedef struct {
    hi_void (*pfn_cmos_sensor_init)(hi_vi_pipe vi_pipe);
    hi_void (*pfn_cmos_sensor_exit)(hi_vi_pipe vi_pipe);
    hi_void (*pfn_cmos_sensor_global_init)(hi_vi_pipe vi_pipe);
    hi_s32 (*pfn_cmos_set_image_mode)(hi_vi_pipe vi_pipe, hi_isp_cmos_sensor_image_mode *sensor_image_mode);
    hi_s32 (*pfn_cmos_set_wdr_mode)(hi_vi_pipe vi_pipe, hi_u8 mode);
    hi_s32 (*pfn_cmos_get_isp_default)(hi_vi_pipe vi_pipe, hi_isp_cmos_default *def);
    hi_s32 (*pfn_cmos_get_isp_black_level)(hi_vi_pipe vi_pipe, hi_isp_cmos_black_level *black_level);
    hi_s32 (*pfn_cmos_get_sns_reg_info)(hi_vi_pipe vi_pipe, hi_isp_sns_regs_info *sns_regs_info);
    hi_void (*pfn_cmos_set_pixel_detect)(hi_vi_pipe vi_pipe, hi_bool enable);
    hi_s32 (*pfn_cmos_get_awb_gains)(hi_vi_pipe vi_pipe, hi_u32 *sensor_awb_gain);
    hi_void (*pfn_cmos_notify_event)(hi_vi_pipe vi_pipe, hi_u32 event_id, hi_void *value);
} hi_isp_sensor_exp_func;

Members

Member

Description

pfn_cmos_sensor_init

Pointer to the callback function for initializing the sensor

pfn_cmos_sensor_exit

Pointer to the callback exit function of the sensor

pfn_cmos_sensor_global_init

Pointer to the callback function for initializing global variables

pfn_cmos_set_image_mode

Pointer to the callback function for switching the resolution and frame rate.

Return value 0 indicates that the sensor mode changes. In this case, the ISP calls pfn_cmos_sensor_init to reconfigure the sensor.

Return value -2 indicates that the sensor mode does not change and the ISP does not reconfigure the sensor.

pfn_cmos_set_wdr_mode

Pointer to the callback function for setting the WDR mode

The input parameter is as follows:

mode: The definition is the same as that of hi_wdr_mode.

pfn_cmos_get_isp_default

Pointer to the callback function for obtaining the initial value of the ISP base algorithm

pfn_cmos_get_isp_black_level

Pointer to the callback function for obtaining the sensor black level. The black level can be dynamically adjusted based on the sensor gain. In this case, you can dynamically adjust the black level only by using the manual mode of hi_mpi_isp_set_black_level_attr.

pfn_cmos_get_sns_reg_info

Pointer to the callback function for obtaining sensor register information. It is used to configure AE information in kernel mode

pfn_cmos_set_pixel_detect

Pointer to the callback function for enabling or disabling defect pixel correction

pfn_cmos_get_awb_gains

Callback function for configuring the AWB gain.

The output parameter is as follows:

sensor_awb_gain: AWB gain

pfn_cmos_notify_event

This interface is used to notify the module driver of special events, such as wakeup events after sleep, so that the module can perform some logic processing.

event_id: Must be set to 0. Only one event, the sleep wakeup event, is supported.

value: Must be null. This field is reserved.

Restrictions

  • Values must be assigned to pfn_cmos_sensor_init, pfn_cmos_get_isp_default, pfn_cmos_get_isp_black_level, pfn_cmos_set_pixel_detect and pfn_cmos_get_sns_reg_info. If no value needs to be assigned to other callback function pointers, set them to null. If some sensors do not support resolution switching, pfn_cmos_set_image_mode must be set to null.
  • The configuration position of the AWB gain cannot be changed.