Wiki source code of Control Gateway GPIOs & LEDs
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
![]() |
12.1 | 5 | = Products LEDs Mapping = |
![]() |
11.1 | 6 | |
7 | {{velocity}} | ||
![]() |
10.1 | 8 | $xwiki.ssfx.use("js/xwiki/table/table.css") |
9 | $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) | ||
10 | {{/velocity}} | ||
![]() |
1.1 | 11 | |
![]() |
16.2 | 12 | (% class="doOddEven filterable grid sortable" id="tableid" style="height:25px; width:1152px" %) |
13 | (% class="sortHeader" %)|=(% style="width: 69px;" %)Model|=(% style="width: 107px;" %)Global LED|=(% style="width: 93px;" %)PWR LED|=(% style="width: 95px;" %)LAN LED|=(% style="width: 119px;" %)WAN LED|=(% style="width: 111px;" %)WIFI LED|=SENSOR LED|=(% style="width: 205px;" %)4G control (Second +3.3v)|=(% style="width: 200px;" %)USB POWER(+5v) Control | ||
![]() |
15.5 | 14 | |(% style="width:69px" %)LPS8|(% style="width:107px" %)((( |
![]() |
14.2 | 15 | GPIO28(BLUE), |
![]() |
1.1 | 16 | |
![]() |
14.2 | 17 | GPIO21(RED), |
18 | |||
![]() |
15.2 | 19 | GPIO22(GREEN(% style="background-color:transparent" %)) |
![]() |
15.5 | 20 | )))|(% style="width:93px" %)((( |
![]() |
14.2 | 21 | |
22 | |||
23 | +3.3v | ||
![]() |
16.2 | 24 | )))|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %) | |(% style="width:205px" %) |(% style="width:200px" %) |
![]() |
15.5 | 25 | |(% style="width:69px" %)LPS8N|(% style="width:107px" %)((( |
![]() |
14.2 | 26 | GPIO28(BLUE), |
27 | |||
28 | GPIO21(RED), | ||
29 | |||
![]() |
15.2 | 30 | GPIO22(GREEN(% style="background-color:transparent" %)) |
![]() |
15.5 | 31 | )))|(% style="width:93px" %)((( |
![]() |
14.2 | 32 | |
33 | |||
34 | +3.3v | ||
![]() |
15.5 | 35 | )))|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)((( |
![]() |
14.2 | 36 | GPIO16(BLUE), |
37 | |||
38 | GPIO26(RED), | ||
39 | |||
![]() |
15.2 | 40 | GPIO27(GREEN(% style="background-color:transparent" %)) |
![]() |
15.5 | 41 | )))| |(% style="width:205px" %)((( |
![]() |
15.2 | 42 | |
![]() |
14.2 | 43 | |
![]() |
15.2 | 44 | GPIO15 |
![]() |
16.2 | 45 | )))|(% style="width:200px" %) |
46 | |(% style="width:69px" %)LG308|(% style="width:107px" %)GPIO28(RED)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(RED) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)GPIO0(RED)| |(% style="width:205px" %)GPIO15 |(% style="width:200px" %)GPIO1 | ||
47 | |(% style="width:69px" %)DLOS8|(% style="width:107px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)| |(% style="width:205px" %)GPIO15 |(% style="width:200px" %)GPIO1 | ||
![]() |
15.5 | 48 | |(% style="width:69px" %)HP0C|(% style="width:107px" %)((( |
![]() |
15.2 | 49 | PA8(GREEN), |
![]() |
14.2 | 50 | |
![]() |
15.2 | 51 | PA9(RED(% style="background-color:transparent" %)) |
![]() |
15.5 | 52 | )))|(% style="width:93px" %)+3.3v|(% style="width:95px" %)((( |
![]() |
15.2 | 53 | EPHY-LINK-LED(GREEN), |
![]() |
14.2 | 54 | |
![]() |
15.2 | 55 | PA17(BLUE) |
![]() |
15.3 | 56 | )))|(% style="width:119px" %) |(% style="width:111px" %)((( |
![]() |
15.2 | 57 | |
![]() |
14.2 | 58 | |
![]() |
15.2 | 59 | PA7(RED(% style="background-color:transparent" %)) |
![]() |
16.2 | 60 | )))| |(% style="width:205px" %) |(% style="width:200px" %) |
61 | |(% style="width:69px" %)HP0A|(% style="width:107px" %)PA8(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)EPHY-LINK-LED|(% style="width:119px" %)PA9(RED)|(% style="width:111px" %)PA7(RED)| |(% style="width:205px" %)PA17|(% style="width:200px" %) | ||
62 | |(% style="width:69px" %)IBB|(% style="width:107px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:205px" %) |(% style="width:200px" %)GPIO1 | ||
63 | |(% style="width:69px" %)LIG16|(% style="width:107px" %)GPIO28(RED)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO22(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|GPIO21(GREEN)|(% style="width:205px" %) |(% style="width:200px" %) | ||
64 | |(% style="width:69px" %)MS14N|(% style="width:107px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:205px" %) |(% style="width:200px" %)GPIO1 | ||
![]() |
15.2 | 65 | |
![]() |
1.2 | 66 | = Control LEDs & GPIOs = |
![]() |
1.1 | 67 | |
![]() |
1.2 | 68 | == OpenWrt Base OS == |
![]() |
1.1 | 69 | |
![]() |
6.1 | 70 | (% class="box infomessage" id="HControlanGeneralGPIO:" %) |
71 | ((( | ||
![]() |
8.1 | 72 | **Control a General GPIO:** |
![]() |
1.1 | 73 | |
![]() |
1.2 | 74 | **echo 18 > /sys/class/gpio/export** ~/~/ Export gpio 18 so we can use it |
75 | **echo "high" > /sys/class/gpio/gpio18/direction** ~/~/ Set direction to out and | ||
76 | set level to high. Use "low" to set direction to output and level to low | ||
77 | |||
78 | **echo 0 > /sys/class/gpio/gpio18/value** ~/~/ Set output to 0 or 1 | ||
79 | **echo "in" > /sys/class/gpio/gpio18/direction** ~/~/ Set GPIO18 as input | ||
80 | |||
81 | **cat /sys/class/gpio/gpio18/value** ~/~/ Get GPIO18 value if set input | ||
82 | ))) | ||
83 | |||
![]() |
9.1 | 84 | (% class="box infomessage" %) |
85 | ((( | ||
86 | **Control a GPIO already exported as SYSTEM LEDs .** | ||
87 | **echo 1 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn On LED dragino2:red:system | ||
88 | **echo 0 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn off LED dragino2:red:system | ||
89 | ))) | ||
90 | |||
91 | |||
![]() |
3.1 | 92 | Reference: [[http:~~/~~/www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs>>url:http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs]] |