park.borne.impl
Class ClavierImpl

java.lang.Object
  extended bypark.borne.impl.ClavierImpl

public final class ClavierImpl
extends java.lang.Object

 *   configuration du clavier connecté sur  PCF8474
 *
 *         C1    C2    C3    C4
 *  L1 _____|1____|2____|3____|a___ PA0    1  0  0  0  1  1  1  1  1  1  1  1  0  1  1  1
 *
 *  L2 _____|4____|5____|6____|b___ PA1    1  1  1  1  0  0  0  1  1  1  1  1  1  0  1  1
 *
 *  L3 _____|7____|8____|9____|c___ PA2    1  1  1  1  1  1  1  0  0  0  1  1  1  1  0  1
 *
 *  L4 _____|*____|0____|#____|d___ PA3    0  1  1  1  1  1  1  1  1  1  0  0  1  1  1  0
 *          |     |     |     |            ----------------------------------------------
 *          |_____|_____|_____|____ PA4    1  0  1  1  0  1  1  0  1  1  0  1  1  1  1  1
 *                |     |     |
 *                |_____|_____|____ PA5    0  1  0  1  1  0  1  1  0  1  1  1  1  1  1  1
 *                      |     |
 *                      | ____|____ PA6    1  1  1  0  1  1  0  1  1  0  1  0  1  1  1  1
 *                            |
 *                            |____ PA7    1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0
 *                                         ----------------------------------------------
 *                                         0  1  2  3  4  5  6  7  8  9    #  a  b  c  d
 *  codes hexa                             D7 EE DE BE ED DD BD EB DB BB E7 B7 7E 7D 7B 77
 *
 * 0..#    : clavier 3 X 4
 *  b       : appel gardien
 *  a, c, d : non utilises
 *
 * *****************************************************************************
 *  Methode utilisée: inversion lignes <-> colonnes
 * *****************************************************************************
 *  ecrire 0xF0
 *  lecture ligne
 *  si (ligne[1] != MASQUELIGNES)          // si touche appuyée
 *  {                                      // détemination du code de la touche
 *    ecrire 0x0F
 *    lecture colonne
 *    code = (byte)(((byte)ligne[1]) | ((byte)colonne[1]));
 *  }
 *  sinon code = PASDAPPUI;
 *
 *   ecriture  0111 0000
 *   &  0110 0111   touche 1
 *      ---------
 *     ligne = 0110 0000
 *
 *   ecriture  0000 1111
 *   &  0110 0111   touche 1
 *      ---------
 *   colonne = 0000 0111
 *
 *  code de la touche = ligne | colonne = 0110 0111


Field Summary
private  byte codeGeoMem
           
private static byte MASQUECOLONNES
           
private static byte MASQUELIGNES
           
private static byte NBRETOUCHES
           
private static byte PASDAPPUI
           
private  PCF8574 pCF8574Clav
           
static byte[][] TableCodes
          transcodage code geographique -> code touche
private  boolean touchesRelachees
           
 
Constructor Summary
ClavierImpl()
           
 
Method Summary
static byte getCodeTouche(byte codeGeo)
           
 void init()
           
 void kill()
           
 byte readClavier()
           
 byte scan()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NBRETOUCHES

private static final byte NBRETOUCHES
See Also:
Constant Field Values

PASDAPPUI

private static final byte PASDAPPUI
See Also:
Constant Field Values

MASQUELIGNES

private static final byte MASQUELIGNES
See Also:
Constant Field Values

MASQUECOLONNES

private static final byte MASQUECOLONNES
See Also:
Constant Field Values

codeGeoMem

private byte codeGeoMem

touchesRelachees

private boolean touchesRelachees

pCF8574Clav

private PCF8574 pCF8574Clav

TableCodes

public static final byte[][] TableCodes
transcodage code geographique -> code touche

Constructor Detail

ClavierImpl

public ClavierImpl()
Method Detail

init

public void init()
          throws PortException
Throws:
PortException

kill

public void kill()

readClavier

public byte readClavier()

scan

public byte scan()

getCodeTouche

public static byte getCodeTouche(byte codeGeo)