User`s manual

User’s Manual 47
4.4.5 A/D Converter Inputs
Calibrates the response of the A/D converter channel as a linear function using the two conversion points
provided. Gain and offset constants are calculated and placed into global table
_adcInCalib.
PARAMETERS
channel is the A/D converter input channel (0–10).
value1 is the first A/D converter channel value.
volts1 is the voltage corresponding to the first A/D converter channel value.
value2 is the second A/D converter channel value.
volts2 is the voltage corresponding to the second A/D converter channel value.
RETURN VALUE
0 if successful.
-1 if not able to make calibration constants.
SEE ALSO
anaIn, anaInVolts, brdInit
Reads the voltage of an analog input channel by serially clocking out an 8-bit command to the A/D con-
verter device of the following formats:
TLC2543 commands
D7–D4
Channel 0 - 10
Channel 11 = (V
ref+
- V
ref-
)/2
Channel 12 = V
ref-
Channel 13 = V
ref+
Channel 14 = software powerdown
D3-D2
Output data length:
01—8 bits
00—12 bits (normally used as default)
11—16 bits (not supported by driver)
D1
Output data format
0—MSB first
1—LSB first (not supported by driver)
D0
Mode of operation
0—Unipolar (normally used as default)
1—Bipolar
void anaInCalib(int channel, int value1,
float volts1, int value2, float volts2);
int _anaIn(unsigned char cmd, char len);