Moxa UC-7110-LX [37/46] Wdt watch dog timer

Moxa UC-7110-LX [37/46] Wdt watch dog timer
UC-7101/7110/7112 Software User’s Manual UC-7101/7110/7112 Device API
5-3
WDT (Watch Dog Timer)
1. Introduction
The WDT works like a watch dog function. You can enable it or disable it. When the user enables
WDT but the application does not acknowledge it, the system will reboot. You can set the ack time
from a minimum of 50 msec to a maximum of 60 seconds.
2. How the WDT works
The sWatchDog is disabled when the system boots up. The user application can also enable ack.
When the user does not ack, it will let the system reboot.
Kernel boot
…..
….
User application running and enable user ack
….
….
3. The user API
The user application must include <moxadevic.h>, and link moxalib.a. A makefile example is
shown below:
all:
arm-elf-gcc Wl, -elf2flt o xxxx xxxx.c -lmoxalib
int swtd_open (void)
Description
Open the file handle to control the sWatchDog. If you want to do something you must first do this
and keep the file handle for other uses.
Input
None
Output
The return value is the file handle. If there is an error, it will return a negative value.
Use errno() to retrieve errors.
int swtd_enable (int fd, unsigned long time)
Description
Enable application sWatchDog. You must do an ack after this process.
Input
int fdthe file handle, from the swtd_open() return value.
unsigned long timeThe time you wish to ack sWatchDog periodically. You must ack the
sWatchDog before timeout. If you do not ack, the system will be reboot
automatically. The minimum time is 50 msec, the maximum time is 60
seconds. The time unit is msec.

Содержание

Похожие устройства

Скачать