|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.comm.LCDPort
LCDPort.sendControl(0x38); // Set up the display mode
LCDPort.sendControl(0x0C); // Turn on display with no cursor
LCDPort.setAddress(0x20);
LCDPort.sendControl(1); // Clear the screen
LCDPort.setAddress(8);
LCDPort.sendData((int)85); // Write a U
Constructor Summary | |
LCDPort(int portNum,
int stream)
Constructs a new LCDPort. |
Method Summary | |
void |
close()
Closes the port and frees up system resources. |
int |
getOutputBufferSize()
Gets the size of the output buffer. |
OutputStream |
getOutputStream()
Gets a LCD port Output stream |
void |
open()
Opens the LCD port for communication. |
static void |
sendControl(int value)
Sends a control byte to the LCD display. |
static void |
sendData(int value)
Sends a data byte to the display. |
static void |
setAddress(int address)
Sets the address for the next write. |
static void |
setLCDParams(int paramNum,
byte[] params,
int length)
Sends a parameter to the LCD display. |
static void |
setNumberOfLines(int num)
Sets the number of lines for the LCD driver. |
static void |
setShiftDirection(boolean dir)
Sets the direction of shifts. |
static void |
setShiftInterval(int num_ms)
Sets the interval of the automatic shift in milliseconds. |
static void |
setShiftMode(boolean on)
Turns automatic shifting on and off. |
void |
write(byte[] arr)
Writes the array to the LCD port. |
void |
write(byte[] arr,
int offset,
int len)
Writes the array to the LCD port. |
void |
write(int ch)
Writes a byte to the LCD port. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public LCDPort(int portNum, int stream) throws IOException
LCDPort port = new LCDPort(NativeComm.PORT_LCD, NativeComm.STREAM_STDOUT);
portNum
- the port number of the driver, should be NativeComm.PORT_LCDstream
- the stream to open, only stdout is supportedMethod Detail |
public static void setLCDParams(int paramNum, byte[] params, int length)
byte[] b1 = {0x01};
LCDPort.setLCDParams(1, b1, b1.length);
paramNum
- parameter number (only 1 is supported)params
- the parameter values, currently only number of lines is supported, allowable values include 1, 2 or 4length
- the length of the parameter arraypublic void open()
public void close() throws IOException
public void write(byte[] arr) throws IOException
arr
- the array to be written to the LCD portpublic void write(byte[] arr, int offset, int len) throws IOException
arr
- the array to be writtenoffset
- the offset in the array to begin sendinglen
- the number of bytes to sendpublic void write(int ch) throws IOException
ch
- the data to be writtenpublic OutputStream getOutputStream() throws IOException
public int getOutputBufferSize()
public static void setNumberOfLines(int num)
num
- number of linespublic static void sendControl(int value)
value
- the control value to be sentpublic static void sendData(int value)
value
- the byte to be displayedpublic static void setShiftMode(boolean on)
on
- set to true to turn shifting onpublic static void setShiftDirection(boolean dir)
dir
- set to true to shift characters to the leftpublic static void setShiftInterval(int num_ms)
num_ms
- number of milliseconds between shiftspublic static void setAddress(int address)
address
- the address for the next write
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |