PifAnalogCalibration
pub struct PifAnalogCalibration
Device-wide SDK calibration of the analog path, as the camera's calibration file declares it.
These are slopes over the converters' own codes, not over volts or
milliamperes. The relation in both directions is
trimmed = gain * untrimmed + offset, with every value a count of
the converter's steps -- 10 mV on an input, 10 mV or 20 uA on an
output depending on the range. An offset of 2 is two steps, not two
volts.
They do not compose with a channel's own gain and offset. That pair is the user's conversion, in the channel's own unit. These two were documented as composing, and that is the fault a later release fixed: applying these numbers to a value in the channel's unit, on top of the calibration the device already applies in code space, carried the file's offset a second time and a thousandfold too large.
The SDK applies none of the four, so setting them changes nothing on a camera. They are reported here, and handed down to a port that has no calibration of its own.
What a camera applies instead is the interface's own per-channel factory trim, which lives in the interface's EEPROM where only the device can read it -- so a device-wide pair cannot express it. On an interface with no EEPROM of its own, such as a PI 1's, the device is given exactly these file values and applies them to every channel, which is what version 11 does.
To read the trim a channel actually has, ask
ProcessInterface::channel_trim. It reports per channel and says
which of those two cases it is describing.
PifAnalogCalibration — fields
input_gain: f32
Input slope from the calibration file, in converter steps. Not applied by the SDK.
input_offset: f32
Input offset from the calibration file, in converter steps. Not applied by the SDK.
output_gain: f32
Output slope from the calibration file, in converter steps. Not applied by the SDK.
output_offset: f32
Output offset from the calibration file, in converter steps. Not applied by the SDK.