eth32_get_analog_state

int eth32_get_analog_state(eth32 handle, int *state);

Summary

This function retrieves the status of the device's Analog to Digital Converter (ADC) to determine whether it is currently enabled or disabled.

Parameters

  • handle - The value returned by the eth32_open function.

  • state - Pointer to a variable which will receive the status of the ADC. This will be ADC_DISABLED (0) or ADC_ENABLED (1).

Return Value

This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.

Example
eth32 handle;
int result;
int adc_state;

// .... Your code that establishes a connection here

result = eth32_get_analog_state(handle, &adc_state);
if(result)
{
	// Handle error
}

if(adc_state==ADC_ENABLED)
{
	// ADC is enabled
}
else
{
	// ADC is disabled
}
         
See Also

eth32_get_analog_reference, eth32_input_analog, eth32_set_analog_state