Moxa IA261-I-LX [59/71] Buzzer

Moxa IA261-I-LX [59/71] Buzzer
IA260/IA261/IA262/EM-2260 Linux User’s Manual Programmer’s Guide
Buzzer
The device node is located at /dev/console. The IA260/IA261/IA262/EM-2260 supports Linux
standard buzzer control, with the IA260/IA261/IA262/EM-2260’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 the argument 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.
UART
The normal tty device node is located at
/dev/ttyM0 … ttyM3
.
The IA260/IA261/IA262/EM-2260 supports Linux standard termios control. The Moxa UART
Device API allows you to configure ttyM0 to ttyM3 as RS-232, RS-422, 4-wire RS-485, or 2-wire
RS-485. IA260/IA261/IA262/EM-2260 supports RS-232, RS-422, 2-wire RS-485, and 4-wire
RS485.
You must
include <moxadevice.h>
.
#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 ioctl(fd, MOXA_SET_OP_MODE, &mode)
Description
Set the interface mode. Argument 3 mode will pass to the UART device driver and change it.
2. Function: MOXA_GET_OP_MODE
int ioctl(fd, MOXA_GET_OP_MODE, &mode)
Description
Get the interface mode. Argument 3 mode will return the interface mode.
There are two Moxa private ioctl commands for setting up special baudrates.
Function: MOXA_SET_SPECIAL_BAUD_RATE
Function: MOXA_GET_SPECIAL_BAUD_RATE
If you use this ioctl to set a special baudrate, the termios cflag will be B4000000, in which case the
B4000000 define will be different. If the baudrate you get from termios (or from calling tcgetattr())
is B4000000, you must call ioctl with MOXA_GET_SPECIAL_BAUD_RATE to get the actual
baudrate.
6-3

Содержание

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

Скачать