![Fortec Star iBASE IBR210 Manual Download Page 43](http://html1.mh-extra.com/html/fortec-star/ibase-ibr210/ibase-ibr210_manual_2321414043.webp)
Appendix
IBR210 User’s Manual
33
A.
How to Use GPIO in Linux
# GPIO Value Rule : gpioX_N >> 32*(X-1)+N
# Take gpio5_18 as example, export value should be 32*(5-1)+18=146
# GPIO example 1: Output
echo 32 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio146/direction
echo 0 > /sys/class/gpio/gpio146/value
echo 1 > /sys/class/gpio/gpio146/value
# GPIO example 2: Input
echo 32 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio146/direction
cat /sys/class/gpio/gpio146/value
B.
How to Use Watchdog in Linux
// create fd
int fd;
//open watchdog device
fd = open("/dev/watchdog", O_WRONLY);
//get watchdog support
ioctl(fd, WDIOC_GETSUPPORT, &ident);
//get watchdog status
ioctl(fd, WDIOC_GETSTATUS, &status);
//get watchdog timeout
ioctl(fd, WDIOC_GETTIMEOUT, &timeout_val);
//set watchdog timeout
ioctl(fd, WDIOC_SETTIMEOUT, &timeout_val);
//feed dog
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
Summary of Contents for iBASE IBR210
Page 1: ......
Page 10: ...viii IBR210 User s Manual This page is intentionally left blank...
Page 17: ...General Information IBR210 User s Manual 7 1 1 6 Dimensions Unit mm...
Page 18: ...8 IBR210 User s Manual IBR210 Reference Heat Sink...
Page 22: ...12 IBR210 User s Manual 2 3 Jumper Connector Locations on IBR210 Board diagram of IBR210...
Page 36: ...26 IBR210 User s Manual This page was intentionally left blank...
Page 42: ...32 Appendix This section provides the information of reference code...