GPIO/zh

From FriendlyELEC WiKi
Revision as of 03:30, 20 March 2019 by Tzs (Talk | contribs) (updated by API)

Jump to: navigation, search

English

S5P4418/S5P6818下计算Linux gpio索引号的方法

看管脚定义,共有GPIOA ~ GPIOD 4 组,
用以下命令看GPIO针脚

#/bin/sh
cd /sys/class/gpio
for i in gpiochip* ; do echo `cat $i/label`: `cat $i/base` ; done

在T2上输出

nxp-gpio.0: 0
nxp-gpio.4: 128
nxp-gpio.5: 160
nxp-gpio.1: 32
nxp-gpio.2: 64
nxp-gpio.3: 96

每一个label表示一组,上面是显示6组,
那么,对应的就是

nxp-gpio.0: 0         -> GPIOA
nxp-gpio.4: 128         -> GPIOE  ->AliveGPIO3
nxp-gpio.5: 160         -> GPIOF  ->AliveGPIO5
nxp-gpio.1: 32         -> GPIOB
nxp-gpio.2: 64         -> GPIOC
nxp-gpio.3: 96         -> GPIOD

每一组之间差32,是通过cat gpiochip0/ngpio查看的