![background image](http://html1.mh-extra.com/html/ibase-technology/ibr215/ibr215_user-manual_3247230047.webp)
IBR215 User Manual
42
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 IBR215
Page 10: ...General Information IBR215 User Manual 5 1 1 5 Product View...
Page 11: ...General Information IBR215 User Manual 6 1 1 6 Dimensions IBR215 Unit mm IBR215 IO...
Page 15: ...General Information IBR215 User Manual 10 1 2 3 Connectors on the IBR215 Main Board...
Page 25: ...General Information IBR215 User Manual 20 1 2 5 Connector Locations on the IBR215 IO Board...
Page 46: ...41 Appendix This section provides the information of reference code...
Page 58: ...IBR215 User Manual 53...