
Decoding of characters sent via /dev/lcd ...

Basic operation is ascii 0x20 - 0x7E are display chars and are written
sequentially along the current line until getting to last position
on the line, where they either stick (nowrap mode) or start on next line 
(wrap mode). At end of last line in scroll mode, the top line is lost,
the 2nd line is copied to the first line, 3rd to 2nd, etc and a new 
empty 2nd line is started. Or in noscroll mode chars just keep 
overwriting the last position on screen.
 
Control Characters are ascii values 0x00 - 0x1F (octal \000 to \037) ...

 Dec Hex.    Octal  Name Description...  
   7 0x07 \g \007   BEL  does what necessary to raise an alert
                         this is device dependant - it could action a 
                         sounder or flash the blacklight, or ...
   8 0x08 \b \010   BS   move cursor back one, unless at start of line
  10 0x0A \n \012   LF   move down a line to same column on line below.
                         If in scroll mode, and already on last line, move 
                         all lines up 1 and clear last line.
                         N.B. LF implementation is flagged and action 
                         delayed until the first char of the next line. 
                         last line of the display is always blank - as most apps
                         send each line LF terminated!
  12 0x0C \f \014   FF   move cursor to start of line 1 and clear all data 
                         to spaces
  13 0x0D \r \015   CR   cursor moves to col 0 on current line
  14 0x0E    \016   SO   the following byte is an HD44780 LCD Control byte
  27 0x1B    \033   ESC  starts an ANSI control sequence - see below
 155 0x9B    \233   CSI  equivalent of the two char. sequence ESC '['
                         this starts many ANSI control sequences

The Standard ANSI sequence decoding ... 

Only a subset of the ANSI sequences are decoded here.
If it's not here then send JJ a patch or a request for that ANSI/VT
sequence to implemented. 

Reset Device            ESC 'c'

All the rest assume leading ESC character ...

Enable Line Wrap	[7h            [?7h
Disable Line Wrap	[7l            [?7l

Font Set G0		(
Font Set G1		)

Scroll Down		D
Scroll Up		M

Cursor Down  n lines    [nA
Cursor Up    n lines    [nB
Cursor Right n lines    [nC
Cursor Left  n lines    [nD


Erase to end of screen  [0J  or [J
Erase cursor to start   [1J
Erase Screen	        [2J

Erase to End of Line	[0K  or [K
Erase cursor to start   [1K
Erase Line              [2K

Save cursor position     [s
Restore cursor position  [u


Non-Standard ANSI like command sequences ...

Non-standard codes for entry mode (see a HD44780 datasheet)

Left Reverse		[4E
Right Reverse		[5E
Right Normal		[6E
Left Normal		[7E
 
Non-standard codes for cursor and display control

cursor off   	   	[0X 
cursor on		[2X
cursor on/flashing	[3X
display off             [8X
display on              [12X

Non-standard code for setting character and line delay

Set char and line delays  [{cd};{ld}w
 
  cd and ld are in unit of 10millisecs, e.g. ESC[10;100w sets a pause
   of 100millisecs between chars, and 1 sec between lines.

Non-standard code for controlling backlight

 backlight off      [0V or [V
 backlight on       [nV

 The Backlight on parameter n is device dependant - it can be just 1 for on,
 or a number from 1-7 saying which of the RGB backlights are lit, or a number
 indicating the brightness.

 
Variable length commands

Cursor Up		[nA
Cursor Down		[nB
Cursor Right		[nC
Cursor Left		[nD
Cursor Position Set	[row;colH
Erase to end of Screen  [nJ
Erase to end of line    [nK
Set char/line delays    [{cd};{ld}w


Jim Jackson <jj@franjam.org.uk>


Alphebetic list of ANSI or ANSI-like commands...

* A  Cursor Down
* B  Cursor Up
* C  Cursor Right
* D  Cursor Left
* E  HD44780 Data Entry Mode
  F
  G
  H
  I
* J  Erase screen
* K  Erase line
  L
  M
  N
  O
  P
  Q
  R
  S
  T
  U
* V  Backlight control
  W
* X  Cursor control
  Y  
  Z  
  a
  b
  c
  d
  e
  f
  g
* h  set a numbered parameter
  i
  j
  k
* l  unset a numbered parameter
  m
  n
  o
  p
  q
  r 
* s  Save cursor
  t
* u  Restore cursor
  v
* w  Set delays after each char and line
  x
  y
  z
