adc driver on i.mx28

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

adc driver on i.mx28

1,578 Views
mehmet
Contributor I

Hi,

I need to read adc value of lradc channel 0. Is there any sample code? Or how can I do it?

 

Thanks

Mehmet

Tags (1)
0 Kudos
5 Replies

795 Views
mehmet
Contributor I

I have i.mx28 evk and use linux. 

 

I checked keyboard driver,

I used below functions for init;

hw_lradc_init_ladder(LRADC_CH1, LRADC_DELAY_TRIGGER_BUTTON, 200);   hw_lradc_set_delay_trigger_kick(LRADC_DELAY_TRIGGER_BUTTON, !0);

 

But I couldn't understand how can I read adc value. In keyboard driver there 2 functions,

raw_button = __raw_readl(devdata->base + HW_LRADC_CHn(devdata->chan)) & BM_LRADC_CHn_VALUE;

 vddio = hw_lradc_vddio();

Which one of them should I use?

 

Thanks.

Mehmet.

 

 

 


0 Kudos

795 Views
daiane_angolini
NXP Employee
NXP Employee
I know there is some ADC code into unit_test. You can take a look if it is enough for you.
0 Kudos

795 Views
AhmetYUCE
Contributor II
"resistor divider" , sorry for mistype
0 Kudos

795 Views
AhmetYUCE
Contributor II
Check out mxs keyboard driver in iMX28 BSP. It uses a resistor driver as button(s).
0 Kudos

795 Views
daiane_angolini
NXP Employee
NXP Employee
Please, tell us which is your board, and which is your OS
0 Kudos