User`s manual

UC-7400-LX Plus User’s Manual Programmer’s Guide
5-5
RTC (Real-time Clock)
The device node is located at /dev/rtc. The UC-7400-LX Plus supports Linux standard simple
RTC control. You must include <linux/rtc.h>.
1. Function: RTC_RD_TIME
int ioctl(fd, RTC_RD_TIME, struct rtc_time *time);
Description: read time information from RTC. It will return the value on argument 3.
2. Function: RTC_SET_TIME
int ioctl(fd, RTC_SET_TIME, struct rtc_time *time);
Description: set RTC time. Argument 3 will be passed to RTC.
Buzzer
The device node is located at /dev/console. The UC-7400-LX Plus supports Linux standard buzzer
control, with the UC-7400-LX Pluss buzzer running at a fixed frequency of 100 Hz. You must use
include <sys/kd.h>.
Function: KDMKTONE
ioctl(fd, KDMKTONE, unsigned int arg);
Description: The buzzers 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 buzzers on/off behavior is controlled by software. If you call the “ioctl” function, you
MUST set the frequency at 100 Hz. If you use a different frequency, the system could crash.
WDT (Watch dog Timer)
1. Introduction
The WDT works like a watchdog to monitor system by protecting the system against
unexpected errors.
2. How does the WDT work?
WDT has two modes: kernel mode and user mode. When the system boots up, it enters the
kernel mode by default. During normal operation, the kernel or user’s application sends
signals to the WDT to report that the system or application is working well. In kernel mode,
the kernel sends signals (acknowledgements) periodically to the WDT to keep the system
alive. If the kernel fails to acknowledge the WDT within an acknowledgement interval, the
WDT will force the system to reboot. Similarly, when users include WDT functions in their
applications, the WDT switches to user mode automatically. If the user enables the WDT and
the application does not acknowledge it, the system will reboot. You can set the
acknowledgement interval from a minimum of 50 milliseconds to a maximum of 60 seconds.
3. The user API
The user application must include <moxadevic.h>, and link to moxalib.a. A makefile example
is shown below:
all:
arm-elf-gcc –Wl, -elf2flt –o xxxx xxxx.c -lmoxalib