de.wagner_ibw.iow.lcd
Class M50530Pio

java.lang.Object
  |
  +--de.wagner_ibw.iow.lcd.AbstractLCD
        |
        +--de.wagner_ibw.iow.lcd.M50530Pio
All Implemented Interfaces:
SpecialModeFunction

public class M50530Pio
extends AbstractLCD

Author:
Thomas Wagner To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from interface de.wagner_ibw.iow.SpecialModeFunction
SMF_CPS_ID, SMF_I2C_ID, SMF_LCD_ID, SMF_LED_ID, SMF_RC5_ID, SMF_SMX_ID, SMF_SPI_ID
 
Constructor Summary
M50530Pio(AbstractIowDevice iow)
           
 
Method Summary
 void check()
          Shows a test pattern on display.
 java.lang.String checkCompatibility(int id, int rev, int specialModes)
          Checks if it is possible to activate this special mode function.
 void clearLCD()
          Clears entire dislplay and sets DDRAM address 0 in address counter.
 int getCols()
           
 int[] getDisableReport()
          Returns the report that disables the special mode function.
 int[] getEnableReport()
          Returns the report that enables the special mode function.
 int[] getIowSpecialBits(int deviceIdentifier)
          Returns an array of bitmask(s) for port 0...1, 0...3 or 0...6 if this special mode function runs on this iow device.
 java.lang.String getName()
          Returns the name of the special mode function.
 int[] getReportIds()
          Returns the report id(s) which the implementation is interested in.
 int getRows()
           
 int getSpecialModeFuncionId()
          Returns the special mode function id for this implementation.
 boolean matchReportId(int reportId)
          Checks if this implementation is interested in this report.
 void moveSprite(int row, java.lang.String[] sprites, int wait)
           
 void reportReceived(int[] readBuffer)
          Callback method is called when a matching report was received.
 void setCursor(int row, int col)
          OK Moves cursor to new Position.
 void setCursorDispOn()
          Convenient method: Turn LCD display on.
 void setCursorHome()
          Sets DDRAM address 0 in address counter.
 void setCursorleft()
          Move LCD cursor to the left
 void setCursorOff()
          Convenient method: Turn LCD cursor off.
 void setCursorOn()
          Convenient method: Turn LCD cursor on.
 void setCursorRight()
          Move LCD cursor to the right
 void setDDRAMAddr(int addr)
           
 void setDisplayControl(boolean dispOn, boolean cursorOn, boolean charBlinking)
          Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).
 void setDispOff()
          Convenient method: Turn LCD display off.
 void setEntryMode(boolean moveForward, boolean shiftDisp)
          Sets cursor move direction and specifies display shift.
 void setIowDevice(AbstractIowDevice iow)
          Sets the reference to the underlying iow device for write report operations.
 void setShiftControl(boolean shiftDisp, boolean shiftDir)
          Moves cursor and shifts display whitout changing DDRAM contents.
 void setSpecialChar(int code, int[] pattern)
          Sets a special char in CGRAM.
 void writeChar(int c)
           
 void writeCharDec(int c)
           
 void writeCharInc(int c)
           
 void writeLine(int row, boolean clear, java.lang.String str)
          Write the given String in row specified by parm row.
 void writeLine(int row, int col, boolean clear, java.lang.String str)
          Write the given String in the specified row and column.
 void writeString(java.lang.String str)
          Write the given string to LCD.
 void writeStringInc(java.lang.String str)
           
 void writeStringLine(int line, java.lang.String str)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

M50530Pio

public M50530Pio(AbstractIowDevice iow)
Method Detail

getRows

public int getRows()
Overrides:
getRows in class AbstractLCD

getCols

public int getCols()
Overrides:
getCols in class AbstractLCD

check

public void check()
Description copied from class: AbstractLCD
Shows a test pattern on display.

Specified by:
check in class AbstractLCD

writeLine

public void writeLine(int row,
                      boolean clear,
                      java.lang.String str)
               throws java.lang.IllegalArgumentException
Description copied from class: AbstractLCD
Write the given String in row specified by parm row. If parm clear is true the row will be cleared before output. All characters exceeding cols will be truncated.

Specified by:
writeLine in class AbstractLCD
Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

writeLine

