orc
Class Orc

java.lang.Object
  extended by orc.Orc

public class Orc
extends java.lang.Object

Represents a connection to a uOrc board.


Field Summary
static int FAST_DIGIO_MODE_IN
           
static int FAST_DIGIO_MODE_OUT
           
static int FAST_DIGIO_MODE_SERVO
           
 boolean verbose
           
 
Constructor Summary
Orc(java.net.InetAddress inetaddr)
           
 
Method Summary
 void addListener(OrcListener ol)
           
 OrcStatus getStatus()
           
 byte[] i2cTransaction(int addr, boolean highSpeed, java.lang.Object... os)
          Perform an I2C transaction.
 byte[] i2cTransaction(int addr, java.lang.Object... os)
          Perform an I2C transaction at 400kHz.
static void main(java.lang.String[] args)
           
static Orc makeOrc()
           
static Orc makeOrc(java.lang.String hostname)
           
 int[] spiTransaction(int slaveClk, int spo, int sph, int nbits, int[] writebuf)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FAST_DIGIO_MODE_IN

public static final int FAST_DIGIO_MODE_IN
See Also:
Constant Field Values

FAST_DIGIO_MODE_OUT

public static final int FAST_DIGIO_MODE_OUT
See Also:
Constant Field Values

FAST_DIGIO_MODE_SERVO

public static final int FAST_DIGIO_MODE_SERVO
See Also:
Constant Field Values

verbose

public boolean verbose
Constructor Detail

Orc

public Orc(java.net.InetAddress inetaddr)
    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)

makeOrc

public static Orc makeOrc()

makeOrc

public static Orc makeOrc(java.lang.String hostname)

addListener

public void addListener(OrcListener ol)

getStatus

public OrcStatus getStatus()

i2cTransaction

public byte[] i2cTransaction(int addr,
                             java.lang.Object... os)
Perform an I2C transaction at 400kHz. The transaction consists of up to two phases, a write followed by a read. Same as i2cTransaction(addr, true, os).

Parameters:
addr - The I2C address, [0,127]
writebuf - A buffer containing data to be written. If null, then the write phase will be skipped.
readlen - The number of bytes to read after the write phase. If zero, the read phase will be skipped.
Returns:
The data from the I2C read phase, or null if readlen was zero.

i2cTransaction

public byte[] i2cTransaction(int addr,
                             boolean highSpeed,
                             java.lang.Object... os)
Perform an I2C transaction. The transaction consists of up to two phases, a write followed by a read.

Parameters:
addr - The I2C address, [0,127]
highSpeed - If true, the Orc will communicate with 400kHz. If false, will communicate at 100kHz.
writebuf - A buffer containing data to be written. If null, then the write phase will be skipped.
readlen - The number of bytes to read after the write phase. If zero, the read phase will be skipped.
Returns:
The data from the I2C read phase, or null if readlen was zero.

spiTransaction

public int[] spiTransaction(int slaveClk,
                            int spo,
                            int sph,
                            int nbits,
                            int[] writebuf)