cork.net.i2c
Class AbstractLineDriver

java.lang.Object
  |
  +--cork.net.i2c.AbstractLineDriver
All Implemented Interfaces:
I2CBusMaster

public abstract class AbstractLineDriver
extends java.lang.Object
implements I2CBusMaster

Description of the Class

Author:
Brill Pappin

Constructor Summary
AbstractLineDriver()
          Constructor for the AbstractLineDriver object
 
Method Summary
 void capture(I2CDevice device)
          Captures the line driver for exclusive access by a specific device.
 boolean isCaptured()
          Indicated that the line driver is in use by another device.
 boolean isCapturedBy(I2CDevice device)
          Gets the capturedBy attribute of the AbstractLineDriver object
 void release(I2CDevice device)
          Releases and frees the line driver for capture by another device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cork.net.i2c.I2CBusMaster
read, start, stop, tick, write
 

Constructor Detail

AbstractLineDriver

public AbstractLineDriver()
Constructor for the AbstractLineDriver object
Since:
 
Method Detail

capture

public final void capture(I2CDevice device)
                   throws I2CException
Captures the line driver for exclusive access by a specific device. It is possible in a multi-threaded environment for two or more devices to try and use the i2c line at teh same time. This method acts as a sort fo thread mutex so that one device can finish its communication without interruption from another device. This method will block until the I2C line is free for communitaction.
Specified by:
capture in interface I2CBusMaster
Parameters:
device - Description of Parameter
Throws:
I2CException - Description of Exception
Since:
0.2.0

release

public final void release(I2CDevice device)
                   throws I2CException
Releases and frees the line driver for capture by another device. See: I2CBusMaster.capture()::boolean
Specified by:
release in interface I2CBusMaster
Parameters:
device - Description of Parameter
Throws:
I2CException - Description of Exception
Since:
0.2.0

isCaptured

public final boolean isCaptured()
Indicated that the line driver is in use by another device. See: I2CBusMaster.capture()::boolean
Specified by:
isCaptured in interface I2CBusMaster
Returns:
The captured value
Since:
0.2.0

isCapturedBy

public final boolean isCapturedBy(I2CDevice device)
Gets the capturedBy attribute of the AbstractLineDriver object
Parameters:
device - Description of Parameter
Returns:
The capturedBy value
Since: