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.
-
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.
-
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
-
Implement a creation function for the private sensor structure initialization.
-
Add the sensor creation function into the InitialiseSensors[] structure.
-
Add the sensor name into the Sensors[] structure.
-
Add the file names with ".c" and ".h" extensions into the file CMakeLists.txt.
-
Re-build the ISP SDK to test the sensor functions.