mat.i2c.master
Class MasterBusI2c

java.lang.Object
  |
  +--com.dalsemi.system.I2CPort
        |
        +--mat.i2c.master.MasterBusI2c
All Implemented Interfaces:
BusI2c

public class MasterBusI2c
extends com.dalsemi.system.I2CPort
implements BusI2c

Titre : Master Bus I2c

Description : commande du bus I2c. Singleton

Copyright : Copyright (c) 2003

Société :


Fields inherited from class com.dalsemi.system.I2CPort
clockDelay, SCLAddress, SCLMask, SDAAddress, SDAMask, slaveAddress, STRETCH0, STRETCH1, STRETCH10, STRETCH2, STRETCH3, STRETCH7, STRETCH8, STRETCH9, stretchCycles
 
Constructor Summary
protected MasterBusI2c()
           
 
Method Summary
 PortI2c createPortI2cAt(int adresse)
           
 int doTrame(byte[] trame)
          Envoi d'une trame sur le bus I2c
 java.util.Vector getAllPorts()
           
 int getClockDelay()
          Vitesse du bus I2C
static MasterBusI2c getInstance()
           
 PortI2c getPortI2cAt(int adresse)
           
static void kill()
           
 int read(int adresse, byte[] barr, int off, int len)
          Lecture d'un composant I2c
 boolean removePortI2c(PortI2c portI2c)
           
 void setBusConnexion(boolean on)
          Connexion du bus
 void setClockDelay(int delai)
          Fixer la vitesse du bus I2C Les composants I2C acceptent une fréquence de l'horloge du bus I2C de 100KHz max.
 void setNumeroAcces(int num)
          Un identificateur du bus
 int write(int adresse, byte[] barr, int off, int len)
          Ecriture dans un composant I2c
 int writeRead(int adresse, byte[] wbarr, int woff, int wlen, byte[] rbarr, int roff, int rlen)
          Pas implémentée
 
Methods inherited from class com.dalsemi.system.I2CPort
getStretchCycles, read, setAddress, setClockDelay, setStretchCycles, write
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterBusI2c

protected MasterBusI2c()
Method Detail

getInstance

public static MasterBusI2c getInstance()

setNumeroAcces

public void setNumeroAcces(int num)
Description copied from interface: BusI2c
Un identificateur du bus
Specified by:
setNumeroAcces in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
num - identificateur

setBusConnexion

public void setBusConnexion(boolean on)
Description copied from interface: BusI2c
Connexion du bus
Specified by:
setBusConnexion in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
on - vrai:connecté, faux déconnecté

kill

public static void kill()

createPortI2cAt

public PortI2c createPortI2cAt(int adresse)

removePortI2c

public boolean removePortI2c(PortI2c portI2c)

getAllPorts

public java.util.Vector getAllPorts()

getPortI2cAt

public PortI2c getPortI2cAt(int adresse)

getClockDelay

public int getClockDelay()
Description copied from interface: BusI2c
Vitesse du bus I2C
Specified by:
getClockDelay in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Returns:
Un entier lié à la période du bus I2C (SCL)

setClockDelay

public void setClockDelay(int delai)
Description copied from interface: BusI2c
Fixer la vitesse du bus I2C Les composants I2C acceptent une fréquence de l'horloge du bus I2C de 100KHz max.
Specified by:
setClockDelay in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
delai - valeur du délai

write

public int write(int adresse,
                 byte[] barr,
                 int off,
                 int len)
Description copied from interface: BusI2c
Ecriture dans un composant I2c
Specified by:
write in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
adresse - I2c du composant
barr - un tableau d'octets à transmettre
off - offset
len - longueur
Returns:
O ok ou -1 si erreur

read

public int read(int adresse,
                byte[] barr,
                int off,
                int len)
Description copied from interface: BusI2c
Lecture d'un composant I2c
Specified by:
read in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
adresse - I2c du composant
barr - un tableau d'octets ou seront placés les octets lus
off - offset
len - longueur
Returns:
0 OK ou -1 si erreur

writeRead

public int writeRead(int adresse,
                     byte[] wbarr,
                     int woff,
                     int wlen,
                     byte[] rbarr,
                     int roff,
                     int rlen)
Description copied from interface: BusI2c
Pas implémentée
Specified by:
writeRead in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
adresseI2c - I2c du composant
wbarr - un tableau d'octets à transmettre
woff - offset
wlen - longueur
rbarr - un tableau d'octets ou seront placés les octets lus
roff - offset
rlen - longueur
Returns:
0: ok -1: erreur

doTrame

public int doTrame(byte[] trame)
Description copied from interface: BusI2c
Envoi d'une trame sur le bus I2c
Specified by:
doTrame in interface BusI2c
Following copied from interface: mat.i2c.master.BusI2c
Parameters:
trame - Le premier octet correspond à l'adresse du composant + R/W
Returns:
0 si OK, -1 si erreur