Sensor Function

The following code block shows the data structure for the sensor function structure.
typedef struct _SENSOR_FUNCS {
    STF_S8 (*GetModeIdx)(SENSOR_HANDLE *pstHandle, STF_U16 u16Width, STF_U16 u16Height);
    STF_RESULT (*GetMode)(SENSOR_HANDLE *pstHandle, STF_U8 u8ModeIdx, SENSOR_MODE *pstModes);
    STF_RESULT (*GetState)(SENSOR_HANDLE *pstHandle, SENSOR_STATUS *pstStatus);
    STF_RESULT (*GetInterfaceInfo)(SENSOR_HANDLE *pstHandle, SENSOR_INTFC *pstInterface);
    STF_RESULT (*SetMode)(SENSOR_HANDLE *pstHandle, STF_U8 u8ModeIdx, STF_U8 u8Flipping);
    STF_RESULT (*Enable)(SENSOR_HANDLE *pstHandle);
    STF_RESULT (*Disable)(SENSOR_HANDLE *pstHandle);
    STF_RESULT (*Destroy)(SENSOR_HANDLE *pstHandle);
    STF_RESULT (*GetInfo)(SENSOR_HANDLE *pstHandle, SENSOR_INFO *pstInfo);
    STF_RESULT (*GetRegister)(SENSOR_HANDLE *pstHandle, STF_U16 u16RegAddr, STF_U16 *pu16RegVal, STF_U8 u8Context);
    STF_RESULT (*SetRegister)(SENSOR_HANDLE *pstHandle, STF_U16 u16RegAddr, STF_U16 u16RegVal, STF_U8 u8Context);
    STF_RESULT (*GetGainRange)(SENSOR_HANDLE *pstHandle, STF_DOUBLE *pdMin, STF_DOUBLE *pdMax, STF_U8 *pu8Contexts );
    STF_RESULT (*GetCurrentGain)(SENSOR_HANDLE *pstHandle, STF_DOUBLE *pdCurrentGain, STF_U8 u8Context);
    STF_RESULT (*SetGain)(SENSOR_HANDLE *pstHandle, STF_DOUBLE dGain, STF_U8 u8Context);
    STF_RESULT (*GetExposureRange)(SENSOR_HANDLE *pstHandle, STF_U32 *pu32Min, STF_U32 *pu32Max, STF_U8 *pu8Contexts);
    STF_RESULT (*GetExposure)(SENSOR_HANDLE *pstHandle, STF_U32 *pu32Exposure, STF_U8 u8Context);
    STF_RESULT (*SetExposure)(SENSOR_HANDLE *pstHandle, STF_U32 u32Exposure, STF_U8 u8Context);
    STF_RESULT (*GetFocusRange)(SENSOR_HANDLE *pstHandle, STF_U16 *pu16Min, STF_U16 *pu16Max);
    STF_RESULT (*GetCurrentFocus)( SENSOR_HANDLE *pstHandle, STF_U16 *pu16CurrentFocus);
    STF_RESULT (*SetFocus)(SENSOR_HANDLE *pstHandle, STF_U16 u16Focus);
    STF_RESULT (*ConfigureFlash)(SENSOR_HANDLE *pstHandle, STF_BOOL8 bAlwaysOn, STF_S16 s16FrameDelay, STF_S16 s16Frames, STF_U16 u16FlashPulseWidth);
    STF_RESULT (*Insert)(SENSOR_HANDLE *pstHandle);
    STF_RESULT (*WaitProcessed)(SENSOR_HANDLE *pstHandle);
    STF_RESULT (*SetFlipMirror)(SENSOR_HANDLE *pstHandle, STF_U8 u8Flag);
    STF_RESULT (*GetFixedFPS)(SENSOR_HANDLE *pstHandle, STF_U16 *py16Fixed);
    STF_RESULT (*SetFPS)(SENSOR_HANDLE *pstHandle, STF_DOUBLE dFps);
    STF_RESULT (*SetExposureAndGain)(SENSOR_HANDLE *pstHandle, STF_U32 u32Exposure, STF_DOUBLE dGain, STF_U8 u8Context);
    STF_RESULT (*SetResolution)(SENSOR_HANDLE *pstHandle,  STF_U16 u16ImgW, STF_U16 U16ImgH);
    STF_RESULT (*GetSnapRes)(SENSOR_HANDLE *pstHandle, ST_RES_LIST *pstReslist);
    STF_RESULT (*Reset)(SENSOR_HANDLE *pstHandle);
} SENSOR_FUNCS, *PSENSOR_FUNCS;
The following table describes the fields in the above code block.
Table 1. Sensor Function Field Description
Field Description
*GetModeIdx Get the sensor mode index
*GetMode Fill in a structure detailing the modes supported by the sensor
*GetState Get the current state of the sensor
*GetInterfaceInfo Get the sensor's connection data bus and I2C hardware information
*SetMode Set the sensor mode
*Enable Enable the sensor
*Disable Disable the sensor
*Destroy Release and de-initialize the sensor
*GetInfo Get information about the sensor
*GetRegister Read the sensor register value
*SetRegister Set the sensor register value
*GetGainRange Get the range of gain settings that the sensor can support
*GetCurrentGain Get the current gain setting from sensor
*SetGain Set the current gain setting to the sensor
*GetExposureRange Get the range of exposures the sensor can use
*GetExposure Query the sensor for the current exposure period
*SetExposure Set the sensor to the requested exposure period
*GetFocusRange1 Get the range of allowed focus positions. No longer in use
*GetCurrentFocus1 Query the current focus position. No longer in use
*SetFocus1 Set the sensor to focus at the selected position. No longer in use
*ConfigureFlash1 Set the sensor to the requested exposure period. No longer in use
*Insert1 Used to control insertion point of the sensor. No longer in use
*WaitProcessed1 Used to wait for an inserted frame to have been fully processed and sent to the ISP. No longer in use
*SetFlipMirror Set flip and mirror value in the sensor
*GetFixedFPS Get the fixed FPS value in the sensor
*SetFPS Set the FPS value in the sensor
*SetExposureAndGain Program the exposure time and gain in the sensor
*SetResolution1 Set the resolution value to the sensor. No longer in use
*GetSnapRes1 Get supported resolution list from the sensor library
*Reset Reset the sensor.
Note:
  1. The field items are no longer in use.