本测试使用官方开发板,板上有八个led供使用,
测试使用了GPD6这个io口,用排线把这个口连接到其中一个led
命令如下:
/mnt/nand1-1 # cd /sys/class/gpio/
/sys/class/gpio # ls
export gpiochip0 unexport
/sys/class/gpio # echo 102 > export //102是怎么对应到GPD6的,请看下面的表格
/sys/class/gpio # ls
export gpio102 gpiochip0 unexport
/sys/class/gpio # cd gpio102/
/sys/class/gpio/gpio102 # ls
active_low direction subsystem value
device edge uevent
/sys/class/gpio/gpio102 # echo out > direction
/sys/class/gpio/gpio102 # echo 0 > value //led on
/sys/class/gpio/gpio102 # echo 1 > value //lede off
1.
* Note :
* PORT NAME[PIN] = GPIO [id]
*
* PORTA[ 0] = gpio[ 0x00]
* PORTA[ 1] = gpio[ 0x01]
* :
* PORTA[31] = gpio[ 0x1F]
* PORTB[ 0] = gpio[ 0x20]
* :
* PORTB[31] = gpio[ 0x3F]
* :
* PORTC[ 0] = gpio[ 0x40]
* :
* PORTD[ 0] = gpio[ 0x60]
* :
* PORTE[ 0] = gpio[ 0x80]
* ://注意:没有PORTF
* PORTG[ 0] = gpio[ 0xA0]
* :
* PORTH[ 0] = gpio[ 0xC0]
* :
* :
* PORTH[31] = gpio[ 0xDF]
102==0x66,这个就是GPD6
|