Alva_api library - E. Harbers - Alva
Ported to Linux by J. Lemmens

This library contains the functions for building a parallel driver
for the Alva Braille Terminal series 3 and 4.
There are five functions for accessing the ABT:

int BrailleOpen (unsigned char *Controller)
-------------------------------------------

This function opens the communication with the ABT. Give the parallel
port address as argument. In most cases it will be 0x378 for the first
or 0x3bc for the second parallel port.
Use the ioperm(2) function to get port access permission.

int BrailleProcess (void)
-------------------------

Call the BrailleProcess() function immediate after each BrailleWrite()
function and just before each BrailleRead() function.

void BrailleClose (void)
------------------------

The BrailleClose() function will close the communication with the ABT.

unsigned long BrailleRead (unsigned char *Buffer, unsigned long Maxlen)
-----------------------------------------------------------------------

The BrailleRead() function reads Maxlen ABT keys and put the values
into the buffer pointed to by Buffer.
BrailleRead() will return the number of keys actually read.

unsigned long BrailleWrite (unsigned char *Buffer, unsigned long Len)
---------------------------------------------------------------------

The BrailleWrite() function will write the first Len characters of the
buffer pointed to by Buffer to the ABT and returns the number of characters 
actually written.

The Buffer to write must have the following format:

<ESC> 'B' POS LEN STRING <CR>

Where:

<ESC>  = 27 decimal
'B'    = 66 decimal
POS    = starting position on the braille display including the status cells,
         (1 byte). The first position has value 0.
LEN    = length of the string that will be written (1 byte).
STRING = string of LEN bytes in braille format.
<CR>   = 13 decimal

A braille character is built up as follows:

dot 1  dot 4
dot 2  dot 5
dot 3  dot 6
dot 7  dot 8

Each dot is represented by one bit in a braille byte (bit x = dot x+1, x = 0-7).

Good luck.

(C)1998 J. lemmens <jlemmens@inter.nl.net>
