Package com.pi4j.io.spi
Interface SpiDevice
- 
- All Known Implementing Classes:
- SpiDeviceImpl
 
 public interface SpiDevice
- 
- 
Field SummaryFields Modifier and Type Field Description static SpiModeDEFAULT_SPI_MODEstatic intDEFAULT_SPI_SPEEDstatic intMAX_SUPPORTED_BYTES
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]write(byte... data)Attempts to read/write data through this SPI devicebyte[]write(byte[] data, int start, int length)Attempts to read/write data through this SPI deviceshort[]write(short... data)Attempts to read/write data through this SPI deviceshort[]write(short[] data, int start, int length)Attempts to read/write data through this SPI devicebyte[]write(InputStream input)Attempts to read/write data through this SPI deviceintwrite(InputStream input, OutputStream output)Attempts to read/write data through this SPI deviceStringwrite(String data, String charset)Attempts to read/write data through this SPI deviceStringwrite(String data, Charset charset)Attempts to read/write data through this SPI deviceByteBufferwrite(ByteBuffer data)Attempts to read/write data through this SPI device
 
- 
- 
- 
Field Detail- 
DEFAULT_SPI_MODEstatic final SpiMode DEFAULT_SPI_MODE 
 - 
DEFAULT_SPI_SPEEDstatic final int DEFAULT_SPI_SPEED - See Also:
- Constant Field Values
 
 - 
MAX_SUPPORTED_BYTESstatic final int MAX_SUPPORTED_BYTES - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
writeString write(String data, Charset charset) throws IOException Attempts to read/write data through this SPI device- Parameters:
- data- bytes (encoded in string) to write to the SPI device
- charset- character encoding for bytes in string
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writeString write(String data, String charset) throws IOException Attempts to read/write data through this SPI device- Parameters:
- data- bytes (encoded in string) to write to the SPI device
- charset- character encoding for bytes in string
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writeByteBuffer write(ByteBuffer data) throws IOException Attempts to read/write data through this SPI device- Parameters:
- data- bytes to write to the SPI device
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writebyte[] write(InputStream input) throws IOException Attempts to read/write data through this SPI device- Parameters:
- input- input stream to read from to get bytes to write to the SPI device
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writeint write(InputStream input, OutputStream output) throws IOException Attempts to read/write data through this SPI device- Parameters:
- input- input stream to read from to get bytes to write to the SPI device
- output- output stream to write bytes read from the SPI device
- Returns:
- number of resulting bytes read from the SPI device and written to the output stream
- Throws:
- IOException
 
 - 
writebyte[] write(byte[] data, int start, int length) throws IOExceptionAttempts to read/write data through this SPI device- Parameters:
- data- bytes to write to the SPI device
- start- start index position in the data buffer to start writing from
- length- length of bytes to write from the data buffer
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writebyte[] write(byte... data) throws IOExceptionAttempts to read/write data through this SPI device- Parameters:
- data- bytes to write to the SPI device
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writeshort[] write(short[] data, int start, int length) throws IOExceptionAttempts to read/write data through this SPI device- Parameters:
- data- bytes to write to the SPI device
- start- start index position in the data buffer to start writing from
- length- length of bytes to write from the data buffer
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 - 
writeshort[] write(short... data) throws IOExceptionAttempts to read/write data through this SPI device- Parameters:
- data- bytes to write to the SPI device (Note: short value should not exceed 255.)
- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
- IOException
 
 
- 
 
-