hades.models.special
Class GraphicsLCDnfb.KS0108

java.lang.Object
  extended byhades.models.special.GraphicsLCDnfb.KS0108
Enclosing class:
GraphicsLCDnfb

class GraphicsLCDnfb.KS0108
extends java.lang.Object

An inner class that models the Samsung KS0108 LCD controller for a 64x64 dot matrix display. For larger displays, multiple KS0108 are used.

For a short description of the KS0108 instruction set see http://computer.freepage.de/firestorm/display/ks0108.html. The datasheet is available via www.samsung.com or http://www.microelect.com/lcdtech/drivers.htm


Field Summary
protected  int BIT_D0
           
protected  int BIT_D1
           
protected  int BIT_D2
           
protected  int BIT_D3
           
protected  int BIT_D4
           
protected  int BIT_D5
           
protected  int BIT_D6
           
protected  int BIT_D7
           
protected  int BIT_nR
           
protected  int BIT_RS
           
protected  int BIT_RW
           
protected  int byte_address
           
protected  int CMD_BYTE_ADDR
           
protected  int CMD_CLEAR
           
protected  int CMD_DISPLAY_ON
           
protected  int CMD_IDLE
           
protected  int CMD_PAGE_ADDR
           
protected  int CMD_READ_BUSY
           
protected  int CMD_READ_RAM
           
protected  int CMD_RESET
           
protected  int CMD_START_ADDR
           
protected  int CMD_WRITE_RAM
           
protected  int command_word
           
protected  int lcd_start_col
           
protected  int lcd_start_page
           
protected  int page_address
           
protected  int start_address
           
 
Constructor Summary
GraphicsLCDnfb.KS0108()
           
 
Method Summary
 void decode(int command)
           
 void doInitialize()
           
 void doReadBusy()
          01 BF AAA AAAA
 void doReadData()
          11 DDDD DDDD
 void doSetByteAddress()
          00 01AA AAAA
 void doSetDisplayOn()
          00 0011 111O
 void doSetPageAddress()
          00 1011 1PPP
 void doSetStartAddress()
          00 11SS SSSS
 void doWriteData()
          10 DDDD DDDD
 int readData()
          retrieve the data at the current address from the data RAM of CG RAM, whichever is selected.
 void setCanvas(GraphicsLCDCanvasuniv _canvas)
           
 void setOffsets(int page, int col)
           
 void updateDataAddress()
           
 void writeData(int value)
          write 'value' into the current address of the data RAM or CG RAM, whichever is selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_RESET

protected final int CMD_RESET
See Also:
Constant Field Values

CMD_READ_RAM

protected final int CMD_READ_RAM
See Also:
Constant Field Values

CMD_WRITE_RAM

protected final int CMD_WRITE_RAM
See Also:
Constant Field Values

CMD_READ_BUSY

protected final int CMD_READ_BUSY
See Also:
Constant Field Values

CMD_START_ADDR

protected final int CMD_START_ADDR
See Also:
Constant Field Values

CMD_PAGE_ADDR

protected final int CMD_PAGE_ADDR
See Also:
Constant Field Values

CMD_BYTE_ADDR

protected final int CMD_BYTE_ADDR
See Also:
Constant Field Values

CMD_DISPLAY_ON

protected final int CMD_DISPLAY_ON
See Also:
Constant Field Values

CMD_CLEAR

protected final int CMD_CLEAR
See Also:
Constant Field Values

CMD_IDLE

protected final int CMD_IDLE
See Also:
Constant Field Values

command_word

protected int command_word

BIT_nR

protected final int BIT_nR
See Also:
Constant Field Values

BIT_RS

protected final int BIT_RS
See Also:
Constant Field Values

BIT_RW

protected final int BIT_RW
See Also:
Constant Field Values

BIT_D7

protected final int BIT_D7
See Also:
Constant Field Values

BIT_D6

protected final int BIT_D6
See Also:
Constant Field Values

BIT_D5

protected final int BIT_D5
See Also:
Constant Field Values

BIT_D4

protected final int BIT_D4
See Also:
Constant Field Values

BIT_D3

protected final int BIT_D3
See Also:
Constant Field Values

BIT_D2

protected final int BIT_D2
See Also:
Constant Field Values

BIT_D1

protected final int BIT_D1
See Also:
Constant Field Values

BIT_D0

protected final int BIT_D0
See Also:
Constant Field Values

page_address

protected int page_address

byte_address

protected int byte_address

start_address

protected int start_address

lcd_start_page

protected int lcd_start_page

lcd_start_col

protected int lcd_start_col
Constructor Detail

GraphicsLCDnfb.KS0108

public GraphicsLCDnfb.KS0108()
Method Detail

setOffsets

public void setOffsets(int page,
                       int col)

setCanvas

public void setCanvas(GraphicsLCDCanvasuniv _canvas)

doInitialize

public void doInitialize()

doSetDisplayOn

public void doSetDisplayOn()
00 0011 111O


doSetStartAddress

public void doSetStartAddress()
00 11SS SSSS


doSetByteAddress

public void doSetByteAddress()
00 01AA AAAA


doSetPageAddress

public void doSetPageAddress()
00 1011 1PPP


doReadBusy

public void doReadBusy()
01 BF AAA AAAA


doWriteData

public void doWriteData()
10 DDDD DDDD


doReadData

public void doReadData()
11 DDDD DDDD


writeData

public void writeData(int value)
write 'value' into the current address of the data RAM or CG RAM, whichever is selected. Afterwards, update address and cursor position, depending on the parameters for cursor move/shift, etc.

Note that writes to the CG RAM are currently not implemented.


updateDataAddress

public void updateDataAddress()

readData

public int readData()
retrieve the data at the current address from the data RAM of CG RAM, whichever is selected.

Note that reads from the CG RAM are currently not implemented.


decode

public void decode(int command)