/sys/class/gpio => Content (B-PI / Android 4.2)
Hello there,
i have a B-Pi with Android 4.2 and i´m exploring the filesystem in sys/class/gpio, because i´m interessted in using IOs I´m new to linux - i read that everything is represented as files. I have installed a programm where i can see and open files and wondering, what the directorys and files are meaning which i see. in "sys/class/gpio" there are directorys named gpiochip0 gpiochip24 gpiochip54 gpiochip85 gpiochip119 gpiochip137 gpiochip149 gpiochip167 gpiochip201 gpiochip229 => what do they mean? Do thier naming have a specific relation to the B-PI´s A20´pins? I can´t match them with the GPIO table from the WIKI / do the numbers have a meaning? http://wiki.lemaker.org/File""IN_CONNECTOR.jpg If i go into one of the folders, i see power (folder) subsystem (folder) base (file) label (file) ngpio (file) uevent (file) => here also - what do this mean? in power folder there is a file "async" where is just written "disabled", while in folder subsystem the directorys are repeating in a loop And what is this thing with the "export" and "unexport" files in the gpio folder. I have seen a tutorial on youtube, where these files are used, but i don´t understand thier purpose. best regards, Jasson |
Quote:
You won't find network devices, e.g. eth0, in /dev. Quote:
Regards |
Ah ok, this clears things up.
I´m still wondering, what the trailing numbers to "gpiochip" are meaning. Do they refer to the ports of the A20 like PoartA, PortB etc? For example if i want to turn on PB21 http://wiki.lemaker.org/BananaPro/Pi...ON3_definition whats the puzzle information i need to identify which "gpiochip(N)" i have to use? best regards! |
Quote:
Code:
104 /sys/class/gpio/gpiochipN/ Quote:
The "N" (what you call a "trailing number") is for a (base) Linux GPIO number. Normally there's a one-to-one mapping of gpiochipN directories with pin-control (or PIO) control blocks. Each control block is capable of configuring and controlling a group of pins. But what you have listed for your A20 doesn't match up well with what's in the A20 datasheet and user manual. Code:
1.19.1. Port Description You need to obtain the "base" and "ngpio" for each gpiochipN, and try to determine the mapping. On Atmel SoCs it's easy to map each gpiochipN to its PIO device because the register block address is given in its "label": Code:
# cat /sys/class/gpio/gpiochip32/label You have to determine the same for your Allwinner SoC. You have an SoC GPIO identified by PIO port letter (i.e. PB) and number (i.e. 21). You have to convert the port letter (PB) to its gpiochipN, and then verify that the PIO number (21) is within the "ngpio" range. The Linux GPIO number to use (for export) is then "base" plus the PIO number. Regards |
Yes, you´re right. I "over-read" a few things the first time. That´s what happens, when you´re doing stuff between 8pm and evening ;>
|
All times are GMT -5. The time now is 03:04 PM. |