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
           
static int FAST_DIGIO_MODE_SLOW_PWM
           
 boolean verbose
           
 
Constructor Summary
Orc(java.net.InetAddress inetaddr)
           
 
Method Summary
 void addListener(OrcListener ol)
           
 OrcResponse doCommand(int commandId, byte[] payload)
           
 OrcResponse doCommandEx(int commandId, byte[] payload)
          try a transaction once
 java.net.InetAddress getAddress()
           
 OrcStatus getStatus()
           
 java.lang.String getVersion()
           
 byte[] i2cTransaction(int addr, java.lang.Object... os)
          Perform an I2C transaction.
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)
           
 long toHostUtime(long uorcUtime)
           
 
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

FAST_DIGIO_MODE_SLOW_PWM

public static final int FAST_DIGIO_MODE_SLOW_PWM
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)

getAddress

public java.net.InetAddress getAddress()

makeOrc

public static Orc makeOrc()

toHostUtime

public long toHostUtime(long uorcUtime)

getVersion

public java.lang.String getVersion()

makeOrc

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

addListener

public void addListener(OrcListener ol)

doCommand

public OrcResponse doCommand(int commandId,
                             byte[] payload)

doCommandEx

public OrcResponse doCommandEx(int commandId,
                               byte[] payload)
                        throws java.io.IOException
try a transaction once

Throws:
java.io.IOException

getStatus

public OrcStatus getStatus()

i2cTransaction

public byte[] i2cTransaction(int addr,
                             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]
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)