public void writeLine(int row,
                      int col,
                      boolean clear,
                      java.lang.String str)
               throws java.lang.IllegalArgumentException
Description copied from class: AbstractLCD
Write the given String in the specified row and column. If parm clear is true the row will be cleared before output. All characters exceeding cols will be truncated.

Specified by:
writeLine in class AbstractLCD
Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

setDDRAMAddr

public void setDDRAMAddr(int addr)

writeString

public void writeString(java.lang.String str)
Description copied from class: AbstractLCD
Write the given string to LCD.

Specified by:
writeString in class AbstractLCD
Parameters:
str - String to write

setCursor

public void setCursor(int row,
                      int col)
               throws java.lang.IllegalArgumentException
OK Moves cursor to new Position.

Specified by:
setCursor in class AbstractLCD
Parameters:
row - display line (1...4)
col - column in row (1...40)
java.lang.IllegalArgumentException

clearLCD

public void clearLCD()
Description copied from class: AbstractLCD
Clears entire dislplay and sets DDRAM address 0 in address counter.

Specified by:
clearLCD in class AbstractLCD

writeCharInc

public void writeCharInc(int c)

writeCharDec

public void writeCharDec(int c)

writeChar

public void writeChar(int c)

writeStringInc

public void writeStringInc(java.lang.String str)

writeStringLine

public void writeStringLine(int line,
                            java.lang.String str)

moveSprite

public void moveSprite(int row,
                       java.lang.String[] sprites,
                       int wait)
                throws java.lang.IllegalArgumentException
Specified by:
moveSprite in class AbstractLCD
Parameters:
row -
sprites -
wait -
Throws:
java.lang.IllegalArgumentException

setCursorDispOn

public void setCursorDispOn()
Description copied from class: AbstractLCD
Convenient method: Turn LCD display on.

Specified by:
setCursorDispOn in class AbstractLCD

setCursorHome

public void setCursorHome()
Description copied from class: AbstractLCD
Sets DDRAM address 0 in address counter. Also returns display from being shiftet to original position. DDRAM contents remain unchanged.

Specified by:
setCursorHome in class AbstractLCD

setCursorleft

public void setCursorleft()
Description copied from class: AbstractLCD
Move LCD cursor to the left

Specified by:
setCursorleft in class AbstractLCD

setCursorOff

public void setCursorOff()
Description copied from class: AbstractLCD
Convenient method: Turn LCD cursor off.

Specified by:
setCursorOff in class AbstractLCD

setCursorOn

public void setCursorOn()
Description copied from class: AbstractLCD
Convenient method: Turn LCD cursor on.

Specified by:
setCursorOn in class AbstractLCD

setCursorRight

public void setCursorRight()
Description copied from class: AbstractLCD
Move LCD cursor to the right

Specified by:
setCursorRight in class AbstractLCD

setDisplayControl

public void setDisplayControl(boolean dispOn,
                              boolean cursorOn,
                              boolean charBlinking)
Description copied from class: AbstractLCD
Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).

Specified by:
setDisplayControl in class AbstractLCD
Parameters:
dispOn - true: the display is on, false: display is off
cursorOn - true: cursor is displayed, false: cursor is not displayed
charBlinking - true: the character indicated by the cursor blinks, false: blinks not

setDispOff

public void setDispOff()
Description copied from class: AbstractLCD
Convenient method: Turn LCD display off.

Specified by:
setDispOff in class AbstractLCD

setEntryMode

public void setEntryMode(boolean moveForward,
                         boolean shiftDisp)
Description copied from class: AbstractLCD
Sets cursor move direction and specifies display shift. These operations are performed during data write and read.

Specified by:
setEntryMode in class AbstractLCD
Parameters:
moveForward - true: increment, false: decrement
shiftDisp - true: display is shifted, false: display is not shifted

setShiftControl

public void setShiftControl(boolean shiftDisp,
                            boolean shiftDir)
Description copied from class: AbstractLCD
Moves cursor and shifts display whitout changing DDRAM contents.

Specified by:
setShiftControl in class AbstractLCD
Parameters:
shiftDisp - true: display shift, false: cursor move;
shiftDir - true: shift to the right, false: shift to the left

setSpecialChar

public void setSpecialChar(int code,
                           int[] pattern)
                    throws java.lang.IllegalArgumentException
