38
IBR210 User’s Manual
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);
Содержание IBR210
Страница 1: ...IBR210 3 5 ARM based SBC With NXP Cortex A53 Quad i MX8M User s Manual Version 0 3 May 2020...
Страница 8: ...viii IBR210 User s Manual This page is intentionally left blank...
Страница 15: ...General Information IBR210 User s Manual 7 1 1 6 Dimensions Unit mm...
Страница 16: ...8 IBR210 User s Manual IBR210 Reference Heat Sink...
Страница 20: ...12 IBR210 User s Manual 2 3 Jumper Connector Locations on IBR210...
Страница 36: ...28 IBR210 User s Manual This page was intentionally left blank...
Страница 45: ...37 Appendix This section provides reference code information...