GPIO

From Wiki for Dragino Project
Revision as of 08:33, 29 April 2011 by Edwin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Dragino MS12 has five GPIOs pins avaible on the 2x8 connctor for easy use. They are GPIO0~ GPIO4. these GPIOs connects to the Atheros ar2317 directly and can be control via openwrt command gpioctl command.

The input and ouput voltage of these GPIO is 3.3v.

gpio command:

root@dragino:~# gpioctl
gpioctl dirin|dirout|get|set|clear gpio
dirin: configure GPIO pin as input
dirout: configure the GPIO pin as output
get: get the GPIO status: HIGH or LOW
set: set the GPIO to HIGH
clear: set the GPIO to LOW

examples:

Simply connet the GPIO4 and LED pin via a wired. LED1 will be on if there is a LOW singal. you can type:

root@dragino:~# gpioctl dirout 4
using gpio pin 4     ==> this will set the GPIO4 to output and default is LOW. this will turn on LED1
root@dragino:~# gpioctl set 4
using gpio pin 4     ==> set GPIO4 to HIGH and turn off LED1.