2012年9月7日 星期五

How to control GPIO pin by sysfs ?

http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#Interfaces_explained

for examples:
1. set GPIO27 direction to "output" and set value to "high"
# echo "high" > /sys/devices/virtual/gpio/gpio27/direction
# cat /sys/devices/virtual/gpio/gpio27/direction
out

# cat /sys/devices/virtual/gpio/gpio27/value
1

# echo 0 > /sys/devices/virtual/gpio/gpio27/value
# cat /sys/devices/virtual/gpio/gpio27/value
0

2. set GPIO27 to input
# echo "in" > /sys/devices/virtual/gpio/gpio27/direction
# cat /sys/devices/virtual/gpio/gpio27/direction
in

2012年9月6日 星期四

有關 Android 的文章

1. 和 Linux Kernel 有關的
http://anemospring.blogspot.tw/#!/2011/04/android-kernel.html



關於 Linux shell 的介紹

1. http://www.study-area.org/linux/system/linux_shell.htm

2. 在當前目錄下針對 .c 檔搜尋特定字串
# find ./ -name "*.c" | xargs grep "string you want to find"

Build TI's WLAN driver

How do I build TI's wl127x/wl128x device drivers for OMAP4470 Blaze platform ?

1. Build MCP driver
      // find out the driver folder
# cd ~/mydroid/hardware/ti/wlan/wl1271   

// edit the wl_env.sh  
#export PATH=<PATH TO CROSS COMPILER>:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-
export ARCH=arm
export HOST_PLATFORM=sholes
export KERNEL_DIR=/home/my-plat/omap4470/blaze/4AI.1.4-built/kernel/android-3.0

// setup environment
# source wl_env.sh                                       
# make
 
2. Install MCP and verify driver

# insmod /system/lib/modules/tiwlan_drv.ko
# wlan_loader -i tiwlan0.ini -f firmware.bin -e nvs_map.bin
# wlan_cu –itiwlan0 –b     // run wlan_cu and bypass wpa_supplicant