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
Modifier and Type Method Description SpiDeviceInterface
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 SpiDeviceInterface
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 Details
-
DEFAULT_SPI_BUFFER_SIZE
static final int DEFAULT_SPI_BUFFER_SIZEMany 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
- See Also:
- Constant Field Values
-
-
Method Details
-
provisionSpiDevice
default SpiDeviceInterface provisionSpiDevice(int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) throws RuntimeIOException- Throws:
RuntimeIOException
-
createSpiDevice
SpiDeviceInterface createSpiDevice(String key, int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) throws RuntimeIOException- Throws:
RuntimeIOException
-
getSpiBufferSize
default int getSpiBufferSize() -
createSpiKey
-