public interface I2cController extends HardwareDevice
Different digital channel controllers will implement this interface.
Modifier and Type | Interface and Description |
---|---|
static interface |
I2cController.I2cPortReadyBeginEndNotifications
A callback interface through which a client can learn when portIsReady callbacks
begin and then later end.
|
static interface |
I2cController.I2cPortReadyCallback
Callback interface for I2C port ready notifications
|
HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
static byte |
I2C_BUFFER_START_ADDRESS |
Modifier and Type | Method and Description |
---|---|
void |
clearI2cPortActionFlag(int port)
Clears the port action flag, undoing the effect of previous setI2cPortActionFlag()
|
void |
copyBufferIntoWriteBuffer(int physicalPort,
byte[] buffer)
Copy a byte array into the buffer that is set to be written out to the device
|
void |
deregisterForPortReadyBeginEndCallback(int port)
Deregisters any existing notifications callback for the given port
|
void |
deregisterForPortReadyCallback(int port)
De-register for port ready notifications.
|
void |
enableI2cReadMode(int physicalPort,
I2cAddr i2cAddress,
int memAddress,
int length)
Enable read mode for a particular I2C device
|
void |
enableI2cWriteMode(int physicalPort,
I2cAddr 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
|
I2cController.I2cPortReadyCallback |
getI2cPortReadyCallback(int port)
Returns the callback currently registered to receive portIsReady notifications for the
indicated port
|
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.
|
TimeWindow |
getI2cReadCacheTimeWindow(int port)
Returns the time window object into which timestamps are placed as the read cache is populated
|
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.
|
int |
getMaxI2cWriteLatency(int port)
Returns the maximum interval, in milliseconds, from when the controller receives an I2c write
transmission over USB to when that write is actually issued to the I2c device.
|
I2cController.I2cPortReadyBeginEndNotifications |
getPortReadyBeginEndCallback(int port)
Returns the current callback registered for a given port
|
SerialNumber |
getSerialNumber()
Serial Number
|
boolean |
isArmed()
Returns whether, as of this instant, this controller is alive and operational in
its normally expected mode; that is, whether it is currently in communication
with its underlying hardware or whether it is in some other state
|
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 |
registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback,
int port)
Registers to be notification when portIsReady callbacks begin or cease
|
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, getManufacturer, getVersion, resetDeviceConfigurationForOpMode
static final byte I2C_BUFFER_START_ADDRESS
SerialNumber getSerialNumber()
void enableI2cReadMode(int physicalPort, I2cAddr 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, I2cAddr 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 deviceclearI2cPortActionFlag(int)
void clearI2cPortActionFlag(int port)
port
- physical port number on the devicesetI2cPortActionFlag(int)
boolean 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 are 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 deviceTimeWindow getI2cReadCacheTimeWindow(int port)
port
- physical port number on the devicebyte[] getI2cWriteCache(int port)
Please lock the cache before accessing it.
port
- physical port number on the deviceint getMaxI2cWriteLatency(int port)
void registerForI2cPortReadyCallback(I2cController.I2cPortReadyCallback callback, int port)
callback
- register a callbackport
- port to be monitoredI2cController.I2cPortReadyCallback getI2cPortReadyCallback(int port)
port
- the port of interestvoid deregisterForPortReadyCallback(int port)
port
- port no longer being monitored.void registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback, int port)
callback
- the callback to registerport
- the port number to register the callback onI2cController.I2cPortReadyBeginEndNotifications getPortReadyBeginEndCallback(int port)
port
- the port in questionvoid deregisterForPortReadyBeginEndCallback(int port)
port
- the port in questionboolean isArmed()
@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