Description copied from class: AbstractLCD
Sets a special char in CGRAM.

Specified by:
setSpecialChar in class AbstractLCD
Parameters:
code -
pattern -
Throws:
java.lang.IllegalArgumentException

checkCompatibility

public java.lang.String checkCompatibility(int id,
                                           int rev,
                                           int specialModes)
Description copied from interface: SpecialModeFunction
Checks if it is possible to activate this special mode function. This depends on id and/or rev of the iow device and/or already activated special mode functions.

Specified by:
checkCompatibility in interface SpecialModeFunction
Specified by:
checkCompatibility in class AbstractLCD
Parameters:
id - Id of the current IO-Warrior device.
rev - Rev of the current IO-Warrior device.
specialModes - Special modes from the current IO-Warrior device.
Returns:
Error string if special mode function is not available. Returns null if special mode function is available.

getDisableReport

public int[] getDisableReport()
Description copied from interface: SpecialModeFunction
Returns the report that disables the special mode function.

Specified by:
getDisableReport in interface SpecialModeFunction
Specified by:
getDisableReport in class AbstractLCD
Returns:
Special mode function disable report.

getEnableReport

public int[] getEnableReport()
Description copied from interface: SpecialModeFunction
Returns the report that enables the special mode function.

Specified by:
getEnableReport in interface SpecialModeFunction
Specified by:
getEnableReport in class AbstractLCD
Returns:
Special mode function enable report.

getIowSpecialBits

public int[] getIowSpecialBits(int deviceIdentifier)
Description copied from interface: SpecialModeFunction
Returns an array of bitmask(s) for port 0...1, 0...3 or 0...6 if this special mode function runs on this iow device. Returns a array of lenght zero if no bits used by this special mode function. 1 means this bit is dedicated by special mode function. 0 means this bit is free for normal pin io operations.

Specified by:
getIowSpecialBits in interface SpecialModeFunction
Specified by:
getIowSpecialBits in class AbstractLCD
Parameters:
deviceIdentifier - Iow device identifier (AbstractIowDevice.IOW24ID<(code>, AbstractIowDevice.IOW24ID or AbstractIowDevice.IOW56ID).
Returns:
Array of int that contains bitmask(s) for special mode function bits.

getName

public java.lang.String getName()
Description copied from interface: SpecialModeFunction
Returns the name of the special mode function.

Specified by:
getName in interface SpecialModeFunction
Specified by:
getName in class AbstractLCD
Returns:
Name of the special mode function.

getReportIds

public int[] getReportIds()
Description copied from interface: SpecialModeFunction
Returns the report id(s) which the implementation is interested in.

Specified by:
getReportIds in interface SpecialModeFunction
Specified by:
getReportIds in class AbstractLCD
Returns:
Int array of special mode function id(s).

getSpecialModeFuncionId

public int getSpecialModeFuncionId()
Description copied from interface: SpecialModeFunction
Returns the special mode function id for this implementation.

Specified by:
getSpecialModeFuncionId in interface SpecialModeFunction
Specified by:
getSpecialModeFuncionId in class AbstractLCD
Returns:
Special mode function id (SMF_LCD_ID,SMF_RC5_ID,SMF_I2C_ID,SMF_CPS_ID,SMF_SPI_ID).

matchReportId

public boolean matchReportId(int reportId)
Description copied from interface: SpecialModeFunction
Checks if this implementation is interested in this report.

Specified by:
matchReportId in interface SpecialModeFunction
Specified by:
matchReportId in class AbstractLCD
Parameters:
reportId - Report id of the received report.
Returns:
True if it fits or false if not.

reportReceived

public void reportReceived(int[] readBuffer)
Description copied from interface: SpecialModeFunction
Callback method is called when a matching report was received.

Specified by:
reportReceived in interface SpecialModeFunction
Specified by:
reportReceived in class AbstractLCD
Parameters:
readBuffer - Read buffer from a received report.

setIowDevice

public void setIowDevice(AbstractIowDevice iow)
Description copied from interface: SpecialModeFunction
Sets the reference to the underlying iow device for write report operations.

Specified by:
setIowDevice in interface SpecialModeFunction
Specified by:
setIowDevice in class AbstractLCD
Parameters:
iow - Instance of an iow device.