hi_isp_sensor_exp_func

Description

Defines the sensor callback function.

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_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 function for exiting 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.

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 the AE in kernel mode.

pfn_cmos_set_pixel_detect

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

pfn_cmos_notify_event

This interface is used to notify the module driver of special events, such as the sleep wakeup event, so that the module can perform partial 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.

Precautions

  • Values must be assigned to members 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 values need to be assigned to other callback function pointers, set these pointers to NULL. For example, pfn_cmos_set_image_mode needs to be set to NULL if a sensor that does not support resolution switching is used.
  • The configuration position of the AWB gain cannot be changed.