Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: morind79 on October 12, 2013, 04:20:21 PM

Title: GPIO in C
Post by: morind79 on October 12, 2013, 04:20:21 PM
Hi,

I would like to make a library to control A20 board GPIO on Debian (Like wiringPi).
Do you have an example of C program to control GPIO ?

Thank you

Best regards
Denis
Title: Re: GPIO in C
Post by: XFer on October 13, 2013, 12:22:30 AM
That would be Absolutely Great!!  :D :D :D :D :D :D :D :D :D :D

Unfortunately I don't know of a C example which actually works for A20 GPIOs.

You may have a look at the GPIO kernel driver:

https://github.com/linux-sunxi/linux-sunxi/blob/stage/sunxi-3.4/drivers/gpio/gpio-sunxi.c

and at this thread (it's about Cubieboard, but it uses an Allwinner too):

http://www.cubieforums.com/index.php/topic,253.30.html

Fernando
Title: Re: GPIO in C
Post by: Mouchon on October 13, 2013, 10:39:43 AM
Hi,

The https://pypi.python.org/pypi/pyA20/0.1.6 python contain c library to access gpio in user space
you can use it for your own usage. This is what i did.

Kr

Philippe