public abstract class ModernRoboticsUsbI2cController extends ModernRoboticsUsbDevice implements I2cController
ModernRoboticsUsbDevice.CreateReadWriteRunnable
I2cController.I2cPortReadyBeginEndNotifications, I2cController.I2cPortReadyCallback
HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
protected I2cController.I2cPortReadyBeginEndNotifications[] |
i2cPortReadyBeginEndCallbacks |
protected boolean |
notificationsActive |
protected int |
numberOfI2cPorts |
createReadWriteRunnable, readWriteRunnable, readWriteService
I2C_BUFFER_START_ADDRESS
Constructor and Description |
---|
ModernRoboticsUsbI2cController(int numberOfI2cPorts,
Context context,
SerialNumber serialNumber,
SyncdDevice.Manager manager,
OpenRobotUsbDevice openRobotUsbDevice,
ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable) |
Modifier and Type | Method and Description |
---|---|
void |
deregisterForPortReadyBeginEndCallback(int port)
Deregisters any existing notifications callback for the given port
|
I2cController.I2cPortReadyBeginEndNotifications |
getPortReadyBeginEndCallback(int port)
Returns the current callback registered for a given port
|
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
|
void |
registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback,
int port)
Registers to be notification when portIsReady callbacks begin or cease
|
void |
shutdownComplete() |
void |
startupComplete() |
protected void |
throwIfI2cPortIsInvalid(int port) |
armDevice, disarmDevice, getCreateReadWriteRunnable, getDeviceName, getOpenRobotUsbDevice, getPretendDevice, getReadWriteRunnable, getVersion, initializeHardware, read, read8, readComplete, readFromWriteCache, readFromWriteCache, write, write8, write8, write8, writeComplete
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearI2cPortActionFlag, copyBufferIntoWriteBuffer, deregisterForPortReadyCallback, enableI2cReadMode, enableI2cWriteMode, getCopyOfReadBuffer, getCopyOfWriteBuffer, getI2cPortReadyCallback, getI2cReadCache, getI2cReadCacheLock, getI2cReadCacheTimeWindow, getI2cWriteCache, getI2cWriteCacheLock, getMaxI2cWriteLatency, getSerialNumber, isI2cPortActionFlagSet, isI2cPortInReadMode, isI2cPortInWriteMode, isI2cPortReady, readI2cCacheFromController, readI2cCacheFromModule, registerForI2cPortReadyCallback, setI2cPortActionFlag, writeI2cCacheToController, writeI2cCacheToModule, writeI2cPortFlagOnlyToController, writeI2cPortFlagOnlyToModule
close, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpMode
protected final int numberOfI2cPorts
protected final I2cController.I2cPortReadyBeginEndNotifications[] i2cPortReadyBeginEndCallbacks
protected boolean notificationsActive
public ModernRoboticsUsbI2cController(int numberOfI2cPorts, Context context, SerialNumber serialNumber, SyncdDevice.Manager manager, OpenRobotUsbDevice openRobotUsbDevice, ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable) throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected void throwIfI2cPortIsInvalid(int port)
public boolean isArmed()
I2cController
isArmed
in interface I2cController
public void registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback, int port)
I2cController
registerForPortReadyBeginEndCallback
in interface I2cController
callback
- the callback to registerport
- the port number to register the callback onpublic I2cController.I2cPortReadyBeginEndNotifications getPortReadyBeginEndCallback(int port)
I2cController
getPortReadyBeginEndCallback
in interface I2cController
port
- the port in questionpublic void deregisterForPortReadyBeginEndCallback(int port)
I2cController
deregisterForPortReadyBeginEndCallback
in interface I2cController
port
- the port in questionpublic void startupComplete() throws java.lang.InterruptedException
startupComplete
in interface ReadWriteRunnable.Callback
startupComplete
in class ModernRoboticsUsbDevice
java.lang.InterruptedException
public void shutdownComplete() throws java.lang.InterruptedException
shutdownComplete
in interface ReadWriteRunnable.Callback
shutdownComplete
in class ModernRoboticsUsbDevice
java.lang.InterruptedException