Sensor

The following code block shows the data structure for the sensor structure.
typedef struct _ST_SENSOR {
    SENSOR_HANDLE *pstSensorHandle;
    EN_SENSOR_STATE enState;
    STF_U16 u16Width;
    STF_U16 u16Height;
    STF_U8 u8Imager;
    STF_U16 u16VerticalTotal;
    enum MOSAICType enBayerFormat;
    STF_U8 u8SensorContexts;
    STF_U8 u8BitDepth;
    STF_DOUBLE dFrameRate;
    STF_DOUBLE dCurrentFPS;
    STF_U32 u32WellDepth;
    STF_DOUBLE dReadNoise;
    STF_DOUBLE dAperture;
    STF_U16 u16FocalLength;
    STF_U32 u32ProgrammedExposure;
    STF_DOUBLE dProgrammedGain;
    STF_U16 u16ProgrammedFocus;
    STF_U32 u32MinExposure;
    STF_U32 u32MaxExposure;
    STF_U16 u16MinFocus;
    STF_U16 u16MaxFocus;
    STF_DOUBLE dMinGain;
    STF_DOUBLE dMaxGain;
    STF_BOOL8 bFocusSupported;

    const STF_CHAR* (*StateName)(EN_SENSOR_STATE enState);
    STF_VOID (*GetSensorNames)(STF_U8 *pu8Count, STF_CHAR szSensorName[][64]);
    STF_S8 (*GetSensorId)(const char *SensorName);
    STF_RESULT (*Init)(ST_SENSOR *pstSensor, STF_U8 u8SensorId, STF_U8 u8Index);
    STF_RESULT (*Destroy)(ST_SENSOR *pstSensor);
    SENSOR_HANDLE *(*GetHandle)(ST_SENSOR *pstSensor);
    EN_SENSOR_STATE (*GetState)(ST_SENSOR *pstSensor);
    STF_RESULT (*GetInfo)(ST_SENSOR *pstSensor, SENSOR_INFO *pstSensorInfo);
    STF_S8 (*GetModeIdx)(ST_SENSOR *pstSensor, STF_U16 u16Width, STF_U16 u16Height);
    STF_RESULT (*GetMode)(ST_SENSOR *pstSensor, STF_U8 u8ModeIdx, SENSOR_MODE *pstModes);
    STF_RESULT (*SetMode)(ST_SENSOR *pstSensor, STF_U8 u8ModeIdx, STF_U8 u8Flipping);
    STF_RESULT (*GetInterfaceInfo)(ST_SENSOR *pstSensor, SENSOR_INTFC *pstInterface);
    STF_RESULT (*Configure)(ST_SENSOR *pstSensor, STF_U8 u8ModeIdx, STF_U8 u8Flipping);
    STF_RESULT (*Insert)(ST_SENSOR *pstSensor);
    STF_RESULT (*WaitProcessed)(ST_SENSOR *pstSensor);
    STF_RESULT (*Enable)(ST_SENSOR *pstSensor);
    STF_RESULT (*Disable)(ST_SENSOR *pstSensor);
    STF_RESULT (*Reset)(ST_SENSOR *pstSensor);
    STF_RESULT (*GetStatus)(ST_SENSOR *pstSensor, SENSOR_STATUS *pstStatus);
    STF_RESULT (*GetReg)(ST_SENSOR *pstSensor, STF_U16 u16RegAddr, STF_U16 *pu16RegValue);
    STF_RESULT (*SetReg)(ST_SENSOR *pstSensor, STF_U16 u16RegAddr, STF_U16 u16RegValue);
    STF_RESULT (*SetFlipMirror)(ST_SENSOR *pstSensor, STF_U8 u8Flag);
    STF_RESULT (*GetFixedFPS)(ST_SENSOR *pstSensor, STF_U16 *pu16FixedFps);
    STF_RESULT (*SetFPS)(ST_SENSOR *pstSensor, STF_DOUBLE dFps);
    STF_RESULT (*GetSnapShotResolution)(ST_SENSOR *pstSensor, ST_RES_LIST *pstResList);
    STF_RESULT (*SetResolution)(ST_SENSOR *pstSensor, STF_U16 u16ImgW, STF_U16 u16ImgH);
    STF_U32 (*GetMinExposure)(ST_SENSOR *pstSensor);
    STF_U32 (*GetMaxExposure)(ST_SENSOR *pstSensor);
    STF_RESULT (*GetExposureRange)(ST_SENSOR *pstSensor, STF_U32 *pu32MinExposure, STF_U32 *pu32MaxExposure);
    STF_U32 (*GetExposure)(ST_SENSOR *pstSensor);
    STF_RESULT (*SetExposure)(ST_SENSOR *pstSensor, STF_U32 u32Exposure);
    STF_DOUBLE (*GetMinGain)(ST_SENSOR *pstSensor);
    STF_RESULT (*SetMinGain)(ST_SENSOR *pstSensor, STF_DOUBLE dMinGain);
    STF_DOUBLE (*GetMaxGain)(ST_SENSOR *pstSensor);
    STF_RESULT (*SetMaxGain)(ST_SENSOR *pstSensor, STF_DOUBLE dMaxGain);
    STF_RESULT (*GetGainRange)(ST_SENSOR *pstSensor, STF_DOUBLE *pdMinGain, STF_DOUBLE *pdMaxGain);
    STF_RESULT (*SetIsoLimit)(ST_SENSOR *pstSensor, STF_U8 u8IsoLimit);
    STF_DOUBLE (*GetGain)(ST_SENSOR *pstSensor);
    STF_RESULT (*SetGain)(ST_SENSOR *pstSensor, STF_DOUBLE dGain);
    STF_RESULT (*SetExposureAndGain)(ST_SENSOR *pstSensor, STF_U32 u32Exposure, STF_DOUBLE dGain);
    STF_BOOL8 (*GetFocusSupported)(ST_SENSOR *pstSensor);
    STF_U16 (*GetMinFocus)(ST_SENSOR *pstSensor);
    STF_U16 (*GetMaxFocus)(ST_SENSOR *pstSensor);
    STF_U16 (*GetFocusDistance)(ST_SENSOR *pstSensor);
    STF_RESULT (*SetFocusDistance)(ST_SENSOR *pstSensor, STF_U16 u16FocusDistance);
} ST_SENSOR, *PST_SENSOR;
The following table describes the fields in the above code block.
Table 1. Sensor Field Description
Field Description
pstSensorHandle Sensor API handle
enState Sensor running state
u16Width Output image width
u16Height Output image height
u8Imager1 Imager ID. No longer in use
u16VerticalTotal Number of lines including blanking
enBayerFormat Mosaic of the sensor
u8SensorContexts1 Sensor contexts. No longer in use
u8BitDepth Bits per pixel
dFrameRate Sensor default frame rate
dCurrentFPS Frame rate programmed in the sensor
u32WellDepth1 Number of electrons can be held by the sensor wells before clipping. No longer in use
dReadNoise1 Standard deviation of noise when reading pixel value off a sensor in electrons. No longer in use
dAperture1 Aperture f/# of the attached lens. No longer in use
u16FocalLength1 Focal length of the lens in millimetres. No longer In use
u32ProgrammedExposure Exposure time programmed in the sensor
dProgrammedGain Gain programmed in the sensor
u16ProgrammedFocus1 Focus distance set in the sensor. No longer in use
u32MinExposure Minimum exposure times
u32MaxExposure Maximum exposure times
u16MinFocus1 Minimum focus distance. No longer in use
u16MaxFocus1 Maximum focus distance. No longer in use
dMinGain Minimum exposure gain
dMaxGain Maximum exposure gain
bFocusSupported1 Variable focus support status. No longer in use
*StateName Get sensor state name
*GetSensorNames Populate a list with the available sensors from Sensor API
*GetSensorId Get sensor ID from a name
*Init Sensor structure initialization
*Destroy Destroy a sensor through a given identifier
*GetHandle Access to sensors API handle
*GetState Get the sensor state
*GetInfo Get the sensor information
*GetModeIdx Get the sensor mode index
*GetMode Get some mode information (including if flipping is supported)
*SetMode Set the sensor mode
*GetInterfaceInfo Get the sensor connection data bus and I2C hardware information
*Configure Configure the sensor with a selected mode
*Insert1 Access to the Sensor API insert function. No longer in use
*WaitProcessed1 Access to the Sensor API waitProcessed function. No longer in use
*Enable Start transmission of the data from the sensor. In the V4L2 driver, only changed the sensor state
*Disable Stop transmission of the data from the sensor. In the V4L2 driver, only changed the sensor state
*Reset Reset the sensor. In the V4L2 driver, only changed the sensor state
*GetStatus Get status value in the sensor
*GetReg Get the sensor register value
*SetReg Program the value to the register of sensor
*GetFlipMirror Get flip and mirror value in the sensor
*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
*GetSnapShotResolution1 Get the snapshot resolution value in the sensor. No longer in use
*SetResolution1 Set the resolution value to the sensor. No longer in use
*GetMinExposure Get minimum exposure time value programmable in the sensor
*GetMaxExposure Get maximum exposure time value programmable in the sensor
*GetExposureRange Get minimum and maximum exposure time value programmable in the sensor
*GetExposure Get the exposure time programmed in the sensor
*SetExposure Program the exposure time in the sensor
*GetMinGain Get minimum gain value programmable in the sensor
*SetMinGain Set the minimum gain value programmable in the sensor
*GetMaxGain Set the minimum gain value programmable in the sensor
*SetMaxGain Set the maximum gain value programmable in the sensor
*GetGainRange Get minimum and maximum gain value programmable in the sensor
*SetIsoLimit Set minimum and maximum gain value programmable in the sensor according to the ISO value
*GetGain Get the gain value from the sensor
*SetGain Set the gain value in the sensor
*SetExposureAndGain Program the exposure time and gain in the sensor
*GetFocusSupported1 Get state of driver support for variable focus. No longer in use
*GetMinFocus1 Get minimum focus distance. No longer in use
*GetMaxFocus1 Get maximum focus distance. No longer in use
*GetFocusDistance1 Get the current focus distance. No longer in use
*SetFocusDistance1 Set focus distance in the sensor in millimetre. No longer in use
Note:
  1. The field items are no longer in use.