public class I2cImplUsb extends Object
| Constructor and Description |
|---|
I2cImplUsb() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
void |
open(I2c.ConnType connType,
String ident,
int param)
Opens a connection.
|
int |
read(int addr)
Reads a byte from a device without registers.
|
int |
read(int addr,
byte[] buff,
int count)
Reads multiple bytes from a device without registers.
|
int |
read(int addr,
int reg,
byte[] buff,
int count)
Reads multiple bytes from a device with 1-byte register numbers.
|
int |
read2(int addr,
int reg,
byte[] buff,
int count)
Reads multiple bytes from a device with 2-byte register numbers.
|
void |
setTimeout(double timeout)
Sets the read timeout.
|
void |
write(int addr,
int value)
Writes a byte to a device without registers.
|
void |
write(int addr,
int reg,
byte[] buff,
int count)
Writes multiple bytes to a device with 1-byte register numbers.
|
void |
write2(int addr,
int reg,
byte[] buff,
int count)
Writes multiple bytes to a device with 2-byte register numbers.
|
public void open(I2c.ConnType connType, String ident, int param) throws org.lsst.ccs.drivers.commons.DriverException
connType - The enumerated connection type: USBFTDI or USBSERIALident - The USB ID (FTDI) or port name (SERIAL)param - Open parameter (not used)org.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setTimeout(double timeout)
throws org.lsst.ccs.drivers.commons.DriverException
timeout - The timeout (secs). 0 means no timeout.org.lsst.ccs.drivers.commons.DriverExceptionpublic void write(int addr,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressvalue - The byte value to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic int read(int addr)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressorg.lsst.ccs.drivers.commons.DriverExceptionpublic int read(int addr,
byte[] buff,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressbuff - The read buffercount - The number of bytes to readorg.lsst.ccs.drivers.commons.DriverExceptionpublic void write(int addr,
int reg,
byte[] buff,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The write buffercount - The number of bytes to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic int read(int addr,
int reg,
byte[] buff,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The read buffercount - The number of bytes to readorg.lsst.ccs.drivers.commons.DriverExceptionpublic void write2(int addr,
int reg,
byte[] buff,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The read buffercount - The number of bytes to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic int read2(int addr,
int reg,
byte[] buff,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The read buffercount - The number of bytes to readorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2021 LSST. All rights reserved.