Appendix c, Programming the lcm – Lanner FW-8877 User Manual
Page 40
34
Programming the LCM
Appendix C
Network Application Platforms
For USB and Serial Text or Graphic-based LCM
Jumper selection between text and graphic mode
TEXT LCM
1 1 0
J6
J7
J8
Graphic LCM 1 1 1
J6
J7
J8
Build
To build program source code on Linux platform, use the
following steps as a guideline:
Extract source file:
1.
#tar -xzvf lanner-serial-usb-lcm-version.tgz
Change directory to the extracted folder:
2.
#cd lanner-serial-usb-lcm-vx
Type make to build source code:
3.
#make
After compilation, the executable programs (usb_disp,
usb_key, ser_disp, ser_key) where disp denotes display
control and key denotes the keypad input function and
usb and ser denote USB and serial interfaces respectively
will appear in the program’s folder.
Note:
The OS supported by Lanner LCM function
1.
include platforms based on Linux Kernel series
2.4.x and Linux Kernel series 2.6.x, FreeBSD 8.0,
and DOS.
For information on installation on platforms
2.
other than Linux, see \lanner-serial-usb-lcm-
v0.5\README and \lanner-serial-usb-lcm-v0.5\
dos-example\README
Install
To install, type the following command:
#mknod /dev/usb/hiddev0 c 180 96
Execution
This section contains sample executable programs that
you could test on your platform. It demonstrates some
useful functionality that the LCM provides.
Type the execution command:
# ./ser_disp or ./usb_disp
Options:
[-I] | [-o XXXXX] | [ [-b YYYYY] | [-f ttyS_No] | [-d filename] |
[-g filename] | [-c cmd] | [-0 arg0] [-1 arg1]... [-h]
[-I]: Identify LCM information and get flash setting
[-o XXXXX]: to override default baud rate
valid values are: 9600, 19200, 38400, 57600, 115200
[-f ttyS_No]: assign the keypad device used as ttySNO
[-d filename]: to display the specified file on Text LCD
[-g filename]: to display the specified file on Graphic
LCD
[-c cmd]: specify the command to be used.
[-0 arg0]: data[0]
[-1 arg1]: data[1]
[-2 arg2]: data[2]
[-3 arg3]: data[3]
[-4 arg4]: data[4]
[-v]: be verbose
[-h]: this help
#./ser_key or ./usb_key
The keypad function test program will not detect the
keypad device; therefore, you should assign it with the [-f]
option (the default is /dev/ttyS0 or /dev/usb/hiddev0)