de.wagner_ibw.iow.i2c
Class SD20

java.lang.Object
  |
  +--de.wagner_ibw.iow.i2c.AbstractI2CDevice
        |
        +--de.wagner_ibw.iow.i2c.SD20
All Implemented Interfaces:
I2CDevice

public class SD20
extends AbstractI2CDevice

This is the implementation of the SD20 device "Servocontroller" by Jörg Pohl (www.roboter-teile.de))

Since:
0.9.5
Author:
Thomas Wagner

Field Summary
static int CLASS
          Group 1 part of slave address for SD20
static int DEVICE_ADDRESS
          Group 2 part of slave address for SD20 There is only one address possible.
static int FIRST_SERVO_INDEX
          First servo index.
static int MAX_NUMBER_OF_SERVOS
          Maximum number of servos.
static java.lang.String NAME
          SD20 device specific constants.
 
Fields inherited from class de.wagner_ibw.iow.i2c.AbstractI2CDevice
MAX_I2C_LENGTH
 
Constructor Summary
SD20()
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other SD20 object is "equal to" this one.
 int getRevision()
           
 int hashCode()
          Returns a hash code value for this SD20 object.
 int read(int servo)
           
 void setIowDevice(AbstractIowDevice iow)
          Sets the reference to an IO-Warrior device for write report operations.
 java.lang.String toString()
          Returns Information about this SD20 as String.
 void write(int servo, int data)
           
 
Methods inherited from class de.wagner_ibw.iow.i2c.AbstractI2CDevice
getI2cAddress, getName, readI2C, reportReceived, setMonitor, writeI2C
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
SD20 device specific constants.

See Also:
Constant Field Values

CLASS

public static final int CLASS
Group 1 part of slave address for SD20

See Also:
Constant Field Values

DEVICE_ADDRESS

public static final int DEVICE_ADDRESS
Group 2 part of slave address for SD20 There is only one address possible.

See Also:
Constant Field Values

MAX_NUMBER_OF_SERVOS

public static final int MAX_NUMBER_OF_SERVOS
Maximum number of servos.

See Also:
Constant Field Values

FIRST_SERVO_INDEX

public static final int FIRST_SERVO_INDEX
First servo index.

See Also:
Constant Field Values
Constructor Detail

SD20

public SD20()
     throws java.lang.Exception
Constructor

Throws:
java.lang.Exception - If anything goes wrong.
Method Detail

getRevision

public int getRevision()
                throws java.lang.Exception
java.lang.Exception

read

public int read(int servo)
         throws java.lang.Exception,
                java.lang.IllegalArgumentException
Parameters:
servo -
Returns:
read value
Throws:
java.lang.Exception - If any transmission error occurred.
java.lang.IllegalArgumentException

write

public void write(int servo,
                  int data)
           throws java.lang.Exception,
                  java.lang.IllegalArgumentException
Parameters:
servo -
data -
Throws:
java.lang.Exception - If any transmission error occurred.
java.lang.IllegalArgumentException

setIowDevice

public void setIowDevice(AbstractIowDevice iow)
Description copied from interface: I2CDevice
Sets the reference to an IO-Warrior device for write report operations.

Specified by:
setIowDevice in interface I2CDevice
Specified by:
setIowDevice in class AbstractI2CDevice
Parameters:
iow - Instance of an IO-Warrior device.

toString

public java.lang.String toString()
Returns Information about this SD20 as String.

Overrides:
toString in class AbstractI2CDevice
Returns:
String representation of information about this SD20. (slave address, temperatures, ...).

equals

public boolean equals(java.lang.Object o)
Indicates whether some other SD20 object is "equal to" this one. Criterias are the i2c device class and i2c device address (in I2CAddress).

Overrides:
equals in class AbstractI2CDevice
Returns:
True if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for this SD20 object. It is derived from the i2c device class and i2c device address.

Overrides:
hashCode in class AbstractI2CDevice
Returns:
a hash code value for this object.