lpc55s69 ADC software trigger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpc55s69 ADC software trigger

Jump to solution
613 Views
sanders7284
Contributor III

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. 

Labels (2)
0 Kudos
Reply
1 Solution
608 Views
sanders7284
Contributor III

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
}

 

View solution in original post

0 Kudos
Reply
1 Reply
609 Views
sanders7284
Contributor III

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
}

 

0 Kudos
Reply