18
ADC-20/ADC-24 User's Guide
5.4.5
HRDLGetSingleValue
int16_t HRDLGetSingleValue
(
int16_t handle,
int16_t channel,
int16_t range,
int16_t conversionTime,
int16_t singleEnded,
int16_t * overflow
int32_t * value
)
This function takes one sample for the specified channel at the selected voltage range
and conversion time.
Arguments
handle
Handle returned by
channel
The channel number to convert.
ADC-20: 1 to 8
ADC-24: 1 to 16
If the channel is not valid then the function will fail and return 0.
range
The voltage range to be used. See
for
possible values. If the range is not valid, the function will return 0.
conversionTime
The time interval in which the sample should be converted. See
for possible values. If the conversion time is
invalid, the function will fail and return 0.
singleEnded
The type of voltage to be measured.
0: differential
nonzero: single-ended
overflow
Pointer to a bit field that indicates when the voltage on a channel
has exceeded the upper or lower limits.
Bit 0: Channel 1
...
Bit 15: Channel 16
value
Pointer to an
int32_t
where the ADC value will be written.
Returns
1
if a valid handle is passed and settings are correct
0
if not
If the function fails, call
with
info = HRDL_ERROR (7)
to obtain
the error code. If the error code is
HRDL_SETTINGS (5)
, then call
again with
info = HRDL_SETTINGS_ERROR (8)
to determine the settings error.
Copyright © 2005–2016 Pico Technology Ltd. All rights reserved.
adc20.en r6