Package com.diozero.internal.spi
Interface SpiDeviceFactoryInterface
-
- All Superinterfaces:
AutoCloseable
,Closeable
,DeviceFactoryInterface
- All Known Subinterfaces:
NativeDeviceFactoryInterface
- All Known Implementing Classes:
BaseNativeDeviceFactory
,DefaultDeviceFactory
public interface SpiDeviceFactoryInterface extends DeviceFactoryInterface
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SPI_BUFFER_SIZE
Many distributions have a maximum SPI transfer of 4096 bytes.static String
SPI_PREFIX
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description InternalSpiDeviceInterface
createSpiDevice(String key, int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst)
static String
createSpiKey(String keyPrefix, int controller, int chipSelect)
default int
getSpiBufferSize()
default InternalSpiDeviceInterface
provisionSpiDevice(int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst)
-
Methods inherited from interface com.diozero.internal.spi.DeviceFactoryInterface
close, createI2CKey, createPinKey, createSerialKey, createSpiKey, deviceClosed, deviceOpened, getBoardPinInfo, getDevice, getName, isClosed, isDeviceOpened, reopen, start
-
-
-
-
Field Detail
-
DEFAULT_SPI_BUFFER_SIZE
static final int DEFAULT_SPI_BUFFER_SIZE
Many distributions have a maximum SPI transfer of 4096 bytes. This can be changed in /boot/cmdline.txt by appending spidev.bufsiz=32768- See Also:
- Constant Field Values
-
SPI_PREFIX
static final String SPI_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
provisionSpiDevice
default InternalSpiDeviceInterface provisionSpiDevice(int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) throws RuntimeIOException
- Throws:
RuntimeIOException
-
createSpiDevice
InternalSpiDeviceInterface createSpiDevice(String key, int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) throws RuntimeIOException
- Throws:
RuntimeIOException
-
getSpiBufferSize
default int getSpiBufferSize()
-
-