A20 GPIO map

Started by Ruler, June 21, 2013, 04:16:56 PM

Previous topic - Next topic

pete_l

Quote from: Mouchon on October 17, 2013, 09:34:37 AMi agree that it will be more simpler to have ioctl on it to give callback function. But this is not the case.
I don't think there is really any good way to do this on Linux/Unix based systems.
At least with a poll() or select() the caller is in control of when the service handler is run. With a callbeck there is the added complication of contact bounce on mechanical switches, which could result in the callback function being called several times (once for each time the contacts open and close) over a few milliseconds. That would mean having to write debounce code into your function, which is added complexity.

What we really need is a high-level library that removes the need to have to program down at the pin level. I guess it'll come, given time.

sanzoghenzo

hi all, back to olinuxino since I have some spare time... Is there any news on the irq-gpio stuff? do you find some good workaround for reading key presses?

I think I'll have to move to raspberry pi to make my arcade cabinet controller/system... too bad, the A20 hardware is much better, but without software/drivers to drive it is pretty useless... :S

jurij

I'm working on A10(LIME), but it's more or less the same.
First, you may use only gpio with irq support - look at gpio description.

# ls /sys/class/gpio/gpio65_pi10/
active_low  device  direction  edge  power  subsystem  uevent  value

edge option tell you - gpio is irq ready

# echo falling > /sys/class/gpio/gpio65_pi10/edge

echo put gpio in irq mod

# cat /proc/interrupts
           CPU0       
  0:          0    sw_vic  axp_mfd
  1:        331    sw_vic  serial
.......
117:          0  gpio-sunxi  gpiolib
Err:          0


117 is your gpio interup number


For more information look at:
https://lkml.org/lkml/2012/4/10/118
and: https://developer.ridgerun.com/wiki/index.php/Gpio-int-test.c