19
Programmer's reference
5.4.6
HRDLGetSingleValueAsync
int16_t HRDLGetSingleValueAsync
(
int16_t handle,
int32_t * value,
int16_t * overflow
)
This function retrieves the reading when the
has been
called.
Arguments
handle
Handle returned by
value
Pointer to an
int32_t
where the ADC value will be written
overflow
Pointer to a value that indicates when the voltage on a channel has
exceeded the upper or lower limits.
Bit 0: Channel 1
...
Bit 15: Channel 16
Returns
1
if a valid handle is passed and the function succeeds
0
if not
Sample code
Code extract to get a single value reading without blocking the calling thread:
void main()
{
BOOL bConversionFinished = FALSE;
int16_t channelNo;
int32_t value;
int16_t handle;
// Open and initialize the unit
.
.
.
// Set the channel parameters
channelNo = HRDL_ANALOG_IN_CHANNEL_1;
range = HRDL_2500_MV;
singleEnded = TRUE;
bConversionFinished = FALSE;
while (true)
{
PollSingleValue(handle,
&bConversionFinished,
&value,
channelNo,
range,
singleEnded);
adc20.en r6
Copyright © 2005–2016 Pico Technology Ltd. All rights reserved.