how to know the Interrupt/GPIO number for a specific pin in linux

后端 未结 2 382
时光取名叫无心
时光取名叫无心 2021-01-31 12:08

i\'m doing a project in which i need to handle an interrupt in Linux.

the board i\'m using is an ARM9Board based on the s3c6410 MCU by Samsung (arm 11 processor) and it

相关标签:
2条回答
  • 2021-01-31 12:45

    I was doing some work on the GPIO pin as well but it's on a different board, AM335x. Just to let you know, there's quite few of way to do it. One of the method we are using is using memory board to access (write or read) the GPIO pin.

    This is a really good article to help me to get things working. Register access to the GPIOs of the Beaglebone via memory mapping

    0 讨论(0)
  • 2021-01-31 13:02

    The Embedded Linux you are using should have a GPIO driver that has #define statements for the GPIO pins. You can then get the IRQ number of the specific GPIO using something like:

    irq_num = gpio_to_irq(S3C64XX_GPP(8));

    The Linux GPIO lib support for that particular chip is available in the following file:

    linux/arch/arm/mach-s3c6400/include/mach/gpio.h

    There you will find all the #define statements for the various GPIO.

    See the section on GPIO Conventions in their documentation:

    http://www.kernel.org/doc/Documentation/gpio/gpio.txt

    0 讨论(0)
提交回复
热议问题