Package com.pi4j.io.spi
Interface SpiDevice
-
- All Known Implementing Classes:
SpiDeviceImpl
public interface SpiDevice
-
-
Field Summary
Fields Modifier and Type Field Description static SpiModeDEFAULT_SPI_MODEstatic intDEFAULT_SPI_SPEEDstatic intMAX_SUPPORTED_BYTES
-
Method Summary
All 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_MODE
static final SpiMode DEFAULT_SPI_MODE
-
DEFAULT_SPI_SPEED
static final int DEFAULT_SPI_SPEED
- See Also:
- Constant Field Values
-
MAX_SUPPORTED_BYTES
static final int MAX_SUPPORTED_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
write
String 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 devicecharset- character encoding for bytes in string- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
IOException
-
write
String 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 devicecharset- character encoding for bytes in string- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
IOException
-
write
ByteBuffer 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
-
write
byte[] 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
-
write
int 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 deviceoutput- 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
-
write
byte[] 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 devicestart- start index position in the data buffer to start writing fromlength- length of bytes to write from the data buffer- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
IOException
-
write
byte[] 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
-
write
short[] 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 devicestart- start index position in the data buffer to start writing fromlength- length of bytes to write from the data buffer- Returns:
- resulting bytes read from the SPI device after the write operation
- Throws:
IOException
-
write
short[] 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
-
-