Moxa IA3341-LX [58/72] Rtc real time clock

Moxa IA3341-LX [58/72] Rtc real time clock
IA3341 Linux User’s Manual Programmer’s Guide
6-3
RTC (Real Time Clock)
The device node is located at /dev/rtc. The IA3341 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 IA3341 supports Linux standard buzzer control,
with the IA3341’s buzzer running at a fixed frequency of 100 Hz. You must
include
<sys/kd.h>
.
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 at 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 acknowledgement time from a minimum of 50 msec to a maximum of 60 seconds.
2. How the WDT works
The WDT function is disabled when the system boots up. The user application can also enable
acknowledgement. When the user does not acknowledge, it will let the system reboot.
Kernel boot
…..
….
User application running and enable user acknowledgement
….
….
3. The user API
The user application must
include <moxadevic.h>
, and
link moxalib.a
. A makefile
example is shown below:
all:
arm-linux-gcc –o xxxx xxxx.c -lmoxalib
int swtd_open(void)

Содержание

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

Скачать