Add a Sensor

The ISP SDK supports two sensors: IMX219 MIPI sensor and SC2235 DVP sensor. Both use a “SENSOR_FUNCS” structure to implement the sensor feature and provide this handle for adaptive control. You can also add a sensor of your choice to the sensor library.

Follow the steps below to add a new sensor:
  1. Declare a private sensor structure that packed the SENSOR_FUNCTS structure and necessary variables.

    For an MIPI sensor, refer to the imx219mipi.c and imx219mipi.hfiles.

    For a DVP sensor, refer to the sc2235dvp.c and sc2235dvp.h files.

  2. Implement member functions based on the structure of SENSOR_FUNCS.

    The following functions are required.
    • GetModeIdx
    • GetMode
    • GetState
    • GetInterfaceInfo
    • Enable
    • Disable
    • Destroy
    • GetInfo
    • GetRegister
    • SetRegister
    • GetGainRange
    • GetCurrentGain
    • SetGain
    • GetExposureRange
    • GetExposure
    • SetExposure
    • SetExposureAndGain
  3. Implement a creation function for the private sensor structure initialization.

  4. Add the sensor creation function into the InitialiseSensors[] structure.

  5. Add the sensor name into the Sensors[] structure.

  6. Add the file names with ".c" and ".h" extensions into the file CMakeLists.txt.

  7. Re-build the ISP SDK to test the sensor functions.