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