|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.peripheral.external.BoardDeviceSPI
public class BoardDeviceSPI
SPI implementation that hides the use of a DeviceSelector before sending SPI commands.
SeeISPI
for details of usage.
Constructor Summary | |
---|---|
BoardDeviceSPI(int deviceAddress,
PeripheralChipSelect chipSelect,
int spiConfiguration)
Create a BoardDeviceSPI using the supplied device address. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoardDeviceSPI(int deviceAddress, PeripheralChipSelect chipSelect, int spiConfiguration)
ISpiMaster
for
details of SPI configuration settings.
deviceAddress
- The device address to use when accessing the SPIchipSelect
- The board chip select of the board that this device is onspiConfiguration
- Value to be written into SPI_CSR for transfers to this deviceMethod Detail |
---|
public void send16bits(int i)
ISPI
send16bits
in interface ISPI
i
- The data to send (least sig. 16 bits only), MSB first.public void sendSPICommand(byte[] commandSequence, byte[] readByteSequence)
ISPI
sendSPICommand
in interface ISPI
commandSequence
- The data to sendreadByteSequence
- An array into which the received data is placedpublic void sendSPICommand(byte[] commandSequence, int commandLength, byte[] readByteSequence, int readLength)
ISPI
sendSPICommand
in interface ISPI
commandSequence
- The data to sendcommandLength
- The number of bytes to sendreadByteSequence
- An array into which the received data is placedreadLength
- The number of bytes to receivepublic void sendSPICommand(byte[] commandSequence, int commandLength, byte[] readByteSequence, int readLength, int readOffset)
ISPI
sendSPICommand
in interface ISPI
commandSequence
- The data to sendcommandLength
- The number of bytes to sendreadByteSequence
- An array into which the received data is placedreadLength
- The number of bytes to receivereadOffset
- The number of bytes to send before beginning receptionpublic void setConfiguration(int config)
ISPI
ISpiMaster
setConfiguration
in interface ISPI
config
- The configuration of the SPI communications to use for this device.
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |