User`s manual

EM-1220 LX User’s Manual EM-1220-LX Device API
RTC (Real-time Clock)
The device node is located at /dev/rtc. The EM-1220-LX supports µClinux standard simple
RTC control. You must include <linux/rtc.h> to use these functions.
1. Function: RTC_RD_TIME
int ioctl(fd, RTC_RD_TIME, struct rtc_time *time);
Description: Reads time information from RTC.
2. Function: RTC_SET_TIME
int ioctl(fd, RTC_SET_TIME, struct rtc_time *time);
Description: Sets RTC time.
Buzzer
The device node is located at /dev/console. The EM-1220-LX supports µClinux standard
buzzer control. The EM-1220-LX’s buzzer runs at a fixed frequency of 100 Hz. You must include
<sys/kd.h> to use these functions.
1. Function: KDMKTONE
ioctl(fd, KDMKTONE, unsigned int arg);
Description: Buzzer will beep, as stipulated by the function
arguments.
UART Interface
The normal tty device node is located at /dev/ttyM0…ttyM1, and the modem tty device node is
located at /dev/com0 … com1. The EM-1220-LX Series supports µClinux standard termios
control. The Moxa UART Device API supports configurations ttyM0 to ttyM1, as RS-232/422/485.
To use these functions, after the Tool Chain package is installed, include <moxadevice.h> in your
application.
#define RS232_MODE 0
#define RS485_2WIRE_MODE 1
#define RS422_MODE 2
#define RS485_4WIRE_MODE 3
1. Function: MOXA_SET_OP_MODE
int mode;
mode=which mode you want to set;
int ioctl(fd, MOXA_SET_OP_MODE, &mode)
Description: Sets the interface mode.
2. Function: MOXA_GET_OP_MODE
int mode;
int ioctl(fd, MOXA_GET_OP_MODE, &mode)
Description: Gets the interface mode.
5-2