Hello, I am using the config tools and SDK to set up an ADC instance, the tools has a pop out window that says "software triggers are available" just wondering if anyone can point me towards a worked example please, I want to call a sample from within a loop.
Solved! Go to Solution.
I have figured this out, for reference should anyone else need this:-
uint32_t read_adc()
{
lpadc_conv_result_t config;
LPADC_DoSoftwareTrigger(ADC0, 1); //trigger ADC read
while (!LPADC_GetConvResult(ADC0, &config, 0U)){}; //wait for result
return (uint32_t) config.convValue; //return data
}
I have figured this out, for reference should anyone else need this:-
uint32_t read_adc()
{
lpadc_conv_result_t config;
LPADC_DoSoftwareTrigger(ADC0, 1); //trigger ADC read
while (!LPADC_GetConvResult(ADC0, &config, 0U)){}; //wait for result
return (uint32_t) config.convValue; //return data
}