IRQ iMX233

Started by cbur, November 01, 2014, 09:07:50 AM

Previous topic - Next topic

cbur

I am very new to programming in Linux, I come from a microcontroller background. I am designing a project where I need to read ADC on an interrupt from my external hardware. I really want to write the software in Python. Does anyone have any experience with interrupts on the iMX233 who can tell me how to achieve this?


JohnS

The idea is you write a driver to do it.

Did you check if one already exists?  Or if not then for something similar?

John

lambda

The ADC driver for iMX233 is part of the iio subsystem. (The kernel module is called mxs-lradc)

You are lucky, the iio subsystem already supports various kinds of triggers including a
GPIO trigger. (Don't remember the name of the kernel module right now - maybe iio-trig-interrupt.)

I think all you need to do is make sure the necessary modules are loaded, configure the trigger
in sysfs, open the device file from your python program and wait for data. I'm not sure if there
is a python module available for parsing iio events - would be a nice contribution though ...

I haven't used triggers myself yet, so some details above might be wrong.

Some basic introduction about iio is available at:
http://wiki.analog.com/software/linux/docs/iio/iio

HTH,
Harald