|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.dalsemi.comm.LCDPort
A class to write to a LCD display. This class was written and tested using the KS0066U and KS0070B segment drivers/controller. The class can be used as part of a streams based protocol. There are also methods for communicating directly to the LCD display. Using the sendControl and sendData commands you can control the LCD directly without the need for streams.
| Field Summary | |
static int |
COMMAND
|
static int |
GENERIC
|
static int |
LCD_DRIVER
PortNumber |
static int |
LCDDEFAULTREADTIMEOUT
|
static int |
PARAM_COMMANDTABLE
|
static int |
STDERR
|
static int |
STDOUT
|
| Constructor Summary | |
LCDPort(int portNum,
int stream)
Constructs a new LCDPort. |
|
| Method Summary | |
int |
available()
returns the number of bytes available on the port. |
void |
close()
Closes the port and frees up system resources. |
void |
disableReceiveTimeout()
disables the receive timeout. |
void |
enableReceiveTimeout()
enables the receive timeout - currently not implemented. |
int |
getInputBufferSize()
gets the size of the input buffer. |
java.io.InputStream |
getInputStream()
gets a LCD port Input stream |
int |
getOutputBufferSize()
gets the size of the output buffer. |
java.io.OutputStream |
getOutputStream()
gets a LCD port Output stream |
boolean |
isReceiveTimeoutEnabled()
returns true if the receive timeout is enabled. |
void |
open()
opens the LCD port for communication. |
int |
read()
read from the LCD port. |
int |
read(byte[] arr,
int offset,
int len)
read from the LCD port. |
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)
Set the address for the next write. |
void |
setInputBufferSize(int size)
sets the size of the input buffer. |
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. |
void |
setOutputBufferSize(int size)
sets the size of the output buffer. |
void |
setReceiveTimeout(int timeout)
sets the receive timeout to the given value. |
static void |
setShiftDirection(boolean dir)
Sets the direction of shifts. |
static void |
setShiftInterval(int num_ms)
Set the interval of the automatic shift. |
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 given 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 |
| Field Detail |
public static final int LCD_DRIVER
public static final int COMMAND
public static final int STDOUT
public static final int STDERR
public static final int GENERIC
public static final int LCDDEFAULTREADTIMEOUT
public static final int PARAM_COMMANDTABLE
| Constructor Detail |
public LCDPort(int portNum,
int stream)
throws java.io.IOException
portNum - - the port number of the driver. Should be LCD_DRIVERstream - - the stream to open. Only stdout is supported.| Method Detail |
public static void setLCDParams(int paramNum,
byte[] params,
int length)
paramNum - - parameter number (only 1 is supported)params - - the parameter valueslength - - the length of the parameter array.public void open()
public void close()
throws java.io.IOException
public void write(byte[] arr)
throws java.io.IOException
arr - - the array to be written to the LCD port.
public void write(byte[] arr,
int offset,
int len)
throws java.io.IOException
arr - - the array to be written.offset - - the offset in the array to begin sending.len - - the number of bytes to send.
public void write(int ch)
throws java.io.IOException
ch - - the data to be written.
public int read(byte[] arr,
int offset,
int len)
throws java.io.IOException
arr - - the array for the data read to be placed in.offset - - the offset to begin saving data.len - - the number of bytes to read.
public int read()
throws java.io.IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
public void enableReceiveTimeout()
throws UnsupportedCommOperationException
public void disableReceiveTimeout()
throws UnsupportedCommOperationException
public void setReceiveTimeout(int timeout)
throws UnsupportedCommOperationException
timeout - - the value to delay before timeing out.public boolean isReceiveTimeoutEnabled()
public int getInputBufferSize()
public int getOutputBufferSize()
public void setInputBufferSize(int size)
throws UnsupportedCommOperationException
size - - the size of the input buffer.
public void setOutputBufferSize(int size)
throws UnsupportedCommOperationException
size - - the size of the output buffer.public int available()
public static void setNumberOfLines(int num)
num - - number of lines.public static void sendControl(int value)
value - - the control value to be sent.public static void sendData(int value)
value - - the byte to be displayed.public static void setShiftMode(boolean on)
on - - true turns shifting on.public static void setShiftDirection(boolean dir)
dir - - true = leftpublic static void setShiftInterval(int num_ms)
num_ms - - number of milliseconds between shifts.public static void setAddress(int address)
address - - the address.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||