ADC_SetReferenceVoltage Function

Header: #include <applibs/adc.h>

Sets the reference voltage for the ADC.

int ADC_SetReferenceVoltage(int fd, ADC_ChannelId channel, float referenceVoltage);

Parameters

  • fd The file descriptor for the ADC controller. The file descriptor is retrieved by ADC_Open.

  • channel The ID of the channel to access. The range of allowed values is controller-dependent and is typically a zero-based index.

  • referenceVoltage The reference voltage to use.

Errors

Returns -1 if an error is encountered and sets errno to the error value. Such errors aren't deterministic and the same behavior might not be retained through system updates.

Return value

Returns 0 for success, or -1 for failure, in which case errno is set to the error value.

Application manifest requirements

To access an ADC controller, your application must identify it in the Adc field of the application manifest.