public interface I2cController extends HardwareDevice
Different digital channel controllers will implement this interface.
Modifier and Type | Interface and Description |
---|---|
static interface |
I2cController.I2cPortReadyCallback
Callback interface for I2C port ready notifications
|
Modifier and Type | Field and Description |
---|---|
static byte |
I2C_BUFFER_START_ADDRESS |
Modifier and Type | Method and Description |
---|---|
void |
copyBufferIntoWriteBuffer(int physicalPort,
byte[] buffer)
Copy a byte array into the buffer that is set to be written out to the device
|
void |
deregisterForPortReadyCallback(int port)
De-register for port ready notifications.
|
void |
enableI2cReadMode(int physicalPort,
int i2cAddress,
int memAddress,
int length)
Enable read mode for a particular I2C device
|
void |
enableI2cWriteMode(int physicalPort,
int i2cAddress,
int memAddress,
int length)
Enable write mode for a particular I2C device
|
byte[] |
getCopyOfReadBuffer(int physicalPort)
Get a copy of the most recent data read in from the device
|
byte[] |
getCopyOfWriteBuffer(int physicalPort)
Get a copy of the data that is set to be written out to the device
|
byte[] |
getI2cReadCache(int port)
Get direct access to the cache that I2C reads will be populated into
|
java.util.concurrent.locks.Lock |
getI2cReadCacheLock(int port)
Get access to the read cache lock.
|
byte[] |
getI2cWriteCache(int port)
Get direct access to the cache that I2C writes will be populated into
|
java.util.concurrent.locks.Lock |
getI2cWriteCacheLock(int port)
Get access to the write cache lock.
|
SerialNumber |
getSerialNumber()
Serial Number
|
boolean |
isI2cPortActionFlagSet(int port)
Get the port action flag; this flag is set if the particular port is busy.
|
boolean |
isI2cPortInReadMode(int port)
Is the port in read mode?
|
boolean |
isI2cPortInWriteMode(int port)
Is the port in write mode?
|
boolean |
isI2cPortReady(int port)
Determine if a physical port is ready
|
void |
readI2cCacheFromController(int port)
Read the local cache in from the I2C Controller
NOTE: unless this method is called the internal cache isn't updated
|
void |
readI2cCacheFromModule(int port)
Deprecated.
|
void |
registerForI2cPortReadyCallback(I2cController.I2cPortReadyCallback callback,
int port)
Register to be notified when a given I2C port is ready.
|
void |
setI2cPortActionFlag(int port)
Set the port action flag; this flag tells the controller to send the
current data in its buffer to the I2C device
|
void |
writeI2cCacheToController(int port)
Write the local cache to the I2C Controller
NOTE: unless this method is called the internal cache isn't updated
|
void |
writeI2cCacheToModule(int port)
Deprecated.
|
void |
writeI2cPortFlagOnlyToController(int port)
Write just the port action flag in the local cache to the I2C controller
|
void |
writeI2cPortFlagOnlyToModule(int port)
Deprecated.
|
close, getConnectionInfo, getDeviceName, getVersion
static final byte I2C_BUFFER_START_ADDRESS
SerialNumber getSerialNumber()
void enableI2cReadMode(int physicalPort, int i2cAddress, int memAddress, int length)
physicalPort
- the port the device is attached toi2cAddress
- the i2c address of the devicememAddress
- mem address at which to start readinglength
- number of bytes to readvoid enableI2cWriteMode(int physicalPort, int i2cAddress, int memAddress, int length)
physicalPort
- the port the device is attached toi2cAddress
- the i2c address of the devicememAddress
- the memory address at which to start writinglength
- number of bytes to readbyte[] getCopyOfReadBuffer(int physicalPort)
physicalPort
- the port the device is attached tobyte[] getCopyOfWriteBuffer(int physicalPort)
physicalPort
- the port the device is attached tovoid copyBufferIntoWriteBuffer(int physicalPort, byte[] buffer)
physicalPort
- the port the device is attached tobuffer
- buffer to copyvoid setI2cPortActionFlag(int port)
port
- physical port number on the deviceboolean isI2cPortActionFlagSet(int port)
port
- physical port number on the devicevoid readI2cCacheFromController(int port)
port
- physical port number on the devicevoid writeI2cCacheToController(int port)
port
- physical port number on the devicevoid writeI2cPortFlagOnlyToController(int port)
port
- physical port number on the deviceboolean isI2cPortInReadMode(int port)
port
- physical port number on the deviceboolean isI2cPortInWriteMode(int port)
port
- physical port number on the deviceboolean isI2cPortReady(int port)
port
- physical port number on the devicejava.util.concurrent.locks.Lock getI2cReadCacheLock(int port)
This is needed if you are accessing the read cache directly. The read cache lock needs to be acquired before attempting to interact with the read cache
port
- physical port number on the devicejava.util.concurrent.locks.Lock getI2cWriteCacheLock(int port)
This is needed if you ace accessing the write cache directly. The write cache lock needs to be acquired before attempting to interact with the write cache
port
- physical port number on the devicebyte[] getI2cReadCache(int port)
Please lock the cache before accessing it.
port
- physical port number on the devicebyte[] getI2cWriteCache(int port)
Please lock the cache before accessing it.
port
- physical port number on the devicevoid registerForI2cPortReadyCallback(I2cController.I2cPortReadyCallback callback, int port)
callback
- register a callbackport
- port to be monitoredvoid deregisterForPortReadyCallback(int port)
port
- port no longer being monitored.@Deprecated void readI2cCacheFromModule(int port)
port
- physical port number on the device@Deprecated void writeI2cCacheToModule(int port)
port
- physical port number on the device@Deprecated void writeI2cPortFlagOnlyToModule(int port)
port
- physical port number on the device