DCT Lightfoot v3 API specification

com.dctl.hardware.spi
Class SPI

java.lang.Object
  |
  +--com.dctl.hardware.spi.SPI

public class SPI
extends Object

SPI class that provides access to an SPI slave device


Constructor Summary
SPI(int instance, int slave)
          Create a new SPI attached to a a particular instance using the specified slave channel
 
Method Summary
 int getFrameSize()
          Get the number of bits in the frame size
 int getTransferRate()
          Get the transfer rate in hz
 boolean isClockInFirstEdge()
          Get the value for clocking in on the first edge
 boolean isFirstEdgeFalling()
          Get the value of the first edge falling
 void setClockInFirstEdge(boolean state)
          Set true to clock in on the first edge
 void setFirstEdgeFalling(boolean state)
          Make the first edge a falling edge
 void setFrameSize(int bits)
          Set the value of the frame size
 void setTransferRate(int rate)
          Set the transmit rate in hz
 void transfer(byte[] outBuffer, int outOffset, int outFrames, byte[] inBuffer, int inOffset, int inFrames)
          Transfer data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPI

public SPI(int instance,
           int slave)
    throws SystemException
Create a new SPI attached to a a particular instance using the specified slave channel

Parameters:
instance - The instance
slave - The slave channel
Throws:
SystemException - if there is an error
Method Detail

setFirstEdgeFalling

public void setFirstEdgeFalling(boolean state)
                         throws SystemException
Make the first edge a falling edge

Parameters:
state - True to set it, false to clear it
Throws:
SystemException - if there is an error

isFirstEdgeFalling

public boolean isFirstEdgeFalling()
Get the value of the first edge falling

Returns:
true if it is, false otherwise

setClockInFirstEdge

public void setClockInFirstEdge(boolean state)
                         throws SystemException
Set true to clock in on the first edge

Parameters:
state - true to clock in on the first edge, false otherwise
Throws:
SystemException - if there is an error

isClockInFirstEdge

public boolean isClockInFirstEdge()
Get the value for clocking in on the first edge

Returns:
true if it is, false otherwise

setFrameSize

public void setFrameSize(int bits)
                  throws SystemException
Set the value of the frame size

Parameters:
bits - The number of bits
Throws:
SystemException - if there is an error

getFrameSize

public int getFrameSize()
Get the number of bits in the frame size

Returns:
the number of bits

setTransferRate

public void setTransferRate(int rate)
                     throws SystemException
Set the transmit rate in hz

Parameters:
rate - The transfer rate
Throws:
SystemException - if there is an error

getTransferRate

public int getTransferRate()
Get the transfer rate in hz

Returns:
the rate

transfer

public void transfer(byte[] outBuffer,
                     int outOffset,
                     int outFrames,
                     byte[] inBuffer,
                     int inOffset,
                     int inFrames)
              throws SystemException
Transfer data

Parameters:
outBuffer - The output buffer
outOffset - The offset into the output buffer
outFrames - The number of frames to output
inBuffer - The input buffer
inOffset - The offset into the input buffer
inFrames - The number of frames to input
Throws:
SystemException - if there is an error

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification