lpc55s69 ADC software trigger

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

lpc55s69 ADC software trigger

ソリューションへジャンプ
1,002件の閲覧回数
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. 

ラベル(2)
0 件の賞賛
返信
1 解決策
997件の閲覧回数
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 件の賞賛
返信
1 返信
998件の閲覧回数
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 件の賞賛
返信