Procedure for Adding a New Sensor
Follow the procedure below to add a new sensor.
- Declare a private sensor structure that packed the
“SENSOR_FUNCTS” structure and necessary variables.
For the MIPI sensor, you can refer to the files of imx219mipi.c and imx219mipi.h. Related to the DVP sensor, you can refer to the files of sc2235dvp.c and sc2235dvp.h.
- Implement member functions based on the structure of
“SENSOR_FUNCS”. The following member 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.