UC-7400-LX Plus User’s Manual
Programmer’s Guide
5-11
Special Note
1.
If the target baudrate is not a special baudrate (e.g. 50, 75, 110, 134, 150, 200, 300, 600, 1200,
1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600), the termios
cflag will be set to the same flag.
2.
If you use stty to get the serial information, you will get speed equal to 0.
LCM
The UC-7400-LX Plus only supports text mode display, with screen size of 16 cols by 8 rows. The
device node is
/dev/lcm
. See the examples given below. We provide a private struct defined as
follows:
typedef struct lcm_xy {
int x; // col value, the arrange is 0 – 15
int y; // raw value, the arrange is 0 – 1
} lcm_xy_t;
Examples
int ioctl(fd, IOCTL_LCM_GOTO_XY, lcm_xy_t *pos);
Move the cursor position to the x(col),y(raw) position. Argument 3 is the new position value.
int ioctl(fd, IOCTL_LCM_CLS, NULL);
Clears the LCM display.
int ioctl(fd, IOCTL_LCM_CLEAN_LINE, NULL);
To change one line to all spaces in the current row, and move the cursor to the 0 column of this
row.
int ioctl(fd, IOCTL_LCM_GET_XY, lcm_xy_t *pos);
Get the current cursor position. The value will be returned in argument 3.
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 function only reads one key value for each
function call. The value of the key value is returned in argument 3.
Special Note
1.
The UC-7400-LX Plus’s 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 UC-7400-LX Plus does NOT support pressing more than 1 key at the same
time.