Hi,
after plaing with A13-OLinuXino-MICRO, I made this table for GPIO programming via
sysfs (without
SUN4I_GPIO_UGLY enabled).
Index | Name | PIN# | GPIO2 |
1 | pb3 | 7 | 11 |
2 | pb4 | 8 | 13 |
3 | pb10 | 9 | 15 |
4 | pe4 | 29 | 26 |
5 | pe5 | 30 | 24 |
6 | pe6 | 31 | 22 |
7 | pe7 | 32 | 20 |
8 | pe8 | 33 | 18 |
9 | pe9 | 34 | 16 |
10 | pe10 | 35 | 14 |
11 | pe11 | 36 | 12 |
12 | pg9 | 37 | 10 |
13 | pg10 | 38 | 8 |
14 | pg11 | 39 | 6 |
Index is the number that you must write to
export file to bring up the GPIO directory. Name and PIN# are name and pin number (used elsewhere), GPIO2 is the number of pin in the GPIO2 connector. To bring up all GPIOs, become root, change into
/sys/class/gpio and use this shell line:
for i in `seq 1 14` ; do echo $i > export ; doneNote: This will probably cause the green LED to shine dimly, because the LED is connected to
gpio12_pg9 and the GPIOs are set as inputs by default.
Only the first and last three (
pg* and
pg*) support edge triggering. And the last three are used for other things (the green LED and such, see https://www.olimex.com/wiki/A13-OLinuXino (https://www.olimex.com/wiki/A13-OLinuXino)).
Other usefull pin on the GPIO2 connector are the pins 2 and 4 -
GND, the pin 3 -
3.3V (GPIOs are not 5V tolerant!) and the pin 9 -
PIN6/pb2/PWM0, controlled by
/sys/class/pwm-sunxi/pwm0.
I hope that this will be usefull to someone.