BL4S200 User’s Manual
123
4.4.7 D/A Converter Outputs
anaOutConfig
int anaOutConfig(char polarity, int mode);
FUNCTION DESCRIPTION
Configures the D/A converter chip for a given output voltage range, 0–10 V or ±10 V,
and loads the calibration data for use by the D/A converter function calls. This function
must be called before accessing any of the D/A converter channels.
NOTE:
If you are using the analog outputs, you must configure the D/A converter chip
using the
anaOutConfig()
function before executing
anaInConfig()
to configure
the A/D converter chip. This is because the A/D converter chip uses internal channels
2–7 on the D/A converter chip to bias the A/D converter input circuit, and the correct
configuration of the A/D converter would be affected if the D/A converter configura-
tion was changed later.
PARAMETERS
polarity
sets the output configuration polarity as follows:
DAC_UNIPOLAR
(0) = unipolar operation. (0–10V and 4–20 mA)
DAC_BIPOLAR
(1) = bipolar operation. (±10V and 4–20 mA)
NOTE:
This parameter has no effect when the D/A converter is configured for 4–20 mA
channels.
mode
the mode of operation:
0 = asynchronous—an output is updated at the time data are written to the given channel
1 = synchronous—all outputs are updated with data previously written when the
anaOutStrobe()
function is executed.
RETURN VALUE
0 — success.
BL_SPIBUSY
— SPI port busy.
-EINVAL
— invalid configuration parameter.
-ERR_ANA_CALIB
— error reading calibration constants.
SEE ALSO
brdInit, anaOut, anaOutmAmps, anaOutStrobe, anaOutConfig, anaOutCalib
electronic components distributor