1.2.2.25 1.9.1.25 1.14.1.9 1.15.1.9 1.16.1.9 1.17.1.9 1.18.1.9 1.19.1.9 1.20.1.9 1.21.1.9 ADC_ResultGet Function

C

uint32_t ADC_ResultGet(ADC_RESULT_BUFFER bufferNumber)
uint32_t ADC_ResultGet( ADC_CORE_NUM core, ADC_CHANNEL_NUM channel)

Summary

Returns the ADC conversion value.

Description

Returns ADC module conversion result based on the buffer index. Returns the ADC conversion value for the specified ADC core channel.

Precondition

ADC_Initialize() must have been called.

Parameters

Param Description
bufferNumber Selects the buffer to be read.
core ADC core n
channel ADC channel k

Returns

uint32_t - ADC result value

Example

uint32_t my_res;
my_res = ADC_ResultGet(ADC_RESULT_BUFFER_0);
uint32_t adc_result;

if (ADC_ChannelResultIsReady(ADC_CORE_NUM1, ADC_CH0))
{
    // ADC conversion is complete. Read the conversion result.
    
    adc_result = ADC_ResultGet(ADC_CORE_NUM1, ADC_CH0);
}

Remarks

None.