
Vantron
| Embedded in your success, Embedded in your better life
World-leading provider of embedded/IoT products and solutions
VT-SBC-3568 | User Manual 35
UP RUNNING NOARP MTU:16 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:44 (44.0 B) TX bytes:20 (20.0 B)
Interrupt:32
can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-
00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:44 (44.0 B) TX bytes:24 (24.0 B)
Interrupt:33
3.6.3
GPIO
1.
Write a GPIO pin number to “/sys/class/gpio/export” to export the pin, for instance
pin value = 20:
~# echo 20 > /sys/class/gpio/export
2.
Set the pin direction as input or output (in for input and out for output);
~# echo out > /sys/class/gpio/gpio20/direction
3.
If you configured an output pin in the prior step, now you can set its value to 0 or 1
(corresponding to low or high) as follows:
~# echo 0 > /sys/class/gpio/gpio20/value [set it low], or
~# echo 1 > /sys/class/gpio/gpio20/value [set it high]
4.
Read the GPIO value;
~# cat /sys/class/gpio/gpio20/value
5.
When you finish using the pin, just unexport it. To do this, write the pin number to the
unexport file:
~# echo 20 > /sys/class/gpio/unexport