This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

read a interupt through gpio pins on beagelbone

i want to connect the one push switch to gpio pins of beaglebone and read its interupt in the user space application? i just got my beaglebone, i never worked on gpio?

pls tell me where should i start ? if possible give me the details of mux settings of gpio pins? and what should i do to do this task?

Thanks

  • Hi pavan,

    Pavan Patil said:
    i want to connect the one push switch to gpio pins of beaglebone and read its interupt in the user space application?

    In this case you have to configure gpio pin as input pin. Assume that one push switch is connected to a gpio pin, say GPIO2[16] (16th pin of GPIO second instance). Now  when the switch is pushed, a signal transition  would happen on the pin. This transition could be a rising edge or a falling edge transition. The transition type generated  should be known before you proceed.

    • Configure the GPIO pin as an input pin.
    • Configure the appropriate trigger type for interrupt generation.
    • Enable interrupts for the pin.

    Refer to the GPIO DAL(drivers/gpio_v2.c) to implement above steps. Also refer to GPIO example application under examples/beaglebone/gpio/gpioLEDblink.c for more information.

    Pavan Patil said:
    if possible give me the details of mux settings of gpio pins?

    Refer to platform/beaglebone/gpio.c in StarterWare02.00.00.06 release package to find the template for performing pin multiplexing of GPIO pins.

    Regards

    Savinay

  • Thanks savinay for reply...

         I configure the GPIO pin 3 (P8 expansion header) using this shell commands

         echo 38 > /sys/class/gpio/export

         echo falling > /sys/class/gpio/gpio38/edge

          i read the value of pin3 its initially high using

         cat  /sys/class/gpio/gpio38/value

            1

         direcation is in

          cat  /sys/class/gpio/gpio38/direcation

           in

        I write one small c program that continuously polling the gpio pin, and configure the GPIO pin 3 (P8 expansion ) for falling edge when transition occur on the gpio its 

        detect on my user space applicationand its successful . But i just read that polling is continuous busy the processor core thats why i think to implement using interupt.

      you said that i have to write driver for read interupt from gpio  am i right?

      if you have any sample driver code of GPIO or any idea how to write please suggest me. Thanks for your time.

      Regards

       Pavan