PifChannelTrim
public readonly struct PifChannelTrim
One analog channel's trim, as the device applies it.
This is the answer to "what is actually in force on this pin", which the device-wide calibration cannot give: that one is device-wide, carries what the file declares, and the SDK applies none of it. See AnalogCalibration.
In converter codes, not in volts or milliamperes. The relation is trimmed = Gain * untrimmed + Offset, every value a count of the converter's own steps. PifChannelTrim.Gain is dimensionless and reads the same in either direction; PifChannelTrim.Offset only means something once you know which direction was asked for, which is what PifAnalogDirection selects.
Check PifChannelTrim.Source before believing the other two. On PifTrimSource.Unknown and PifTrimSource.None they are the identity and describe nothing the device does.
PifChannelTrim: properties
public float Gain { get; }
Dimensionless. 1.0 changes nothing.
public float Offset { get; }
In the queried direction's own converter codes. An offset of 2 is two steps, not two volts.
public PifTrimSource Source { get; }
Where PifChannelTrim.Gain and PifChannelTrim.Offset came from.