I am new to linux & working on a project which includes some gpios are connected to my calixto board based on which i am performing action which i am getting from sys/class/gpio*/value & put in a while loop but it consumes much resources so i want to make it event based i.e how to get event from /dev/input/event* file & what are the configurations needed to be done in kernel during creating uImage thanks in advance.
-
You might explain why you want to go event based and what do you think it is. Not sure if your hardware (unmentioned) maps the IO to those Human Input Device events, if yes at the end of the link you find some hints: kernel.org/doc/Documentation/input/input.txteckes– eckes2014-02-20 06:57:45 +00:00Commented Feb 20, 2014 at 6:57
2 Answers
Events are created by input devices, not by GPIOs directly. (Keep in mind that other sources of events can include things like mice, keyboards, touchscreens, and joysticks.) The easiest way of creating an input device from GPIOs will be to declare a gpio_keys platform device, either by adding one to your device tree (if you're using one), or by editing your board configuration file (if not). Details will depend heavily on the exact platform you're working with.
There's a brief walk-through on the Amadeus web site — it's for different hardware than what you're working with, but the principles will be similar.
2 Comments
If you mean using Asyc Access I think the following is a good start:
https://developer.ridgerun.com/wiki/index.php/How_to_use_GPIO_signals