Moxa DA-662A-I-8-LX [59/63] Keypad

Moxa DA-662A-I-8-LX [59/63] Keypad
DA-662A Series Software Programmer's Guide
5-12
int ioctl(fd, IOCTL_LCM_BACK_LIGH_ON, NULL);
Turns the LCM backlight on.
int ioctl(fd, IOCTL_LCM_BACK_LIGHT_OFF, NULL);
Turns the LCM backlight off.
KeyPad
The device node is /dev/keypad. The key value is defined in moxadevice.h.
int ioctl(fd, IOCTL_KEYPAD_HAS_PRESS, int *flag);
Checks how many keys have been pressed. Argument 3 returns the number of pressed keys. 0 means no keys
were pressed.
int ioctl(fd, IOCTL_KEYPAD_GET_KEY, int *key);
Gets the value of the last key that was pressed. This functions only reads one key value for each function call.
The value of the key value is returned in argument 3.
Special Note
1. The DA-662A series‘ kernel will store the ―pressed key history‖ in a buffer. The maximum buffer size is 31
keys. If the buffer overflows, the first key of the 31 that was pressed will be dropped, without sounding the
buzzer.
2. Currently, the DA-662A series does NOT support pressing more than 1 key at the same time.
Product S/N
The DA-662A series stores the product serial number in the system. You can use the following method to get
Product S/N and utilize the number to develop security functions such as program protection and program
initialization identification. The following example shows how to retrieve the product S/N.
Example:
root@Moxa:~# cat /proc/driver/serid
TABC0123456789
Make File Example
The following Makefile file sample code is provided for reference.
CC = arm-none-linux-gnueabi-gcc
CPP = arm-none-linux-gnueabi-gcc
SOURCES = hello.c
OBJS = $(SOURCES:.c=.o)
all: hello
hello: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
clean:
rm -f $(OBJS) hello core *.gdb

Содержание

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

Скачать