32
A.
How to Use GPIO in Linux
# Take gpio1_0 as example, export value:1*32+0=32
# GPIO example 1: Output
echo 32 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio40/direction
echo 0 > /sys/class/gpio/gpio40/value
echo 1 > /sys/class/gpio/gpio40/value
# GPIO example 2: Input
echo 32 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio40/direction
cat /sys/class/gpio/gpio40/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 YMBAO100
Page 7: ...viii This page is intentionally left blank...
Page 14: ...General Information 7 1 1 7 Dimensions Unit mm...
Page 15: ...8 YMBAO100 Reference Heat Sink...
Page 19: ...12 2 3 Jumper Connector Locations on YMBAO100 Board diagram of YMBAO100...
Page 38: ...31 Appendix This section provides the information of reference code...