Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Jul 2007 02:19 PM by  zonque
How to use GPIO0 and GPIO1 on Linux
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
s.bencke@terra.com.br
New Member
New Member
Posts:


--
05 Jul 2007 12:52 PM
    Hi,
    Somebody can help me on how to use GPIO on Linux? I'm using Kernel 2.6.19.2! I want to turn on/off the leds of litekit.
    Thanks
    SB
    zonque
    New Member
    New Member
    Posts:


    --
    05 Jul 2007 02:19 PM
    Posted By sbencke on 5 Jul 2007 0:52 PM
    Hi,
    Somebody can help me on how to use GPIO on Linux? I''m using Kernel 2.6.19.2! I want to turn on/off the leds of litekit.
    Thanks
    SB




    from kernel space, these lines will do it:

    mxc_set_gpio_direction(MX31_PIN_CAPTURE, 0);
    mxc_set_gpio_direction(MX31_PIN_COMPARE, 0);
    mxc_set_gpio_dataout(MX31_PIN_CAPTURE, 0);
    mxc_set_gpio_dataout(MX31_PIN_COMPARE, 0);


    note that the lines are low-active, so the above code will switch both LEDs on.

    To get access from user space, you will need to add your own support for sysfs, procfs or as a misc device.

    Hope that helps!
    Daniel
    You are not authorized to post a reply.