public class I2c extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
I2c.ConnType
Constants & data.
|
| Constructor and Description |
|---|
I2c() |
| 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)
Reads multiple bytes 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)
Reads multiple bytes from a device with 1-byte register numbers.
|
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)
Reads multiple bytes from a device with 2-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)
Writes multiple bytes to a device with 1-byte register numbers.
|
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)
Writes multiple bytes to a device with 2-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 typeident - The identificationparam - The parameterorg.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 int read(int addr,
byte[] buff)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressbuff - The read bufferorg.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 void write(int addr,
int reg,
byte[] buff)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The write bufferorg.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 int read(int addr,
int reg,
byte[] buff)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The read bufferorg.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 write buffercount - The number of bytes to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void write2(int addr,
int reg,
byte[] buff)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The write bufferorg.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.DriverExceptionpublic int read2(int addr,
int reg,
byte[] buff)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The I2C addressreg - The register numberbuff - The read bufferorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2020 LSST. All rights reserved.