Vantron
| Embedded in your success, Embedded in your better life
World-leading provider of embedded/IoT products and solutions
VT-SBC-RK3568-NT | User Manual 21
3.1.2
CAN
VT-SBC-RK3568-NT offers two CAN buses (CAN0 & CAN1).
Run the following commands to configure the CAN buses:
# ip link set can0 up type can bitrate 125000
IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
# ip link set can1 up type can bitrate 125000
IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
#ifconfig
can0 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: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.1.3
GPIO
1.
Check the GPIO directory:
~# cd /sys/class/gpio ls
2.
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
3.
Set the pin direction as input or output (in for input and out for output);
~# echo out > /sys/class/gpio/gpio20/direction
4.
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]