
UC-8100-LX Software Manual
Programmer's Guide
6-7
55B
RTC (Real Time Clock)
The device node is located at
/dev/rtc0
. UC-8100-LX series supports Linux standard simple RTC control. You
must
include <linux/rtc.h
>
in your program to use the following functions.
Function
RTC_RD_TIME
Description
Read time information from RTC. It will return the value on argument 3.
Usage
struct rtc_time rtc_tm;
ioctl(fd, RTC_RD_TIME, &rtc_tm);
Function
RTC_SET_TIME
Description
Set RTC time. Argument 3 will be passed to RTC.
Usage
struct rtc_time rtc_tm;
ioctl(fd, RTC_SET_TIME, &rtc_tm);
Function
RTC_ALM_SET
Description
Set alarm time.
Usage
struct rtc_time rtc_tm;
ioctl(fd, RTC_ALM_SET, &rtc_tm);
Function
RTC_ALM_READ
Description
Read alarm time.
Usage
struct rtc_time rtc_tm;
ioctl(fd, RTC_ALM_READ, &rtc_tm);
Function
RTC_IRQP_SET
Description
Set IRQ rate
Usage
unsigned long tmp = 2;
int ioctl(fd, RTC_IRQP_SET, tmp);
value : {2, 4, 8, 16, 32,64}Hz
Function
RTC_IRQP_READ
Description
Read IRQ rate.
Usage
unsigned long tmp;
int ioctl(fd, RTC_IRQP_READ, &tmp);
Function
RTC_ALM_SET
Description
Set alarm time.
Usage
struct rtc_time rtc_tm;
ioctl(fd, RTC_ALM_SET, &rtc_tm);
Function
RTC_PIE_ON
Description
Periodic int. enable on
Usage
int ioctl(fd, RTC_PIE_ON, 0);
Function
RTC_PIE_OFF
Description
Periodic int. enable off.
Usage
int ioctl(fd, RTC_PIE_OFF, 0);
Function
RTC_UIE_ON
Description
Update int. enable on.
Usage
int ioctl(fd, RTC_UIE_ON, 0);
Function
RTC_UIE_OFF
Description
Update int. enable off
Usage
int ioctl(fd, RTC_UIE_OFF, 0);
Function
RTC_AIE_ON
Description
Periodic int. enable on
Usage
int ioctl (fd, RTC_AIE_ON, 0);
Function
RTC_AIE_OFF
Description
Alarm int. enable off
Usage
int ioctl (fd, RTC_AIE_OFF, 0);
Refer to the example in example package on how to use these functions
Содержание UC-8100-LX
Страница 8: ...UC 8100 LX Software Getting Started 2 2...
Страница 38: ...UC 8100 LX Software Manual Security On UC 8100 LX 4 2...