Handling GPIO Interrupts

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

Handling GPIO Interrupts

1,450 Views
tinganho
Contributor I

Hi, my name is Tingan and I'm a software engineer that just became a hardware engineer. So I'm rather a beginner in hardware and I'm almost finished with the schematics of my first i.MX6 based board. I'm following the HW Design Guideline for my i.MX6 CPU. And I'm right now implementing the schematics for the Ethernet PHY LAN8720 device. LAN8720 device has an interrupt pin. I know that interrupts, interrupts the CPU and points it to execute something else. But I can't find specifics! about how to implement GPIO interrupts. Like what code needs to be implemented to enable this interrupt pin? I have searched the whole Internet and looked at all StackOverflow answers and downloaded nearly all Freescale's documents(including Linux Reference Manual) related to this and I find nothing specifics about how to handle GPIO interrupts. I have searched for 5 days and found nothing specific about this topic or nothing that could help me, so I'm quite desperate for a detailed answer.

So far my hunch tells me that I should write some code in the Linux Kernel and then build the kernel image and then boot it up with uboot. But what kind of code should I write? Can someone explain this to a beginner HW Enginner, especially write a very detailed answer with code examples, and using the LAN8720's interrupts as an example? And also if I write code on the Linux Kernel where do I get an i.MX6 supported kernel? LTIB? Do I need use or write a device tree to boot?

Labels (1)
0 Kudos
1 Reply

483 Views
igorpadykov
NXP Employee
NXP Employee

Hi Tingan

in general linux is quite complicated os,

I would suggest to look at below links with some simple gpio usage descriptions

Working with GPIO on the Wandboard and Writing an Android Driver for GPIO Interrupts | Using Android...

handling TS interrupts

http://www.imx6rex.com/software/imx6-rex-basic-hw-verification-tests/  

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-August/113944.html

i.MX6 BSPs:

Board Support Packages (27)

http://www.freescale.com/products/arm-processors/i.mx-applications-processors-based-on-arm-cores/i.m...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos