RTC (Real-time Clock)
The device node is located at /dev/rtc. The
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
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 modem tty device node is located at /dev/com0 … com1. The
#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.