Chinaunix首页 | 论坛 | 博客
  • 博客访问: 551023
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: LINUX

2012-03-07 16:35:44

All content please reference 

Below is the running print from my deivce

~ >: dmesg | head -n 4 
[    0.000000] Linux version 3.0.0 (wenjing@centos6.localdomain) (gcc version 4.3.5 (Buildroot 2011.02) ) SVN318 Wed Feb 22 14:22:01 CST 2012
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Atmel AT91SAM9260-EK
~ >: 
~ >: uname -a
Linux Atmel 3.0.0 SVN318 Wed Feb 22 14:22:01 CST 2012 armv5tejl unknown
~ >: 
~ >: df -h     
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 9.7M      4.8M      4.9M  49% /
~ >: 
~ >: mount -t debugfs none /sys/kernel/debug
~ >:
~ >: mount
~ >:
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime,errors=continue)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
ramfs on /tmp type ramfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /sys/kernel/debug type debugfs (rw,relatime)
~ >: 
~ >: cat /sys/kernel/debug/gpio
GPIOs 32-63, A:
[sda] GPIOA23: [gpio] set
[scl] GPIOA24: [gpio] set

GPIOs 64-95, B:

GPIOs 96-127, C:
~ >:
~ >: cat /proc/filesystems 
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   rpc_pipefs
nodev   devpts
        ext2
nodev   ramfs
        vfat
        msdos
nodev   nfs
nodev   jffs2
nodev   mtd_inodefs
nodev   ubifs
~ >: 

# 32-127 //All pin maps
# 32-63  //should be from PA0-PA31
# 64-95  //should be from PB0-PB31
# 96-127 //should be from PC0-PC31
# So here gpio94 will operate PB30, which connect with one of LED, low voltage will power on Led

~ >: cd /sys/class/gpio/
/sys/class/gpio >: echo 94 > export 
/sys/class/gpio >: cd gpio94/
/sys/devices/virtual/gpio/gpio94 >: 
/sys/devices/virtual/gpio/gpio94 >: 
/sys/devices/virtual/gpio/gpio94 >: cat value 
1
/sys/devices/virtual/gpio/gpio94 >: cat direction 
in
/sys/devices/virtual/gpio/gpio94 >: echo "high" > direction 
/sys/devices/virtual/gpio/gpio94 >: cat direction 
out
/sys/devices/virtual/gpio/gpio94 >: echo 0 > value 
/sys/devices/virtual/gpio/gpio94 >: cat value 
0
/sys/devices/virtual/gpio/gpio94 >: 

~ >: 
~ >: cat /sys/kernel/debug/gpio
GPIOs 32-63, A:
[sda] GPIOA23: [gpio] set
[scl] GPIOA24: [gpio] set

GPIOs 64-95, B:
[sysfs] GPIOB30: [gpio] clear

GPIOs 96-127, C:
~ >:
阅读(871) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

k_ewell2012-03-07 17:04:47

Possible commands for direction:
high  Set GPIO to an output with a starting value of 1
low   Set GPIO to an output with a starting value of 0
out   Same as low
in    Set GPIO to an input