SunSPOT API V3.0


com.sun.spot.peripheral.external
Interface ISPI

All Known Implementing Classes:
BoardDeviceSPI

public interface ISPI

An interface defining the SPI operations used by external boards. 09-Mar-2005


Method Summary
 void send16bits(int i)
          Send 16 bits of data.
 void sendSPICommand(byte[] commandSequence, byte[] readByteSequence)
          Send and receive using SPI.
 void sendSPICommand(byte[] commandSequence, int commandLength, byte[] readByteSequence, int readLength)
          Send and receive using SPI.
 void sendSPICommand(byte[] commandSequence, int commandLength, byte[] readByteSequence, int readLength, int readOffset)
          Send and receive using SPI.
 void setConfiguration(int config)
          Set the configuration of the SPI communications for this device.
 

Method Detail

send16bits

void send16bits(int i)
Send 16 bits of data.

Parameters:
i - The data to send (least sig. 16 bits only), MSB first.

sendSPICommand

void sendSPICommand(byte[] commandSequence,
                    byte[] readByteSequence)
Send and receive using SPI. Data is sent and received at the same time. All the data in the commandSequence is sent, and n bytes are simultaneously received, where n is the length of the readByteSequence.

Parameters:
commandSequence - The data to send
readByteSequence - An array into which the received data is placed

sendSPICommand

void sendSPICommand(byte[] commandSequence,
                    int commandLength,
                    byte[] readByteSequence,
                    int readLength)
Send and receive using SPI. Data is sent and received at the same time.

Parameters:
commandSequence - The data to send
commandLength - The number of bytes to send
readByteSequence - An array into which the received data is placed
readLength - The number of bytes to receive

sendSPICommand

void sendSPICommand(byte[] commandSequence,
                    int commandLength,
                    byte[] readByteSequence,
                    int readLength,
                    int readOffset)
Send and receive using SPI. Receiving can be delayed relative to sending.

Parameters:
commandSequence - The data to send
commandLength - The number of bytes to send
readByteSequence - An array into which the received data is placed
readLength - The number of bytes to receive
readOffset - The number of bytes to send before beginning reception

setConfiguration

void setConfiguration(int config)
Set the configuration of the SPI communications for this device. The configuration sets up speed etc as per SPI_CSRx. Constants for the configuration are defined in: ISpiMaster

Parameters:
config - The configuration of the SPI communications to use for this device.

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.