Moxa UC-8481-LX [57/90] Buzzer

Moxa UC-8410-LX [57/90] Buzzer
UC-8410/8416/8418/8430 Programmer's Guide
5-5
Buzzer
The device node is located at /dev/console. The UC-8410/8416/8418/8430/8430 supports Linux standard
buzzer control, with the UC-8410/8416/8418/8430’s buzzer running at a fixed frequency of 100 Hz. You must
include <sys/kd.h>.
1. Function: KDMKTONE
ioctl(fd, KDMKTONE, unsigned int arg);
Description: The buzzer’s behavior is determined by the argument arg. The “high word” part of arg gives
the length of time the buzzer will sound, and the “low word” part gives the frequency.
The buzzer’s on/off behavior is controlled by software. If you call the “ioctl” function, you MUST set the
frequency to 100 Hz. If you use a different frequency, the system could crash.
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 enabled when the system boots up. The kernel will auto ack it. 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 use
include <moxadevic.h
>
, and link libmoxalib.a. A makefile example
is shown below:
all:
xscale-linux-gcc –o xxxx xxxx.c -lmoxalib
int swtd_open(void)
Description
If you would like to activate Watchdog for the AP, you must call this function.
Input
None
Output
The return value is file handle. If there is an error, it will return a negative value.
You can get the error using the function errno().
int swtd_enable(int fd, unsigned long time)
Description
Enable the application sWatchDog. You must do an ack after this process.
Input
int fd - the file handle, from the swtd_open() return value.

Содержание

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

Скачать