- java.lang.Object
-
- com.pi4j.common.IdentityBase
-
- com.pi4j.io.IOBase<Spi,SpiConfig,SpiProvider>
-
- com.pi4j.io.spi.SpiBase
-
- com.pi4j.plugin.raspberrypi.provider.spi.RpiSpi
-
- All Implemented Interfaces:
Describable
,Identity
,Lifecycle
,Extension
,IO<Spi,SpiConfig,SpiProvider>
,IODataReader
,IODataWriter
,Spi
,AutoCloseable
,Readable
public class RpiSpi extends SpiBase implements Spi
RpiSpi class.
- Version:
- $Id: $Id
- Author:
- Robert Savage (http://www.savagehomeautomation.com)
-
-
Field Summary
-
Fields inherited from class com.pi4j.common.IdentityBase
description, id, metadata, name
-
Fields inherited from interface com.pi4j.io.spi.Spi
DEFAULT_BAUD, DEFAULT_MODE
-
-
Constructor Summary
Constructors Constructor Description RpiSpi(SpiProvider provider, SpiConfig config)
Constructor for RpiSpi.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isOpen()
void
open()
int
read()
int
read(byte[] buffer, int offset, int length)
int
transfer(byte[] write, int writeOffset, byte[] read, int readOffset, int numberOfBytes)
int
write(byte b)
int
write(byte[] data, int offset, int length)
-
Methods inherited from class com.pi4j.io.IOBase
config, describe, description, initialize, name, provider, shutdown
-
Methods inherited from class com.pi4j.common.IdentityBase
description, id, metadata, name
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pi4j.common.Identity
description, getDescription, getId, getMetadata, getName, id, metadata, name
-
Methods inherited from interface com.pi4j.io.IODataReader
getInputStream, in, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readByte, readByteBuffer, readByteBuffer, readCharArray, readCharArray, readCharArray, readCharArray, readCharBuffer, readCharBuffer, readCharBuffer, readCharBuffer, readNBytes, readNBytes, readString, readString, readString, readString
-
Methods inherited from interface com.pi4j.io.IODataWriter
getOutputStream, out, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write
-
Methods inherited from interface com.pi4j.common.Lifecycle
initialize, shutdown
-
-
-
-
Constructor Detail
-
RpiSpi
public RpiSpi(SpiProvider provider, SpiConfig config)
Constructor for RpiSpi.
- Parameters:
provider
- aSpiProvider
object.config
- aSpiConfig
object.
-
-
Method Detail
-
isOpen
public boolean isOpen()
-
close
public void close()
-
transfer
public int transfer(byte[] write, int writeOffset, byte[] read, int readOffset, int numberOfBytes)
-
read
public int read()
- Specified by:
read
in interfaceIODataReader
-
read
public int read(byte[] buffer, int offset, int length)
- Specified by:
read
in interfaceIODataReader
-
write
public int write(byte b)
- Specified by:
write
in interfaceIODataWriter
-
write
public int write(byte[] data, int offset, int length)
- Specified by:
write
in interfaceIODataWriter
-
-